v1alpha2

package
v0.0.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 10

Documentation

Overview

Package v1alpha2 contains API Schema definitions for the iam v1alpha2 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=kubesphere.io/api/iam +k8s:defaulter-gen=TypeMeta +groupName=iam.kubesphere.io

Package v1alpha2 contains API Schema definitions for the iam v1alpha2 API group +k8s:openapi-gen=true +kubebuilder:object:generate=true +groupName=iam.kubesphere.io

Index

Constants

View Source
const (
	ResourceKindUser                      = "User"
	ResourcesSingularUser                 = "user"
	ResourcesPluralUser                   = "users"
	ResourceKindGlobalRoleBinding         = "GlobalRoleBinding"
	ResourcesSingularGlobalRoleBinding    = "globalrolebinding"
	ResourcesPluralGlobalRoleBinding      = "globalrolebindings"
	ResourceKindClusterRoleBinding        = "ClusterRoleBinding"
	ResourcesSingularClusterRoleBinding   = "clusterrolebinding"
	ResourcesPluralClusterRoleBinding     = "clusterrolebindings"
	ResourceKindRoleBinding               = "RoleBinding"
	ResourcesSingularRoleBinding          = "rolebinding"
	ResourcesPluralRoleBinding            = "rolebindings"
	ResourceKindGlobalRole                = "GlobalRole"
	ResourcesSingularGlobalRole           = "globalrole"
	ResourcesPluralGlobalRole             = "globalroles"
	ResourceKindWorkspaceRoleBinding      = "WorkspaceRoleBinding"
	ResourcesSingularWorkspaceRoleBinding = "workspacerolebinding"
	ResourcesPluralWorkspaceRoleBinding   = "workspacerolebindings"
	ResourceKindWorkspaceRole             = "WorkspaceRole"
	ResourcesSingularWorkspaceRole        = "workspacerole"
	ResourcesPluralWorkspaceRole          = "workspaceroles"
	ResourceKindClusterRole               = "ClusterRole"
	ResourcesSingularClusterRole          = "clusterrole"
	ResourcesPluralClusterRole            = "clusterroles"
	ResourceKindRole                      = "Role"
	ResourcesSingularRole                 = "role"
	ResourcesPluralRole                   = "roles"
	RegoOverrideAnnotation                = "iam.kubesphere.io/rego-override"
	AggregationRolesAnnotation            = "iam.kubesphere.io/aggregation-roles"
	GlobalRoleAnnotation                  = "iam.kubesphere.io/globalrole"
	WorkspaceRoleAnnotation               = "iam.kubesphere.io/workspacerole"
	ClusterRoleAnnotation                 = "iam.kubesphere.io/clusterrole"
	GrantedClustersAnnotation             = "iam.kubesphere.io/granted-clusters"
	UninitializedAnnotation               = "iam.kubesphere.io/uninitialized"
	LastPasswordChangeTimeAnnotation      = "iam.kubesphere.io/last-password-change-time"
	RoleAnnotation                        = "iam.kubesphere.io/role"
	RoleTemplateLabel                     = "iam.kubesphere.io/role-template"
	ScopeLabelFormat                      = "scope.kubesphere.io/%s"
	UserReferenceLabel                    = "iam.kubesphere.io/user-ref"
	IdentifyProviderLabel                 = "iam.kubesphere.io/identify-provider"
	OriginUIDLabel                        = "iam.kubesphere.io/origin-uid"
	ServiceAccountReferenceLabel          = "iam.kubesphere.io/serviceaccount-ref"
	FieldEmail                            = "email"
	ExtraEmail                            = FieldEmail
	ExtraIdentityProvider                 = "idp"
	ExtraUID                              = "uid"
	ExtraUsername                         = "username"
	ExtraDisplayName                      = "displayName"
	ExtraUninitialized                    = "uninitialized"
	InGroup                               = "ingroup"
	NotInGroup                            = "notingroup"
	AggregateTo                           = "aggregateTo"
	ScopeWorkspace                        = "workspace"
	ScopeCluster                          = "cluster"
	ScopeNamespace                        = "namespace"
	ScopeDevOps                           = "devops"
	PlatformAdmin                         = "platform-admin"
	NamespaceAdmin                        = "admin"
	ClusterAdmin                          = "cluster-admin"
	PreRegistrationUser                   = "system:pre-registration"
	PreRegistrationUserGroup              = "pre-registration"
)
View Source
const (
	AnnotationGroup       = "bytetrade.io"
	UserAnnotationZoneKey = AnnotationGroup + "/zone"
)
View Source
const (
	SecretObjectRefKind = "Secret"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "iam.kubesphere.io", Version: "v1alpha2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme is required by pkg/client/...
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetUserAnnotation added in v0.0.19

func GetUserAnnotation(ctx context.Context, users UserInterface, username, annotation string) (string, error)

GetUserAnnotation returns user annotation, an error if there is any.

func GetUserZone added in v0.0.19

func GetUserZone(ctx context.Context, users UserInterface, username string) (string, error)

GetUserZone returns user zone, an error if there is any.

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

func UserAnnotation added in v0.0.19

func UserAnnotation(user *User, annotation string) (string, error)

UserAnnotation returns a single annotation from a User object.

Types

type Client added in v0.0.19

type Client struct {
	Users UserInterface
}

Client holds typed clients for the iam.kubesphere.io/v1alpha2 API group.

We hand-roll this instead of using k8s code-generator because the iam package lives at iam/v1alpha2/ rather than under api/<group>/<version>/. kube_codegen.sh discovers groups by walking <in_dir>/<group>/<version>/ and we deliberately keep this import path stable for downstream consumers.

func NewClient added in v0.0.19

func NewClient(cfg *rest.Config) (*Client, error)

NewClient creates a typed client for iam.kubesphere.io/v1alpha2.

func NewClientForConfigAndClient added in v0.0.19

func NewClientForConfigAndClient(cfg *rest.Config, httpClient *http.Client) (*Client, error)

NewClientForConfigAndClient is like NewClient but accepts a pre-built http client.

type FinalizerName

type FinalizerName string

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"`
}

