* add devops client interface Signed-off-by: runzexia <runzexia@yunify.com> * direct return jenkins Signed-off-by: runzexia <runzexia@yunify.com> * add some interface Signed-off-by: runzexia <runzexia@yunify.com> * update Signed-off-by: runzexia <runzexia@yunify.com> * update interface Signed-off-by: runzexia <runzexia@yunify.com> * update Signed-off-by: runzexia <runzexia@yunify.com> * credential op structs Signed-off-by: runzexia <runzexia@yunify.com> * status Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * update interface Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * credential handler Signed-off-by: runzexia <runzexia@yunify.com> * update devopsoperator func Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * get build sonar Signed-off-by: runzexia <runzexia@yunify.com> * sonar handler * mv code to cilent Signed-off-by: runzexia <runzexia@yunify.com> * update Signed-off-by: runzexia <runzexia@yunify.com> * project member handler Signed-off-by: runzexia <runzexia@yunify.com> * update pipeline operator interface Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add tenant devops handler Signed-off-by: runzexia <runzexia@yunify.com> * update merge Signed-off-by: runzexia <runzexia@yunify.com> * clean Signed-off-by: runzexia <runzexia@yunify.com> * fmt Signed-off-by: runzexia <runzexia@yunify.com> * update ListPipelineRuns Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * complate pipelineOperator interface Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * update HttpParameters Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add pipeline steps interface Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * update pipeline GetNodesDetail Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add s2i api Signed-off-by: runzexia <runzexia@yunify.com> * add branch pipeline interface and update handler Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add scan branch interface and update handler Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add common interface and update handler Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add SCM interface and update handler Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add handler Signed-off-by: runzexia <runzexia@yunify.com> * add fake s3 Signed-off-by: runzexia <runzexia@yunify.com> * add webhook&check interface and update handler Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * clean Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * clean Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * format Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add some func Signed-off-by: runzexia <runzexia@yunify.com> * clean code Signed-off-by: runzexia <runzexia@yunify.com> * implement interface Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * fix interface GetBranchArtifacts Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add s2ibinary upload test Signed-off-by: runzexia <runzexia@yunify.com> * tenant devops Signed-off-by: runzexia <runzexia@yunify.com> * update tenant Signed-off-by: runzexia <runzexia@yunify.com> * fake Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add some unit test Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * add devops tenant handler Signed-off-by: runzexia <runzexia@yunify.com> * status Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * status Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * status Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * update fake test Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * update unit test and fake data Signed-off-by: zhuxiaoyang <sunzhu@yunify.com> * update Co-authored-by: Xiaoyang Zhu <sunzhu@yunify.com>
49 lines
1.8 KiB
Go
49 lines
1.8 KiB
Go
package devops
|
||
|
||
type ProjectMembership struct {
|
||
Username string `json:"username" description:"Member's username,username can uniquely identify a user"`
|
||
ProjectId string `json:"project_id" db:"project_id" description:"the DevOps Projects which project membership belongs to"`
|
||
Role string `json:"role" description:"DevOps Project membership's role type. e.g. owner '"`
|
||
Status string `json:"status" description:"Deprecated, Status of project membership. e.g. active "`
|
||
GrantBy string `json:"grand_by,omitempty" description:"Username of the user who assigned the role"`
|
||
}
|
||
|
||
type ProjectMemberOperator interface {
|
||
AddProjectMember(membership *ProjectMembership) (*ProjectMembership, error)
|
||
UpdateProjectMember(oldMembership, newMembership *ProjectMembership) (*ProjectMembership, error)
|
||
DeleteProjectMember(membership *ProjectMembership) (*ProjectMembership, error)
|
||
}
|
||
|
||
var DefaultRoles = []*Role{
|
||
{
|
||
Name: ProjectOwner,
|
||
Description: "Owner have access to do all the operations of a DevOps project and own the highest permissions as well.",
|
||
},
|
||
{
|
||
Name: ProjectMaintainer,
|
||
Description: "Maintainer have access to manage pipeline and credential configuration in a DevOps project.",
|
||
},
|
||
{
|
||
Name: ProjectDeveloper,
|
||
Description: "Developer is able to view and trigger the pipeline.",
|
||
},
|
||
{
|
||
Name: ProjectReporter,
|
||
Description: "Reporter is only allowed to view the status of the pipeline.",
|
||
},
|
||
}
|
||
|
||
var AllRoleSlice = []string{ProjectDeveloper, ProjectReporter, ProjectMaintainer, ProjectOwner}
|
||
|
||
const (
|
||
ProjectOwner = "owner"
|
||
ProjectMaintainer = "maintainer"
|
||
ProjectDeveloper = "developer"
|
||
ProjectReporter = "reporter"
|
||
)
|
||
|
||
type Role struct {
|
||
Name string `json:"name" description:"role's name e.g. owner'"`
|
||
Description string `json:"description" description:"role 's description'"`
|
||
}
|