mirror of
https://github.com/rancher/types.git
synced 2025-09-16 14:59:16 +00:00
Add azureAD config
This commit is contained in:
committed by
Craig Jellick
parent
01dd042b75
commit
a6785a56fe
@@ -111,11 +111,35 @@ type GithubConfigTestOutput struct {
|
||||
}
|
||||
|
||||
type GithubConfigApplyInput struct {
|
||||
GithubConfig GithubConfig `json:"githubConfig, omitempty"`
|
||||
GithubConfig GithubConfig `json:"githubConfig,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
}
|
||||
|
||||
type AzureADConfig struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
AuthConfig `json:",inline" mapstructure:",squash"`
|
||||
|
||||
Endpoint string `json:"endpoint,omitempty" norman:"default=https://login.microsoftonline.com/,required,notnullable"`
|
||||
GraphEndpoint string `json:"graphEndpoint,omitempty" norman:"required,notnullable"`
|
||||
TokenEndpoint string `json:"tokenEndpoint,omitempty" norman:"required,notnullable"`
|
||||
AuthEndpoint string `json:"authEndpoint,omitempty" norman:"required,notnullable"`
|
||||
TenantID string `json:"tenantId,omitempty" norman:"required,notnullable"`
|
||||
ApplicationID string `json:"applicationId,omitempty" norman:"required,notnullable"`
|
||||
ApplicationSecret string `json:"applicationSecret,omitempty" norman:"required,notnullable,type=password"`
|
||||
RancherURL string `json:"rancherUrl,omitempty" norman:"required,notnullable"`
|
||||
}
|
||||
|
||||
type AzureADConfigTestOutput struct {
|
||||
RedirectURL string `json:"redirectUrl"`
|
||||
}
|
||||
|
||||
type AzureADConfigApplyInput struct {
|
||||
Config AzureADConfig `json:"config,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
}
|
||||
|
||||
type ActiveDirectoryConfig struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -146,7 +170,7 @@ type ActiveDirectoryConfig struct {
|
||||
}
|
||||
|
||||
type ActiveDirectoryTestAndApplyInput struct {
|
||||
ActiveDirectoryConfig ActiveDirectoryConfig `json:"activeDirectoryConfig, omitempty"`
|
||||
ActiveDirectoryConfig ActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
|
@@ -326,6 +326,24 @@ func authnTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}).
|
||||
MustImport(&Version, v3.GithubConfigTestOutput{}).
|
||||
MustImport(&Version, v3.GithubConfigApplyInput{}).
|
||||
//AzureAD Config
|
||||
MustImportAndCustomize(&Version, v3.AzureADConfig{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "authConfig"
|
||||
schema.ResourceActions = map[string]types.Action{
|
||||
"disable": {},
|
||||
"configureTest": {
|
||||
Input: "azureADConfig",
|
||||
Output: "azureADConfigTestOutput",
|
||||
},
|
||||
"testAndApply": {
|
||||
Input: "azureADConfigApplyInput",
|
||||
},
|
||||
}
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{http.MethodGet, http.MethodPut}
|
||||
}).
|
||||
MustImport(&Version, v3.AzureADConfigTestOutput{}).
|
||||
MustImport(&Version, v3.AzureADConfigApplyInput{}).
|
||||
// Active Directory Config
|
||||
MustImportAndCustomize(&Version, v3.ActiveDirectoryConfig{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "authConfig"
|
||||
|
@@ -49,3 +49,16 @@ type ActiveDirectoryProvider struct {
|
||||
|
||||
DefaultLoginDomain string `json:"defaultLoginDomain,omitempty"`
|
||||
}
|
||||
|
||||
type AzureADProvider struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
AuthProvider `json:",inline"`
|
||||
|
||||
RedirectURL string `json:"redirectUrl"`
|
||||
}
|
||||
|
||||
type AzureADLogin struct {
|
||||
GenericLogin `json:",inline"`
|
||||
Code string `json:"code" norman:"type=string,required"`
|
||||
}
|
||||
|
@@ -67,5 +67,18 @@ func authProvidersTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
})
|
||||
}).
|
||||
// Azure AD provider
|
||||
MustImportAndCustomize(&PublicVersion, v3public.AzureADProvider{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "authProvider"
|
||||
schema.ResourceActions = map[string]types.Action{
|
||||
"login": {
|
||||
Input: "azureADLogin",
|
||||
Output: "token",
|
||||
},
|
||||
}
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
}).
|
||||
MustImport(&PublicVersion, v3public.AzureADLogin{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user