GlobalRoleBinding is the Schema for the globalrolebindings API

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

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 LLdapProvider

type LLdapProvider struct {
	Name              string     `json:"name"`
	URL               string     `json:"url"`
	CredentialsSecret *ObjectRef `json:"credentialsSecret"`
	GroupWhitelist    []string   `json:"groupWhitelist,omitempty"`
	UserBlacklist     []string   `json:"userBlacklist,omitempty"`
}

func (*LLdapProvider) DeepCopy

func (in *LLdapProvider) DeepCopy() *LLdapProvider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LLdapProvider.

func (*LLdapProvider) DeepCopyInto

func (in *LLdapProvider) DeepCopyInto(out *LLdapProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObjectRef

type ObjectRef struct {
	Name      string        `json:"name"`
	Namespace string        `json:"namespace"`
	Kind      ObjectRefKind `json:"kind"`
}

func (*ObjectRef) DeepCopy

func (in *ObjectRef) DeepCopy() *ObjectRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectRef.

func (*ObjectRef) DeepCopyInto

func (in *ObjectRef) DeepCopyInto(out *ObjectRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObjectRefKind

type ObjectRefKind string

type RoleBase

type RoleBase struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:EmbeddedResource
	Role runtime.RawExtension `json:"role"`
}

func (*RoleBase) DeepCopy

func (in *RoleBase) DeepCopy() *RoleBase

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleBase.

func (*RoleBase) DeepCopyInto

func (in *RoleBase) DeepCopyInto(out *RoleBase)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RoleBase) DeepCopyObject

func (in *RoleBase) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RoleBaseList

type RoleBaseList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RoleBase `json:"items"`
}

RoleBaseList contains a list of RoleBase

func (*RoleBaseList) DeepCopy

func (in *RoleBaseList) DeepCopy() *RoleBaseList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleBaseList.

func (*RoleBaseList) DeepCopyInto

func (in *RoleBaseList) DeepCopyInto(out *RoleBaseList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RoleBaseList) DeepCopyObject

func (in *RoleBaseList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type Sync

type Sync struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec SyncSpec `json:"spec,omitempty"`
}

Sync is the Schema for the sync API

func (*Sync) DeepCopy

func (in *Sync) DeepCopy() *Sync

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sync.

func (*Sync) DeepCopyInto

func (in *Sync) DeepCopyInto(out *Sync)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Sync) DeepCopyObject

func (in *Sync) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SyncList

type SyncList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Sync `json:"items"`
}

SyncList contains a list of Sync

func (*SyncList) DeepCopy

func (in *SyncList) DeepCopy() *SyncList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncList.

func (*SyncList) DeepCopyInto

func (in *SyncList) DeepCopyInto(out *SyncList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SyncList) DeepCopyObject

func (in *SyncList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SyncSpec

type SyncSpec struct {
	LLdap *LLdapProvider `json:"lldap"`
}

SyncSpec defines the desired state of Sync

func (*SyncSpec) DeepCopy

func (in *SyncSpec) DeepCopy() *SyncSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncSpec.

func (*SyncSpec) DeepCopyInto

func (in *SyncSpec) DeepCopyInto(out *SyncSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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"`
}

User is the Schema for the users API +kubebuilder:printcolumn:name="Email",type="string",JSONPath=".spec.email" +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.state" +kubebuilder:resource:categories="iam",scope="Cluster" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*User) DeepCopy

func (in *User) DeepCopy() *User

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User.

func (*User) DeepCopyInto

func (in *User) DeepCopyInto(out *User)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*User) DeepCopyObject

func (in *User) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type UserInterface added in v0.0.19

type UserInterface interface {
	Get(ctx context.Context, name string, opts metav1.GetOptions) (*User, error)
}

UserInterface has methods to work with User resources. It mirrors the shape of client-gen output so this hand-rolled client can be swapped for a generated one in the future without breaking callers.

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

func (in *UserList) DeepCopy() *UserList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList.

func (*UserList) DeepCopyInto

func (in *UserList) DeepCopyInto(out *UserList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UserList) DeepCopyObject

func (in *UserList) DeepCopyObject() runtime.Object

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"`
	// InitialPassword only for the first user that need sync from here to lldap
	// +optional
	InitialPassword string `json:"initialPassword,omitempty"`
	// The preferred written or spoken language for the user.
	// +optional
	Lang string `json:"lang,omitempty"`
	// Description of the user.
	// +optional
	Description string `json:"description,omitempty"`
	// +optional
	DisplayName string `json:"displayName,omitempty"`
	// +optional
	Groups []string `json:"groups,omitempty"`
}

UserSpec defines the desired state of User

func (*UserSpec) DeepCopy

func (in *UserSpec) DeepCopy() *UserSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec.

func (*UserSpec) DeepCopyInto

func (in *UserSpec) DeepCopyInto(out *UserSpec)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL