Documentation ¶
Overview ¶
Package v1 contains API Schema definitions for the user v1 API group +kubebuilder:object:generate=true +groupName=user.kubeworkz.io
Index ¶
- Constants
- Variables
- func BelongsToProject(user *User, project string) bool
- func BelongsToTenant(user *User, tenant string) bool
- func IsPlatformAdmin(user *User) bool
- type BindingScopeType
- type Key
- type KeyList
- type KeySpec
- type KeyStatus
- type Language
- type LoginType
- type ProjectInfo
- type ScopeBinding
- type User
- type UserList
- type UserSpec
- type UserState
- type UserStatus
Constants ¶
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "user.kubeworkz.io", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func BelongsToProject ¶
func BelongsToTenant ¶
func IsPlatformAdmin ¶
Types ¶
type BindingScopeType ¶
type BindingScopeType string
const ( TenantScope BindingScopeType = "tenant" ProjectScope BindingScopeType = "project" PlatformScope BindingScopeType = "platform" )
type Key ¶
type Key struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec KeySpec `json:"spec,omitempty"` Status KeyStatus `json:"status,omitempty"` }
Key is the Schema for the keys API +kubebuilder:resource:categories="kubeworkz",scope="Cluster" +kubebuilder:printcolumn:name="User",type="string",JSONPath=".spec.user"
func (*Key) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Key.
func (*Key) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Key) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KeyList ¶
type KeyList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Key `json:"items"` }
KeyList contains a list of Key
func (*KeyList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyList.
func (*KeyList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*KeyList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KeySpec ¶
type KeySpec struct { SecretKey string `json:"secretKey,omitempty"` User string `json:"user,omitempty"` }
KeySpec defines the desired state of Key
func (*KeySpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeySpec.
func (*KeySpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KeyStatus ¶
type KeyStatus struct { }
KeyStatus defines the observed state of Key
func (*KeyStatus) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyStatus.
func (*KeyStatus) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProjectInfo ¶
type ScopeBinding ¶
type ScopeBinding struct { // ScopeType the binding scope type that support tenant,project and platform. ScopeType BindingScopeType `json:"scopeType"` // ScopeName the specific scope name. ScopeName string `json:"scopeName"` // Role the rbac role name. Role string `json:"role"` }
type User ¶
type User struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec UserSpec `json:"spec,omitempty"` Status UserStatus `json:"status,omitempty"` }
User is the Schema for the users API
func (*User) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User.
func (*User) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*User) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*User) IsUserPlatformScope ¶
type UserList ¶
type UserList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []User `json:"items"` }
UserList contains a list of User
func (*UserList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList.
func (*UserList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*UserList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type UserSpec ¶
type UserSpec struct { Password string `json:"password,omitempty"` DisplayName string `json:"displayName,omitempty"` Email string `json:"email,omitempty"` Phone string `json:"phone,omitempty"` // The preferred written or spoken language for the user: chinese/english Language Language `json:"language,omitempty"` // Login method used, normal/openId/ldap LoginType LoginType `json:"loginType,omitempty"` State UserState `json:"state,omitempty"` Wechat string `json:"wechat,omitempty"` // ScopeBindings indicates user relationships with tenant,project or platform // +optional ScopeBindings []ScopeBinding `json:"scopeBindings,omitempty"` }
UserSpec defines the desired state of User
func (*UserSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec.
func (*UserSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UserStatus ¶
type UserStatus struct { // The user status, normal/forbidden LastLoginTime *metav1.Time `json:"lastLoginTime,omitempty"` LastLoginIP string `json:"lastLoginIP,omitempty"` // BelongTenants indicates the user belongs to those tenants. // +optional BelongTenants []string `json:"belongTenants,omitempty"` // BelongProjects indicates the user belongs to those projects. // +optional // Deprecated: use BelongProjectInfos instead BelongProjects []string `json:"belongProjects,omitempty"` // BelongProjectInfos indicates the user belongs to those projects. // +optional BelongProjectInfos []ProjectInfo `json:"belongProjectInfos,omitempty"` // PlatformAdmin indicates the user is platform admin or not. // +optional PlatformAdmin bool `json:"platformAdmin,omitempty"` }
UserStatus defines the observed state of User
func (*UserStatus) DeepCopy ¶
func (in *UserStatus) DeepCopy() *UserStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserStatus.
func (*UserStatus) DeepCopyInto ¶
func (in *UserStatus) DeepCopyInto(out *UserStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.