user

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchCreateUser

func BatchCreateUser(c *gin.Context)

BatchCreateUser import users @Summary import user @Description import and create users from CSV file in batches @Tags user @Accept multipart/form-data @Param userInfoFile formData file true "file" @Produce json @Success 200 {object} response.SuccessInfo @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user/users [post]

func CheckAndCompleteCreateParam

func CheckAndCompleteCreateParam(c *gin.Context) (*userv1.User, *errcode.ErrorInfo)

func CheckUpdateParam

func CheckUpdateParam(newUser *userv1.User, originUser *userv1.User) (*userv1.User, *errcode.ErrorInfo)

func CheckUserValid

func CheckUserValid(c *gin.Context)

CheckUserValid check username @Summary check username @Description check username when update user password @Tags user @Param username path string true "user name" @Success 200 {object} NameValid @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user/:username [get]

func CreateUser

func CreateUser(c *gin.Context)

CreateUser create a user @Summary create user @Description create user manually @Tags user @Accept json @Produce json @Param user body userv1.User true "user information" @Success 200 {object} response.SuccessInfo @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user [post]

func CreateUserImpl

func CreateUserImpl(c *gin.Context, user *userv1.User) *errcode.ErrorInfo

func DownloadTemplate

func DownloadTemplate(c *gin.Context)

DownloadTemplate get import template @Summary get import template @Description get user information import template @Tags user @Success 200 {string} string @Router /api/v1/cube/user/template [get]

func GetKubeConfig

func GetKubeConfig(c *gin.Context)

GetKubeConfig fetch kubeConfig for specified user @Summary fetch kubeConfigs @Description fetch kubeConfig for specified user @Tags user @Param user query string true "specified user for kubeconfig" @Produce plain @Success 200 string string @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user/kubeconfigs [get]

func GetMembersByNS

func GetMembersByNS(c *gin.Context)

GetMembersByNS show members who in specified namespace

func GetUserByName

func GetUserByName(c *gin.Context, name string) (*userv1.User, *errcode.ErrorInfo)

func GitHubLogin added in v1.0.3

func GitHubLogin(c *gin.Context)

func ListUsers

func ListUsers(c *gin.Context)

ListUsers list users @Summary list user @Description fuzzy query user by name or displayName @Tags user @Param query query string false "keyword for query" @Param pageSize query int false "page size" @Param pageNum query int false "page num" @Success 200 {object} UserList @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user [get]

func Login

func Login(c *gin.Context)

Login kubecube login @Summary login @Description user login by password or ldap @Tags user @Accept json @Produce json @Param loginInfo body LoginInfo true "user login information" @Success 200 {object} response.SuccessInfo @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/login [post]

func UpdatePwd

func UpdatePwd(c *gin.Context)

UpdatePwd update user password @Summary update password @Description update user password @Tags user @Param resetPwd body ResetPwd true "user old and new password" @Success 200 {object} response.SuccessInfo @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user/pwd [put]

func UpdateUser

func UpdateUser(c *gin.Context)

UpdateUser update a user info @Summary update user @Description update user information @Tags user @Accept json @Produce json @Param user body userv1.User true "user information" @Param username path string true "user name" @Success 200 {object} response.SuccessInfo @Failure 500 {object} errcode.ErrorInfo @Router /api/v1/cube/user/:username [put]

func UpdateUserSpecImpl

func UpdateUserSpecImpl(c *gin.Context, newUser *userv1.User) *errcode.ErrorInfo

func UpdateUserStatusImpl

func UpdateUserStatusImpl(c *gin.Context, newUser *userv1.User) *errcode.ErrorInfo

Types

type LoginInfo

type LoginInfo struct {
	Name      string       `json:"name"`
	Password  string       `json:"password"`
	LoginType v1.LoginType `json:"loginType"`
}

type NameValid

type NameValid struct {
	IsValid bool `json:"isValid"`
}

type ResetPwd

type ResetPwd struct {
	OriginPassword string `json:"originPassword,omitempty"`
	NewPassword    string `json:"newPassword,omitempty"`
	UserName       string `json:"userName,omitempty"`
}

type UserItem

type UserItem struct {
	Name   string            `json:"name,omitempty"`
	Spec   userv1.UserSpec   `json:"spec,omitempty"`
	Status userv1.UserStatus `json:"status,omitempty"`
}

type UserList

type UserList struct {
	Total int        `json:"total"`
	Items []UserItem `json:"items"`
}

Jump to

Keyboard shortcuts

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