36 Star 396 Fork 71

GVPrancher / rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
setup.go 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
package providers
import (
"context"
"github.com/rancher/rancher/pkg/api/store/auth"
"github.com/rancher/rancher/pkg/namespace"
"github.com/rancher/norman/store/subtype"
"github.com/rancher/norman/types"
managementschema "github.com/rancher/types/apis/management.cattle.io/v3/schema"
"github.com/rancher/types/client/management/v3"
"github.com/rancher/types/config"
)
var authConfigTypes = []string{
client.GithubConfigType,
client.LocalConfigType,
client.ActiveDirectoryConfigType,
client.AzureADConfigType,
client.OpenLdapConfigType,
client.FreeIpaConfigType,
client.PingConfigType,
client.ADFSConfigType,
client.KeyCloakConfigType,
client.OKTAConfigType,
}
func SetupAuthConfig(ctx context.Context, management *config.ScaledContext, schemas *types.Schemas) {
Configure(ctx, management)
authConfigBaseSchema := schemas.Schema(&managementschema.Version, client.AuthConfigType)
authConfigBaseSchema.Store = auth.Wrap(authConfigBaseSchema.Store, management.Core.Secrets(namespace.GlobalNamespace))
for _, authConfigSubtype := range authConfigTypes {
subSchema := schemas.Schema(&managementschema.Version, authConfigSubtype)
GetProviderByType(authConfigSubtype).CustomizeSchema(subSchema)
subSchema.Store = subtype.NewSubTypeStore(authConfigSubtype, authConfigBaseSchema.Store)
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.2.2-rc5

搜索帮助

344bd9b3 5694891 D2dac590 5694891