-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.go
31 lines (26 loc) · 1001 Bytes
/
setup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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,
}
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)
}
}