user

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizedResources

type AuthorizedResources struct {
	IsSystemAdmin   bool                       `json:"is_system_admin"`
	ProjectAuthInfo map[string]*ProjectActions `json:"project_auth_info"`
	SystemActions   *SystemActions             `json:"system_actions"`
}

type BuildActions

type BuildActions struct {
	View   bool
	Create bool
	Edit   bool
	Delete bool
}

type BusinessDirectoryActions

type BusinessDirectoryActions struct {
	View bool
}

type Client

type Client struct {
	*httpclient.Client
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) CheckPermissionGivenByCollaborationMode

func (c *Client) CheckPermissionGivenByCollaborationMode(uid, projectKey, resource, action string) (bool, error)

func (*Client) CheckUserAuthInfoForCollaborationMode

func (c *Client) CheckUserAuthInfoForCollaborationMode(uid, projectKey, resource, resourceName, action string) (bool, error)

func (*Client) CountUsers

func (c *Client) CountUsers() (*types.UserStatistics, error)

func (*Client) CreateUser

func (c *Client) CreateUser(args *CreateUserArgs) (*CreateUserResp, error)

func (*Client) CreateUserRoleBinding

func (c *Client) CreateUserRoleBinding(uid, namespace, roleName string) error

func (*Client) DeleteAllProjectRoles

func (c *Client) DeleteAllProjectRoles(namespace string) error

func (*Client) DeleteUser

func (c *Client) DeleteUser(userId string, header http.Header, qs url.Values) ([]byte, error)

func (*Client) GetGroupDetailedInfo

func (c *Client) GetGroupDetailedInfo(groupID string) (*types.DetailedUserGroupResp, error)

func (*Client) GetUserAuthInfo

func (c *Client) GetUserAuthInfo(uid string) (*AuthorizedResources, error)

func (*Client) GetUserByID

func (c *Client) GetUserByID(uid string) (*types.UserInfo, error)

func (*Client) GetUserGroupsByUid added in v2.3.1

func (c *Client) GetUserGroupsByUid(uid string) (*types.ListUserGroupResp, error)

func (*Client) Healthz

func (c *Client) Healthz() error

func (*Client) InitializeProject

func (c *Client) InitializeProject(projectKey string, isPublic bool, admins []string) error

func (*Client) ListAuthorizedProjects

func (c *Client) ListAuthorizedProjects(uid string) ([]string, bool, error)

func (*Client) ListAuthorizedProjectsByResourceAndVerb

func (c *Client) ListAuthorizedProjectsByResourceAndVerb(uid, resource, verb string) ([]string, bool, error)

func (*Client) ListAuthorizedWorkflows

func (c *Client) ListAuthorizedWorkflows(uid, projectKey string) ([]string, []string, error)

func (*Client) ListCollaborationEnvironmentsPermission

func (c *Client) ListCollaborationEnvironmentsPermission(uid, projectKey string) (*types.CollaborationEnvPermission, error)

func (*Client) ListRoles

func (c *Client) ListRoles(namespace, uid string) ([]*types.Role, error)

func (*Client) ListUsers

func (c *Client) ListUsers(args *SearchArgs) ([]*User, error)

func (*Client) SearchUser

func (c *Client) SearchUser(args *SearchUserArgs) (*SearchUserResp, error)

func (*Client) SearchUsers

func (c *Client) SearchUsers(header http.Header, qs url.Values, body interface{}) (*types.UsersResp, error)

moved from policy client, TODO: merge it with searchUser function

func (*Client) SearchUsersByIDList

func (c *Client) SearchUsersByIDList(idList []string) (*types.UsersResp, error)

func (*Client) SetProjectVisibility

func (c *Client) SetProjectVisibility(namespace string, isVisible bool) error

type ClusterManagementActions

type ClusterManagementActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type CreateUserArgs

type CreateUserArgs struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
	Account  string `json:"account"`
}

type CreateUserResp

type CreateUserResp struct {
	Name    string `json:"name"`
	Account string `json:"account"`
	Uid     string `json:"uid"`
}

type DBInstanceManagementActions

type DBInstanceManagementActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type DataCenterActions

type DataCenterActions struct {
	ViewOverView      bool
	ViewInsight       bool
	EditInsightConfig bool
}

type DeliveryCenterActions

type DeliveryCenterActions struct {
	ViewArtifact bool
	ViewVersion  bool
}

type EnvActions

type EnvActions struct {
	View   bool
	Create bool
	// 配置
	EditConfig bool
	// 管理服务实例
	ManagePods bool
	Delete     bool
	DebugPod   bool
	// 主机登录
	SSH bool
}

