Documentation ¶
Index ¶
- Constants
- func CheckCollaborationModePermission(uid, projectKey, resource, resourceName, action string) (hasPermission bool, err error)
- func CheckPermissionGivenByCollaborationMode(uid, projectKey, resource, action string) (hasPermission bool, err error)
- func CreateUser(args *User, logger *zap.SugaredLogger) (*models.User, error)
- func DeleteUserByUID(uid string, logger *zap.SugaredLogger) error
- func GetUser(uid string, logger *zap.SugaredLogger) (*types.UserInfo, error)
- func GetUserCount(logger *zap.SugaredLogger) (*types.UserStatistics, error)
- func GetUserSetting(uid string, logger *zap.SugaredLogger) (*types.UserSetting, error)
- func InitializeAdmin() error
- func ListAuthorizedEnvs(uid, projectKey string, logger *zap.SugaredLogger) (readEnvList, editEnvList []string, err error)
- func ListAuthorizedProject(uid string, logger *zap.SugaredLogger) ([]string, error)
- func ListAuthorizedProjectByVerb(uid, resource, verb string, logger *zap.SugaredLogger) ([]string, error)
- func ListAuthorizedWorkflow(uid, projectKey string, logger *zap.SugaredLogger) ([]string, []string, error)
- func Reset(args *ResetParams, logger *zap.SugaredLogger) error
- func SearchAndSyncUser(ldapId string, logger *zap.SugaredLogger) error
- func SearchUserByAccount(args *QueryArgs, logger *zap.SugaredLogger) (*types.UsersResp, error)
- func SearchUsers(args *QueryArgs, logger *zap.SugaredLogger) (*types.UsersResp, error)
- func SearchUsersByUIDs(uids []string, logger *zap.SugaredLogger) (*types.UsersResp, error)
- func SyncUser(syncUserInfo *SyncUserInfo, ifUpdateLoginTime bool, logger *zap.SugaredLogger) (*models.User, error)
- func UpdatePassword(args *Password, logger *zap.SugaredLogger) error
- func UpdateUser(uid string, args *UpdateUserInfo, _ *zap.SugaredLogger) error
- func UpdateUserSetting(uid string, args *UserSetting) error
- type AuthorizedResources
- type BuildActions
- type DataCenterActions
- type DeliveryCenterActions
- type EnvActions
- type Operation
- type Password
- type ProductionEnvActions
- type ProductionServiceActions
- type ProjectActions
- type QueryArgs
- type Register
- type ReleaseCenterActions
- type ResetParams
- type RetrieveResp
- type ScanningActions
- type ServiceActions
- type SyncUserInfo
- type SystemActions
- type SystemProjectActions
- type TemplateActions
- type TestActions
- type TestCenterActions
- type UpdateUserInfo
- type User
- type UserSetting
- type VersionActions
- type WorkflowActions
Constants ¶
View Source
const ( GeneralNamespace = "*" AdminRole = "admin" ProjectAdminRole = "project-admin" ReadOnlyRole = "read-only" )
View Source
const ( // delivery VerbGetDelivery = "get_delivery" VerbCreateDelivery = "create_delivery" VerbDeleteDelivery = "delete_delivery" // test VerbGetTest = "get_test" VerbCreateTest = "create_test" VerbEditTest = "edit_test" VerbDeleteTest = "delete_test" VerbRunTest = "run_test" // service VerbGetService = "get_service" VerbCreateService = "create_service" VerbEditService = "edit_service" VerbDeleteService = "delete_service" // production service VerbGetProductionService = "get_production_service" VerbCreateProductionService = "create_production_service" VerbEditProductionService = "edit_production_service" VerbDeleteProductionService = "delete_production_service" // build VerbGetBuild = "get_build" VerbCreateBuild = "create_build" VerbEditBuild = "edit_build" VerbDeleteBuild = "delete_build" // Workflow VerbGetWorkflow = "get_workflow" VerbCreateWorkflow = "create_workflow" VerbEditWorkflow = "edit_workflow" VerbDeleteWorkflow = "delete_workflow" VerbRunWorkflow = "run_workflow" VerbDebugWorkflow = "debug_workflow" // Environment VerbGetEnvironment = "get_environment" VerbCreateEnvironment = "create_environment" VerbConfigEnvironment = "config_environment" VerbManageEnvironment = "manage_environment" VerbDeleteEnvironment = "delete_environment" VerbDebugEnvironmentPod = "debug_pod" VerbEnvironmentSSHPM = "ssh_pm" // Production Environment VerbGetProductionEnv = "get_production_environment" VerbCreateProductionEnv = "create_production_environment" VerbConfigProductionEnv = "config_production_environment" VerbEditProductionEnv = "edit_production_environment" VerbDeleteProductionEnv = "delete_production_environment" VerbDebugProductionEnvPod = "production_debug_pod" // Scanning VerbGetScan = "get_scan" VerbCreateScan = "create_scan" VerbEditScan = "edit_scan" VerbDeleteScan = "delete_scan" VerbRunScan = "run_scan" )
Namespaced Resources Actions
View Source
const ( // project VerbCreateProject = "create_project" VerbDeleteProject = "delete_project" // template store VerbCreateTemplate = "create_template" VerbGetTemplate = "get_template" VerbEditTemplate = "edit_template" VerbDeleteTemplate = "delete_template" // test center VerbViewTestCenter = "get_test" // release center VerbViewReleaseCenter = "get_release" // delivery center VerbDeliveryCenterGetVersions = "release_get" VerbDeliveryCenterGetArtifact = "delivery_get" // data center VerbGetDataCenterOverview = "data_over" VerbGetDataCenterInsight = "efficiency_over" VerbEditDataCenterInsightConfig = "edit_dashboard_config" )
system level authorization actions
View Source
const ( UppercaseValidator = `[A-Z]+` LowercaseValidator = `[a-z]+` DigitValidator = `\d+` LengthValidator = `.{8,}` )
Variables ¶
This section is empty.
Functions ¶
func CheckCollaborationModePermission ¶ added in v1.18.0
func CheckPermissionGivenByCollaborationMode ¶ added in v1.18.0
func CreateUser ¶
func DeleteUserByUID ¶
func DeleteUserByUID(uid string, logger *zap.SugaredLogger) error
func GetUserCount ¶ added in v1.9.9
func GetUserCount(logger *zap.SugaredLogger) (*types.UserStatistics, error)
func GetUserSetting ¶ added in v1.9.9
func GetUserSetting(uid string, logger *zap.SugaredLogger) (*types.UserSetting, error)
func InitializeAdmin ¶ added in v1.18.0
func InitializeAdmin() error
func ListAuthorizedEnvs ¶ added in v1.18.0
func ListAuthorizedEnvs(uid, projectKey string, logger *zap.SugaredLogger) (readEnvList, editEnvList []string, err error)
func ListAuthorizedProject ¶ added in v1.18.0
func ListAuthorizedProject(uid string, logger *zap.SugaredLogger) ([]string, error)
func ListAuthorizedProjectByVerb ¶ added in v1.18.0
func ListAuthorizedProjectByVerb(uid, resource, verb string, logger *zap.SugaredLogger) ([]string, error)
func ListAuthorizedWorkflow ¶ added in v1.18.0
func ListAuthorizedWorkflow(uid, projectKey string, logger *zap.SugaredLogger) ([]string, []string, error)
ListAuthorizedWorkflow lists all workflows authorized by collaboration mode
func Reset ¶
func Reset(args *ResetParams, logger *zap.SugaredLogger) error
func SearchAndSyncUser ¶
func SearchAndSyncUser(ldapId string, logger *zap.SugaredLogger) error
func SearchUserByAccount ¶
func SearchUsers ¶
func SearchUsersByUIDs ¶
func SyncUser ¶
func SyncUser(syncUserInfo *SyncUserInfo, ifUpdateLoginTime bool, logger *zap.SugaredLogger) (*models.User, error)
func UpdatePassword ¶
func UpdatePassword(args *Password, logger *zap.SugaredLogger) error
func UpdateUser ¶
func UpdateUser(uid string, args *UpdateUserInfo, _ *zap.SugaredLogger) error
func UpdateUserSetting ¶ added in v1.9.9
func UpdateUserSetting(uid string, args *UserSetting) error
Types ¶
type AuthorizedResources ¶ added in v1.18.0
type AuthorizedResources struct { IsSystemAdmin bool `json:"is_system_admin"` ProjectAuthInfo map[string]ProjectActions `json:"project_auth_info"` SystemActions *SystemActions `json:"system_actions"` }
func GetUserAuthInfo ¶ added in v1.18.0
func GetUserAuthInfo(uid string, logger *zap.SugaredLogger) (*AuthorizedResources, error)
type BuildActions ¶ added in v1.18.0
type DataCenterActions ¶ added in v1.18.0
type DeliveryCenterActions ¶ added in v1.18.0
type EnvActions ¶ added in v1.18.0
type ProductionEnvActions ¶ added in v1.18.0
type ProductionServiceActions ¶ added in v1.18.0
type ProjectActions ¶ added in v1.18.0
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.18.0
type ReleaseCenterActions struct {
View bool
}
type ResetParams ¶
type RetrieveResp ¶
type RetrieveResp struct {
Email string `json:"email"`
}
func Retrieve ¶
func Retrieve(account string, logger *zap.SugaredLogger) (*RetrieveResp, error)
type ScanningActions ¶ added in v1.18.0
type ServiceActions ¶ added in v1.18.0
type SyncUserInfo ¶
type SystemActions ¶ added in v1.18.0
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.18.0
type TemplateActions ¶ added in v1.18.0
type TestActions ¶ added in v1.18.0
type TestCenterActions ¶ added in v1.18.0
type TestCenterActions struct {
View bool
}
type UpdateUserInfo ¶
type UserSetting ¶ added in v1.9.9
type VersionActions ¶ added in v1.18.0
Click to show internal directories.
Click to hide internal directories.