fix: deprecate old user/group joint project API, create new action apis

for add user/group to projects with roles
This commit is contained in:
Qiu Jian
2019-08-17 12:53:12 +08:00
parent dfeb5d1e06
commit e1f35f67e7
23 changed files with 840 additions and 23 deletions
+16
View File
@@ -0,0 +1,16 @@
post:
summary: 将组以多个角色加入多个项目
parameters:
- $ref: '../parameters/group.yaml#/group_id'
- name: group
in: body
required: true
schema:
$ref: "../schemas/project.yaml#/ProjectJoinRequestInput"
responses:
200:
description: 组信息
schema:
$ref: "../schemas/group.yaml#/GroupGetResponse"
tags:
- groups
+16
View File
@@ -0,0 +1,16 @@
post:
summary: 将组的多个角色从多个项目中删除
parameters:
- $ref: '../parameters/group.yaml#/group_id'
- name: group
in: body
required: true
schema:
$ref: "../schemas/project.yaml#/ProjectLeaveRequestInput"
responses:
200:
description: 组信息
schema:
$ref: "../schemas/group.yaml#/GroupGetResponse"
tags:
- groups
+16
View File
@@ -0,0 +1,16 @@
post:
summary: 将多个用户和组以多个角色加入指定项目
parameters:
- $ref: '../parameters/project.yaml#/project_id'
- name: project
in: body
required: true
schema:
$ref: "../schemas/project.yaml#/ProjectJoinUserGroupRequestInput"
responses:
200:
description: 项目信息
schema:
$ref: "../schemas/project.yaml#/ProjectGetResponse"
tags:
- projects
+16
View File
@@ -0,0 +1,16 @@
post:
summary: 将多个用户和组以多个角色从指定项目删除
parameters:
- $ref: '../parameters/project.yaml#/project_id'
- name: project
in: body
required: true
schema:
$ref: "../schemas/project.yaml#/ProjectRemoveUserGroupRequestInput"
responses:
200:
description: 项目信息
schema:
$ref: "../schemas/project.yaml#/ProjectGetResponse"
tags:
- projects
+2
View File
@@ -1,4 +1,5 @@
put:
deprecated: true
summary: 将组以指定角色加入项目
parameters:
- $ref: '../parameters/identity.yaml#/project_id'
@@ -11,6 +12,7 @@ put:
- roles
delete:
deprecated: true
summary: 将组在项目中的角色删除
parameters:
- $ref: '../parameters/identity.yaml#/project_id'
+2
View File
@@ -1,4 +1,5 @@
put:
deprecated: true
summary: 将用户以指定角色加入项目
parameters:
- $ref: '../parameters/identity.yaml#/project_id'
@@ -11,6 +12,7 @@ put:
- roles
delete:
deprecated: true
summary: 将用户在项目中的角色删除
parameters:
- $ref: '../parameters/identity.yaml#/project_id'
+16
View File
@@ -0,0 +1,16 @@
post:
summary: 将用户以多个角色加入多个项目
parameters:
- $ref: '../parameters/user.yaml#/user_id'
- name: user
in: body
required: true
schema:
$ref: "../schemas/project.yaml#/ProjectJoinRequestInput"
responses:
200:
description: 用户信息
schema:
$ref: "../schemas/user.yaml#/UserGetResponse"
tags:
- users
+16
View File
@@ -0,0 +1,16 @@
post:
summary: 将用户的多个角色从多个项目中删除
parameters:
- $ref: '../parameters/user.yaml#/user_id'
- name: user
in: body
required: true
schema:
$ref: "../schemas/project.yaml#/ProjectLeaveRequestInput"
responses:
200:
description: 用户信息
schema:
$ref: "../schemas/user.yaml#/UserGetResponse"
tags:
- users
+12
View File
@@ -312,11 +312,19 @@ paths:
$ref: "./identity/users.yaml"
/users/{user_id}:
$ref: "./identity/user.yaml"
/users/{user_id}/join:
$ref: "./identity/user_join.yaml"
/users/{user_id}/leave:
$ref: "./identity/user_leave.yaml"
/groups:
$ref: "./identity/groups.yaml"
/groups/{group_id}:
$ref: "./identity/group.yaml"
/groups/{group_id}/join:
$ref: "./identity/group_join.yaml"
/groups/{group_id}/leave:
$ref: "./identity/group_leave.yaml"
/groups/{group_id}/users/{user_id}:
$ref: "./identity/groupuser.yaml"
@@ -324,6 +332,10 @@ paths:
$ref: "./identity/projects.yaml"
/projects/{project_id}:
$ref: "./identity/project.yaml"
/projects/{project_id}/join:
$ref: "./identity/project_join.yaml"
/projects/{project_id}/leave:
$ref: "./identity/project_leave.yaml"
/roles:
$ref: "./identity/roles.yaml"
+81
View File
@@ -57,3 +57,84 @@ Project:
can_delete:
type: boolean
description: 是否可以删除
ProjectJoinRequestInput:
type: object
description: 用户或组批量加入项目的请求body
properties:
projects:
type: array
description: 项目列表
items:
type: string
roles:
type: array
description: 角色列表
items:
type: string
ProjectLeaveRequestInput:
type: object
description: 用户或组批量移除项目的请求body
properties:
project_roles:
type: array
description: 移除的项目和角色列表
items:
type: object
properties:
project:
type: string
description: 项目ID或名称
role:
type: string
description: 角色ID或名称
ProjectJoinUserGroupRequestInput:
type: object
description: 将多个用户或组批量加入指定项目的请求body
properties:
users:
type: array
description: 加入的用户列表
items:
type: string
groups:
type: array
description: 加入的组列表
items:
type: string
roles:
type: array
description: 加入的角色列表
items:
type: string
ProjectRemoveUserGroupRequestInput:
type: object
description: 将多个用户或组从指定项目移除的请求body
properties:
user_roles:
type: array
description: 用户和角色列表
items:
type: object
properties:
user:
type: string
description: 用户ID或名称
role:
type: string
description: 角色ID或名称
group_roles:
type: array
description: 组和角色列表
items:
type: object
properties:
group:
type: string
description: 组ID或名称
role:
type: string
description: 角色ID或名称