session

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(parent iris.Party)

Types

type ClusterUserProfile

type ClusterUserProfile struct {
	UserProfile
	ClusterRoles []v1.ClusterRole `json:"clusterRoles"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler() *Handler

func (*Handler) GetClusterProfile

func (h *Handler) GetClusterProfile() iris.Handler

func (*Handler) GetProfile

func (h *Handler) GetProfile() iris.Handler

func (*Handler) IsLogin

func (h *Handler) IsLogin() iris.Handler

func (*Handler) ListUserNamespace

func (h *Handler) ListUserNamespace() iris.Handler

func (*Handler) Login

func (h *Handler) Login() iris.Handler

Auth @Tags sessions @Summary User Login @Description User Login @Accept json @Produce json @Param request body LoginCredential true "request" @Router /sessions [post]

func (*Handler) Logout

func (h *Handler) Logout() iris.Handler

func (*Handler) UpdatePassword

func (h *Handler) UpdatePassword() iris.Handler

func (*Handler) UpdateProfile

func (h *Handler) UpdateProfile() iris.Handler

type LoginCredential

type LoginCredential struct {
	Username   string `json:"username"`
	Email      string `json:"email"`
	Password   string `json:"password"`
	AuthMethod string `json:"authMethod"`
}

type Mfa

type Mfa struct {
	Enable   bool   `json:"enable"`
	Secret   string `json:"secret"`
	Approved bool   `json:"approved"`
}

type MfaCredential

type MfaCredential struct {
	Username string `json:"username"`
	Secret   string `json:"secret"`
	Code     string `json:"code"`
}

type PasswordSetter

type PasswordSetter struct {
	NewPassword string `json:"newPassword"`
	OldPassword string `json:"oldPassword"`
}

type ProfileSetter

type ProfileSetter struct {
	NickName string `json:"nickName"`
	Email    string `json:"email"`
	Language string `json:"language"`
}

type UserInfo added in v1.7.9

type UserInfo struct {
	DomainAccount string `json:"loginName"`  // 域账号
	EmpID         string `json:"empId"`      // 工号,用户ID(empID)
	Name          string `json:"lastName"`   // 真名(不唯一)
	NickName      string `json:"nickNameCn"` // 花名,并非所有人都有
	UserType      string `json:"userType"`   //员工类型:R,正式; O,外包; W,部门公共账号
	HrStatus      string `json:"hrStatus"`   //在职状态:A,在职; I,离职
	Available     string `json:"available"`  // 账号状态:T,有效; F,无效
	Email         string `json:"emailAddr"`  // 常用邮箱
	CellPhone     string `json:"cellPhone"`  // 手机号
	Department    string `json:"depDesc"`    // 部门
	AvatarURL     string `json:"avatarURL"`  // 头像地址
	Token         string `json:"token"`      // 登录会话SSO_TOKEN,有效期7d,可以换取SSO_TICKET,可以用于心跳请求,心跳后原TOKEN在1分钟后失效
	DisplayName   string // 显示名称(唯一),优先显示花名,然后真实姓名
	PicURL        string // 头像
}

type UserProfile

type UserProfile struct {
	Name                string              `json:"name"`
	NickName            string              `json:"nickName"`
	Email               string              `json:"email"`
	Language            string              `json:"language"`
	ResourcePermissions map[string][]string `json:"resourcePermissions"`
	IsAdministrator     bool                `json:"isAdministrator"`
	Mfa                 Mfa                 `json:"mfa"`
}

func InnerAuth added in v1.7.9

func InnerAuth(ctx *context.Context) *UserProfile

Jump to

Keyboard shortcuts

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