package com.starry.admin.common.security.config;

import java.util.ArrayList;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "apitest.security")
public class ApiTestSecurityProperties {

    private String tenantHeader = "X-Tenant";
    private String userHeader = "X-Test-User";
    private final Defaults defaults = new Defaults();

    public String getTenantHeader() {
        return tenantHeader;
    }

    public void setTenantHeader(String tenantHeader) {
        this.tenantHeader = tenantHeader;
    }

    public String getUserHeader() {
        return userHeader;
    }

    public void setUserHeader(String userHeader) {
        this.userHeader = userHeader;
    }

    public Defaults getDefaults() {
        return defaults;
    }

    public static class Defaults {

        private String tenantId = "tenant-apitest";
        private String userId = "apitest-user";
        private List<String> roles = new ArrayList<>();
        private List<String> permissions = new ArrayList<>();

        public String getTenantId() {
            return tenantId;
        }

        public void setTenantId(String tenantId) {
            this.tenantId = tenantId;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public List<String> getRoles() {
            return roles;
        }

        public void setRoles(List<String> roles) {
            this.roles = roles;
        }

        public List<String> getPermissions() {
            return permissions;
        }

        public void setPermissions(List<String> permissions) {
            this.permissions = permissions;
        }
    }
}
