user

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 7 Imported by: ? modules, 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 added in v1.9.9

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

type BuildActions added in v1.9.9

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

type Client

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

func New

func New() *Client

func (*Client) CheckPermissionGivenByCollaborationMode added in v1.9.9

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

func (*Client) CheckUserAuthInfoForCollaborationMode added in v1.9.9

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

func (*Client) CreateUser

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

func (*Client) DeleteUser added in v1.9.9

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

func (*Client) GetUserAuthInfo added in v1.9.9

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

func (*Client) GetUserByID added in v1.9.9

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

func (*Client) Healthz added in v1.7.1

func (c *Client) Healthz() error

func (*Client) ListAuthorizedProjects added in v1.9.9

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

func (*Client) ListAuthorizedProjectsByResourceAndVerb added in v1.9.9

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

func (*Client) ListAuthorizedWorkflows added in v1.9.9

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

func (*Client) ListCollaborationEnvironmentsPermission added in v1.9.9

func (c *Client) ListCollaborationEnvironmentsPermission(uid, projectKey string) (*types.CollaborationEnvPermission, 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 added in v1.9.9

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 added in v1.9.9

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

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 DataCenterActions added in v1.9.9

type DataCenterActions struct {
	ViewOverView      bool
	ViewInsight       bool
	EditInsightConfig bool
}

type DeliveryCenterActions added in v1.9.9

type DeliveryCenterActions struct {
	ViewArtifact bool
	ViewVersion  bool
}

type EnvActions added in v1.9.9

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

type ProductionEnvActions added in v1.9.9

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

type ProductionServiceActions added in v1.9.9

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

type ProjectActions added in v1.9.9

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 ReleaseCenterActions added in v1.9.9

type ReleaseCenterActions struct {
	View bool
}

type ScanningActions added in v1.9.9

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

type SearchArgs

type SearchArgs struct {
	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 added in v1.9.9

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

type SystemActions added in v1.9.9

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

type SystemProjectActions added in v1.9.9

type SystemProjectActions struct {
	Create bool
	Delete bool
}

type TemplateActions added in v1.9.9

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

type TestActions added in v1.9.9

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

type TestCenterActions added in v1.9.9

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 VersionActions added in v1.9.9

type VersionActions struct {
	View   bool
	Create bool
	Delete bool
}

type WorkflowActions added in v1.9.9

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