1
0
mirror of https://github.com/rancher/types.git synced 2025-08-30 01:22:42 +00:00

Changes for github auth provider

This commit is contained in:
Craig Jellick 2018-02-06 10:56:16 -07:00
parent 74969149dc
commit 40ee217a08
3 changed files with 15 additions and 14 deletions

View File

@ -59,6 +59,7 @@ type Principal struct {
Kind string `json:"kind,omitempty"`
Me bool `json:"me,omitempty"`
MemberOf bool `json:"memberOf,omitempty"`
Provider string `json:"provider,omitempty"`
ExtraInfo map[string]string `json:"extraInfo,omitempty"`
}
@ -76,32 +77,31 @@ type AuthConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Type string `json:"type"`
Type string `json:"type"`
Enabled bool `json:"enabled,omitempty"`
}
//GithubConfig structure contains the github config definition
type GithubConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthConfig `json:",inline"`
AuthConfig `json:",inline" mapstructure:",squash"`
Hostname string `json:"hostname,omitempty"`
Scheme string `json:"scheme,omitempty"`
Hostname string `json:"hostname,omitempty" norman:"default=github.com"`
TLS bool `json:"tls,omitempty" norman:"notnullable,default=true"`
ClientID string `json:"clientId,omitempty"`
ClientSecret string `json:"clientSecret,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
//LocalConfig structure contains the local config definition
type LocalConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthConfig `json:",inline" mapstructure:",squash"`
}
//GithubConfigTestInput structure defines all properties that can be sent by client to configure github
type GithubConfigTestInput struct {
GithubConfig GithubConfig `json:"githubConfig, omitempty"`
Enabled bool `json:"enabled,omitempty"`
type GithubConfigTestOutput struct {
RedirectURL string `json:"redirectUrl"`
}
//GithubConfigApplyInput structure defines all properties that can be sent by client to configure github

View File

@ -185,18 +185,17 @@ func authnTypes(schemas *types.Schemas) *types.Schemas {
schema.BaseType = "authConfig"
schema.ResourceActions = map[string]types.Action{
"configureTest": {
Input: "githubConfigTestInput",
Output: "githubConfig",
Input: "githubConfig",
Output: "githubConfigTestOutput",
},
"testAndApply": {
Input: "githubConfigApplyInput",
Output: "githubConfig",
Input: "githubConfigApplyInput",
},
}
schema.CollectionMethods = []string{}
schema.ResourceMethods = []string{http.MethodGet}
}).
MustImport(&Version, v3.GithubConfigTestInput{}).
MustImport(&Version, v3.GithubConfigTestOutput{}).
MustImport(&Version, v3.GithubConfigApplyInput{}).
MustImportAndCustomize(&Version, v3.LocalConfig{}, func(schema *types.Schema) {
schema.BaseType = "authConfig"

View File

@ -15,6 +15,8 @@ type GithubProvider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthProvider `json:",inline"`
RedirectURL string `json:"redirectUrl"`
}
type LocalProvider struct {