mirror of
https://github.com/rancher/types.git
synced 2025-09-17 07:19:17 +00:00
Add SAML-ping type
This commit is contained in:
@@ -269,3 +269,26 @@ type FreeIpaConfig struct {
|
||||
type FreeIpaTestAndApplyInput struct {
|
||||
LdapTestAndApplyInput `json:",inline" mapstructure:",squash"`
|
||||
}
|
||||
|
||||
type SamlConfig struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
AuthConfig `json:",inline" mapstructure:",squash"`
|
||||
|
||||
IDPMetadataContent string `json:"idpMetadataContent" norman:"required"`
|
||||
SPSelfSignedCert string `json:"spCert" norman:"required"`
|
||||
SPSelfSignedKey string `json:"spKey" norman:"required"`
|
||||
GroupsField string `json:"groupsField" norman:"required"`
|
||||
DisplayNameField string `json:"displayNameField" norman:"required"`
|
||||
UserNameField string `json:"userNameField" norman:"required"`
|
||||
UIDField string `json:"uidField" norman:"required"`
|
||||
RancherAPIHost string `json:"rancherApiHost" norman:"required"`
|
||||
}
|
||||
|
||||
type PingConfig struct {
|
||||
SamlConfig `json:",inline" mapstructure:",squash"`
|
||||
}
|
||||
|
||||
type SamlConfigTestInput struct {
|
||||
FinalRedirectURL string `json:"finalRedirectUrl"`
|
||||
}
|
||||
|
@@ -407,7 +407,21 @@ func authnTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return f
|
||||
})
|
||||
}).
|
||||
MustImport(&Version, v3.FreeIpaTestAndApplyInput{})
|
||||
MustImport(&Version, v3.FreeIpaTestAndApplyInput{}).
|
||||
// Saml Config
|
||||
// Ping-Saml Config
|
||||
MustImportAndCustomize(&Version, v3.PingConfig{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "authConfig"
|
||||
schema.ResourceActions = map[string]types.Action{
|
||||
"disable": {},
|
||||
"testAndEnable": {
|
||||
Input: "samlConfigTestInput",
|
||||
},
|
||||
}
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{http.MethodGet, http.MethodPut}
|
||||
}).
|
||||
MustImport(&Version, v3.SamlConfigTestInput{})
|
||||
}
|
||||
|
||||
func userTypes(schema *types.Schemas) *types.Schemas {
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -58,6 +58,14 @@ type AzureADProvider struct {
|
||||
RedirectURL string `json:"redirectUrl"`
|
||||
}
|
||||
|
||||
type SamlProvider 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"`
|
||||
@@ -74,3 +82,11 @@ type FreeIpaProvider struct {
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
AuthProvider `json:",inline"`
|
||||
}
|
||||
|
||||
type PingProvider struct {
|
||||
SamlProvider `json:",inline"`
|
||||
}
|
||||
|
||||
type SamlLogin struct {
|
||||
FinalRedirectURL string `json:"finalRedirectUrl"`
|
||||
}
|
||||
|
@@ -81,6 +81,19 @@ func authProvidersTypes(schemas *types.Schemas) *types.Schemas {
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
}).
|
||||
MustImport(&PublicVersion, v3public.AzureADLogin{}).
|
||||
// Saml provider
|
||||
MustImportAndCustomize(&PublicVersion, v3public.PingProvider{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "authProvider"
|
||||
schema.ResourceActions = map[string]types.Action{
|
||||
"login": {
|
||||
Input: "samlLogin",
|
||||
Output: "token",
|
||||
},
|
||||
}
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
}).
|
||||
MustImport(&PublicVersion, v3public.SamlLogin{}).
|
||||
// OpenLdap provider
|
||||
MustImportAndCustomize(&PublicVersion, v3public.OpenLdapProvider{}, func(schema *types.Schema) {
|
||||
schema.BaseType = "authProvider"
|
||||
@@ -105,5 +118,4 @@ func authProvidersTypes(schemas *types.Schemas) *types.Schemas {
|
||||
schema.CollectionMethods = []string{}
|
||||
schema.ResourceMethods = []string{http.MethodGet}
|
||||
})
|
||||
|
||||
}
|
||||
|
56
client/management/v3/zz_generated_ping_config.go
Normal file
56
client/management/v3/zz_generated_ping_config.go
Normal file
@@ -0,0 +1,56 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
PingConfigType = "pingConfig"
|
||||
PingConfigFieldAccessMode = "accessMode"
|
||||
PingConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds"
|
||||
PingConfigFieldAnnotations = "annotations"
|
||||
PingConfigFieldCreated = "created"
|
||||
PingConfigFieldCreatorID = "creatorId"
|
||||
PingConfigFieldDisplayNameField = "displayNameField"
|
||||
PingConfigFieldEnabled = "enabled"
|
||||
PingConfigFieldGroupsField = "groupsField"
|
||||
PingConfigFieldIDPMetadataContent = "idpMetadataContent"
|
||||
PingConfigFieldIDPMetadataFilePath = "idpMetadataFilePath"
|
||||
PingConfigFieldIDPMetadataURL = "idpMetadataUrl"
|
||||
PingConfigFieldLabels = "labels"
|
||||
PingConfigFieldName = "name"
|
||||
PingConfigFieldOwnerReferences = "ownerReferences"
|
||||
PingConfigFieldRancherAPIHost = "rancherApiHost"
|
||||
PingConfigFieldRemoved = "removed"
|
||||
PingConfigFieldSPSelfSignedCert = "spCert"
|
||||
PingConfigFieldSPSelfSignedCertFilePath = "spSelfSignedCertFilePath"
|
||||
PingConfigFieldSPSelfSignedKey = "spKey"
|
||||
PingConfigFieldSPSelfSignedKeyFilePath = "spSelfSignedKeyFilePath"
|
||||
PingConfigFieldType = "type"
|
||||
PingConfigFieldUIDField = "uidField"
|
||||
PingConfigFieldUserNameField = "userNameField"
|
||||
PingConfigFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
type PingConfig struct {
|
||||
AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"`
|
||||
AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
DisplayNameField string `json:"displayNameField,omitempty" yaml:"displayNameField,omitempty"`
|
||||
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
|
||||
GroupsField string `json:"groupsField,omitempty" yaml:"groupsField,omitempty"`
|
||||
IDPMetadataContent string `json:"idpMetadataContent,omitempty" yaml:"idpMetadataContent,omitempty"`
|
||||
IDPMetadataFilePath string `json:"idpMetadataFilePath,omitempty" yaml:"idpMetadataFilePath,omitempty"`
|
||||
IDPMetadataURL string `json:"idpMetadataUrl,omitempty" yaml:"idpMetadataUrl,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
RancherAPIHost string `json:"rancherApiHost,omitempty" yaml:"rancherApiHost,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
SPSelfSignedCert string `json:"spCert,omitempty" yaml:"spCert,omitempty"`
|
||||
SPSelfSignedCertFilePath string `json:"spSelfSignedCertFilePath,omitempty" yaml:"spSelfSignedCertFilePath,omitempty"`
|
||||
SPSelfSignedKey string `json:"spKey,omitempty" yaml:"spKey,omitempty"`
|
||||
SPSelfSignedKeyFilePath string `json:"spSelfSignedKeyFilePath,omitempty" yaml:"spSelfSignedKeyFilePath,omitempty"`
|
||||
Type string `json:"type,omitempty" yaml:"type,omitempty"`
|
||||
UIDField string `json:"uidField,omitempty" yaml:"uidField,omitempty"`
|
||||
UserNameField string `json:"userNameField,omitempty" yaml:"userNameField,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
@@ -11,4 +11,5 @@ type Manager interface {
|
||||
EnsureToken(tokenName, description, userName string) (string, error)
|
||||
EnsureUser(principalName, displayName string) (*v3.User, error)
|
||||
CheckAccess(accessMode string, allowedPrincipalIDs []string, user v3.Principal, groups []v3.Principal) (bool, error)
|
||||
SetPrincipalOnCurrentUserByUserID(userID string, principal v3.Principal) (*v3.User, error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user