v1

package
v0.0.0-...-1d80bfb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the user v1 API group +kubebuilder:object:generate=true +groupName=user.kubeworkz.io

Index

Constants

View Source
const (
	NormalState    UserState = "normal"
	ForbiddenState UserState = "forbidden"

	NormalLogin LoginType = "normal"
	OpenIdLogin LoginType = "openId"
	LDAPLogin   LoginType = "ldap"
	GitHubLogin LoginType = "github"

	English Language = "en"
	Chinese Language = "zh"
)

Variables

View Source
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 BelongsToProject(user *User, project string) bool

func BelongsToTenant

func BelongsToTenant(user *User, tenant string) bool

func IsPlatformAdmin

func IsPlatformAdmin(user *User) bool

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

func (in *Key) DeepCopy() *Key

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

func (*Key) DeepCopyInto

func (in *Key) DeepCopyInto(out *Key)

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

func (*Key) DeepCopyObject

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

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

func (in *KeyList) DeepCopy() *KeyList

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

func (*KeyList) DeepCopyInto

func (in *KeyList) DeepCopyInto(out *KeyList)

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

func (*KeyList) DeepCopyObject

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

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

func (in *KeySpec) DeepCopy() *KeySpec

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

func (*KeySpec) DeepCopyInto

func (in *KeySpec) DeepCopyInto(out *KeySpec)

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

func (in *KeyStatus) DeepCopy() *KeyStatus

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

func (*KeyStatus) DeepCopyInto

func (in *KeyStatus) DeepCopyInto(out *KeyStatus)

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

type Language

type Language string

type LoginType

type LoginType string

type ProjectInfo

type ProjectInfo struct {
	Project string `json:"project,omitempty"`
	Tenant  string `json:"tenant,omitempty"`
}

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

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.

func (*User) IsUserPlatformScope

func (u *User) IsUserPlatformScope() bool

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

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 {
	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

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

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.

Jump to

Keyboard shortcuts

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