37 Star 403 Fork 75

GVPrancher/rancher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
setup.go 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
carolyn 提交于 2018-08-14 13:01 . add keycloak as an auth provider
package providers
import (
"context"
"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,
}
func SetupAuthConfig(ctx context.Context, management *config.ScaledContext, schemas *types.Schemas) {
Configure(ctx, management)
authConfigBaseSchema := schemas.Schema(&managementschema.Version, client.AuthConfigType)
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.1.1-rc3

搜索帮助