mirror of
https://github.com/rancher/types.git
synced 2025-09-01 05:09:10 +00:00
UserAttribute backend
This commit is contained in:
committed by
Alena Prokharchyk
parent
aa4b48988f
commit
cd18165f8d
@@ -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"`
|
||||
|
@@ -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{}
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user