1
0
mirror of https://github.com/rancher/types.git synced 2025-09-01 05:09:10 +00:00

UserAttribute backend

This commit is contained in:
Craig Jellick
2018-06-19 09:46:45 -07:00
committed by Alena Prokharchyk
parent aa4b48988f
commit cd18165f8d
4 changed files with 25 additions and 6 deletions

View File

@@ -35,6 +35,19 @@ type User struct {
Me bool `json:"me,omitempty"`
}
// UserAttribute will have a CRD (and controller) generated for it, but will not be exposed in the API.
type UserAttribute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
UserName string
GroupPrincipals map[string]Principals // the value is a []Principal, but code generator cannot handle slice as a value
}
type Principals struct {
Items []Principal
}
type Group struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

View File

@@ -416,6 +416,10 @@ func userTypes(schema *types.Schemas) *types.Schemas {
f.Required = false
return f
})
}).
MustImportAndCustomize(&Version, v3.UserAttribute{}, func(schema *types.Schema) {
schema.CollectionMethods = []string{}
schema.ResourceMethods = []string{}
})
}