type HelmRepoManagementActions

type HelmRepoManagementActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type InitializeProjectResp

type InitializeProjectResp struct {
	Roles []string `json:"roles"`
}

type ProductionEnvActions

type ProductionEnvActions struct {
	View   bool
	Create bool
	// 配置
	EditConfig bool
	// 管理服务实例
	ManagePods bool
	Delete     bool
	DebugPod   bool
}

type ProductionServiceActions

type ProductionServiceActions struct {
	View   bool
	Create bool
	Edit   bool
	Delete bool
}

type ProjectActions

type ProjectActions struct {
	IsProjectAdmin    bool                      `json:"is_system_admin"`
	Workflow          *WorkflowActions          `json:"workflow"`
	Env               *EnvActions               `json:"env"`
	ProductionEnv     *ProductionEnvActions     `json:"production_env"`
	Service           *ServiceActions           `json:"service"`
	ProductionService *ProductionServiceActions `json:"production_service"`
	Build             *BuildActions             `json:"build"`
	Test              *TestActions              `json:"test"`
	Scanning          *ScanningActions          `json:"scanning"`
	Version           *VersionActions           `json:"version"`
}

type RegistryManagementActions

type RegistryManagementActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type ReleaseCenterActions

type ReleaseCenterActions struct {
	View bool
}

type ReleasePlanActions

type ReleasePlanActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type S3StorageManagementActions

type S3StorageManagementActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type ScanningActions

type ScanningActions struct {
	View    bool
	Create  bool
	Edit    bool
	Delete  bool
	Execute bool
}

type SearchArgs

type SearchArgs struct {
	Name    string   `json:"name"`
	UIDs    []string `json:"uids"`
	PerPage int      `json:"per_page,omitempty"`
	Page    int      `json:"page,omitempty"`
}

type SearchUserArgs

type SearchUserArgs struct {
	Name         string   `json:"name,omitempty"`
	Account      string   `json:"account,omitempty"`
	IdentityType string   `json:"identity_type,omitempty"`
	UIDs         []string `json:"uids,omitempty"`
	PerPage      int      `json:"per_page,omitempty"`
	Page         int      `json:"page,omitempty"`
}

type SearchUserResp

type SearchUserResp struct {
	TotalCount int     `json:"totalCount"`
	Users      []*User `json:"users"`
}

type ServiceActions

type ServiceActions struct {
	View   bool
	Create bool
	Edit   bool
	Delete bool
}

type SystemActions

type SystemActions struct {
	Project              *SystemProjectActions        `json:"project"`
	Template             *TemplateActions             `json:"template"`
	TestCenter           *TestCenterActions           `json:"test_center"`
	ReleaseCenter        *ReleaseCenterActions        `json:"release_center"`
	DeliveryCenter       *DeliveryCenterActions       `json:"delivery_center"`
	DataCenter           *DataCenterActions           `json:"data_center"`
	ReleasePlan          *ReleasePlanActions          `json:"release_plan"`
	BusinessDirectory    *BusinessDirectoryActions    `json:"business_directory"`
	ClusterManagement    *ClusterManagementActions    `json:"cluster_management"`
	VMManagement         *VMManagementActions         `json:"vm_management"`
	RegistryManagement   *RegistryManagementActions   `json:"registry_management"`
	S3StorageManagement  *S3StorageManagementActions  `json:"s3storage_management"`
	HelmRepoManagement   *HelmRepoManagementActions   `json:"helmrepo_management"`
	DBInstanceManagement *DBInstanceManagementActions `json:"dbinstance_management"`
}

type SystemProjectActions

type SystemProjectActions struct {
	Create bool
	Delete bool
}

type TemplateActions

type TemplateActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type TestActions

type TestActions struct {
	View    bool
	Create  bool
	Edit    bool
	Delete  bool
	Execute bool
}

type TestCenterActions

type TestCenterActions struct {
	View bool
}

type User

type User struct {
	UID          string `json:"uid"`
	Name         string `json:"name"`
	Email        string `json:"email"`
	Phone        string `json:"phone"`
	IdentityType string `json:"identity_type"`
	Account      string `json:"account"`
}

type VMManagementActions

type VMManagementActions struct {
	Create bool
	View   bool
	Edit   bool
	Delete bool
}

type VersionActions

type VersionActions struct {
	View   bool
	Create bool
	Delete bool
}

type WorkflowActions

type WorkflowActions struct {
	View    bool
	Create  bool
	Edit    bool
	Delete  bool
	Execute bool
	Debug   bool
}

Jump to

Keyboard shortcuts

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