Documentation ¶
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type GlobalRole
- type GlobalRoleBinding
- type GlobalRoleBindingList
- type GlobalRoleList
- type LoginRecord
- type LoginRecordList
- type LoginRecordSpec
- type LoginType
- type Token
- type TokenList
- type TokenSpec
- type TokenStatus
- type TokenType
- type User
- type UserList
- type UserSpec
- type UserState
- type UserStatus
Constants ¶
const ( KindUser = "User" KindToken = "Token" KindLoginRecord = "LoginRecord" KindGlobalRole = "GlobalRole" KindGlobalRoleBinding = "GlobalRoleBinding" )
const GroupName = "iam.kubeclipper.io"
GroupName is the group name used in this package
Variables ¶
var ( // SchemeBuilder is the scheme builder with scheme init functions to run for this API package SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a common registration function for mapping packaged scoped group & version keys to a scheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns back a Group qualified GroupResource
Types ¶
type GlobalRole ¶
type GlobalRole struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty"` // Rules holds all the PolicyRules for this GlobalRole // +optional Rules []rbacv1.PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` }
func (*GlobalRole) DeepCopy ¶
func (in *GlobalRole) DeepCopy() *GlobalRole
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRole.
func (*GlobalRole) DeepCopyInto ¶
func (in *GlobalRole) DeepCopyInto(out *GlobalRole)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GlobalRole) DeepCopyObject ¶
func (in *GlobalRole) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GlobalRoleBinding ¶
type GlobalRoleBinding struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty"` // Subjects holds references to the objects the role applies to. // +optional Subjects []rbacv1.Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` // RoleRef can only reference a GlobalRole. // If the RoleRef cannot be resolved, the Authorizer must return an error. RoleRef rbacv1.RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` }
func (*GlobalRoleBinding) DeepCopy ¶
func (in *GlobalRoleBinding) DeepCopy() *GlobalRoleBinding
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBinding.
func (*GlobalRoleBinding) DeepCopyInto ¶
func (in *GlobalRoleBinding) DeepCopyInto(out *GlobalRoleBinding)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GlobalRoleBinding) DeepCopyObject ¶
func (in *GlobalRoleBinding) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GlobalRoleBindingList ¶
type GlobalRoleBindingList struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty"` Items []GlobalRoleBinding `json:"items"` }
GlobalRoleBindingList contains a list of GlobalRoleBinding
func (*GlobalRoleBindingList) DeepCopy ¶
func (in *GlobalRoleBindingList) DeepCopy() *GlobalRoleBindingList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleBindingList.
func (*GlobalRoleBindingList) DeepCopyInto ¶
func (in *GlobalRoleBindingList) DeepCopyInto(out *GlobalRoleBindingList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GlobalRoleBindingList) DeepCopyObject ¶
func (in *GlobalRoleBindingList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GlobalRoleList ¶
type GlobalRoleList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []GlobalRole `json:"items"` }
GlobalRoleList contains a list of GlobalRole
func (*GlobalRoleList) DeepCopy ¶
func (in *GlobalRoleList) DeepCopy() *GlobalRoleList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRoleList.
func (*GlobalRoleList) DeepCopyInto ¶
func (in *GlobalRoleList) DeepCopyInto(out *GlobalRoleList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GlobalRoleList) DeepCopyObject ¶
func (in *GlobalRoleList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type LoginRecord ¶
type LoginRecord struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec LoginRecordSpec `json:"spec"` }
func (*LoginRecord) DeepCopy ¶
func (in *LoginRecord) DeepCopy() *LoginRecord
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginRecord.
func (*LoginRecord) DeepCopyInto ¶
func (in *LoginRecord) DeepCopyInto(out *LoginRecord)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LoginRecord) DeepCopyObject ¶
func (in *LoginRecord) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type LoginRecordList ¶
type LoginRecordList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []LoginRecord `json:"items"` }
LoginRecordList contains a list of LoginRecord
func (*LoginRecordList) DeepCopy ¶
func (in *LoginRecordList) DeepCopy() *LoginRecordList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginRecordList.
func (*LoginRecordList) DeepCopyInto ¶
func (in *LoginRecordList) DeepCopyInto(out *LoginRecordList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LoginRecordList) DeepCopyObject ¶
func (in *LoginRecordList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type LoginRecordSpec ¶
type LoginRecordSpec struct { // Which authentication method used, BasicAuth/OAuth Type LoginType `json:"type"` // Provider of authentication, Ldap/Github etc. Provider string `json:"provider"` // Source IP of client SourceIP string `json:"sourceIP"` // User agent of login attempt UserAgent string `json:"userAgent,omitempty"` // Successful login attempt or not Success bool `json:"success"` // States failed login attempt reason Reason string `json:"reason"` }
func (*LoginRecordSpec) DeepCopy ¶
func (in *LoginRecordSpec) DeepCopy() *LoginRecordSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginRecordSpec.
func (*LoginRecordSpec) DeepCopyInto ¶
func (in *LoginRecordSpec) DeepCopyInto(out *LoginRecordSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Token ¶
type Token struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty"` Spec TokenSpec `json:"spec"` // +optional Status TokenStatus `json:"status,omitempty"` }
func (*Token) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Token.
func (*Token) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Token) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TokenList ¶
type TokenList struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty"` Items []Token `json:"items"` }
TokenList contains a list of Token
func (*TokenList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenList.
func (*TokenList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TokenList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TokenSpec ¶
type TokenSpec struct { // Expire time (second) for the token. 0 means no ttl // +kubebuilder:validation:Minimum=0 TTL *int64 `json:"ttl"` // The token type. // Valid values are: // - "refresh_token" : refresh token type, used to refresh access token; // - "access_token": access token for front end or http client; // - "static_token": static token // = "TemporaryToken" temporary token for cache // +kubebuilder:validation:Enum=access_token;refresh_token;static_token TokenType TokenType `json:"tokenType"` // the user who this token belongs to Username string `json:"username"` // +kubebuilder:validation:Optional Description string `json:"description,omitempty"` // +kubebuilder:validation:default:true Enabled *bool `json:"enabled,omitempty"` // hash token // +kubebuilder:validation:MinLength=36 Token string `json:"token"` // the cluster which this token belongs to // +kubebuilder:validation:Optional ClusterName string `json:"clusterName,omitempty"` // which org issue this token // +kubebuilder:validation:Optional Issuer string `json:"issuer,omitempty"` }
TokenSpec defines the desired state of Token
func (*TokenSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenSpec.
func (*TokenSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TokenStatus ¶
type TokenStatus struct { // +optional ExpiresAt *metav1.Time `json:"expiresAt,omitempty"` // +optional Reason string `json:"reason,omitempty"` }
TokenStatus defines the status of token
func (*TokenStatus) DeepCopy ¶
func (in *TokenStatus) DeepCopy() *TokenStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenStatus.
func (*TokenStatus) DeepCopyInto ¶
func (in *TokenStatus) DeepCopyInto(out *TokenStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TokenType ¶
type TokenType string
const ( // RefreshToken and AccessToken used for front end and http client RefreshToken TokenType = "refresh_token" AccessToken TokenType = "access_token" // CLusterToken used for kubeconfig StaticToken TokenType = "static_token" TemporaryToken TokenType = "temporary_token" )
These are the valid phases of a user.
type User ¶
type User struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty"` Spec UserSpec `json:"spec"` // +optional Status UserStatus `json:"status,omitempty"` }
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.
type UserList ¶
type UserList struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. // +optional 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 { // Unique email address(https://www.ietf.org/rfc/rfc5322.txt). Email string `json:"email"` // The preferred written or spoken language for the user. // +optional Lang string `json:"lang,omitempty"` // User phone // +optional Phone string `json:"phone,omitempty"` // Description of the user. // +optional Description string `json:"description,omitempty"` // +optional DisplayName string `json:"displayName,omitempty"` // +optional Groups []string `json:"groups,omitempty"` // password will be encrypted by mutating admission webhook EncryptedPassword string `json:"password,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 UserState ¶
type UserState string
const ( // UserActive means the user is available. UserActive UserState = "Active" // UserDisabled means the user is disabled. UserDisabled UserState = "Disabled" // UserAuthLimitExceeded means restrict user login. UserAuthLimitExceeded UserState = "AuthLimitExceeded" AuthenticatedSuccessfully = "authenticated successfully" )
These are the valid phases of a user.
type UserStatus ¶
type UserStatus struct { // The user status // +optional State *UserState `json:"state,omitempty"` // +optional Reason string `json:"reason,omitempty"` // +optional LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` // Last login attempt timestamp // +optional LastLoginTime *metav1.Time `json:"lastLoginTime,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.