WIP: add /api/v3/iam/group/* endpoints

This commit is contained in:
Ingo Oppermann
2023-03-09 19:03:58 +01:00
parent d101a76e9e
commit a0ef3ab5ee
10 changed files with 1752 additions and 39 deletions

View File

@@ -468,6 +468,487 @@ const docTemplate = `{
}
}
},
"/api/v3/iam/group": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "List all groups",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "List all groups",
"operationId": "iam-3-list-groups",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Create a group with admins",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Create a group with admins",
"operationId": "iam-3-add-group",
"parameters": [
{
"description": "Group to add",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.IAMGroup"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.IAMGroup"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/iam/group/{group}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Get details of a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Get details of a group",
"operationId": "iam-3-get-group",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.IAMGroup"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Remove a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Remove a group",
"operationId": "iam-3-remove-group",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.IAMGroup"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/iam/group/{group}/user": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "List all users in a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "List all users in a group",
"operationId": "iam-3-get-group-users",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Add an user to a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Add an user to a group",
"operationId": "iam-3-add-group-user",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
},
{
"description": "User to add",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.IAMGroupUser"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/iam/group/{group}/user/{name}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Get the details of a user in a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Get the details of a user in a group",
"operationId": "iam-3-get-group-user",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
},
{
"type": "string",
"description": "user name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Set the policies of a user in a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Set the policies of a user in a group",
"operationId": "iam-3-update-group-user",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
},
{
"type": "string",
"description": "user name",
"name": "name",
"in": "path",
"required": true
},
{
"description": "User to add",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.IAMPolicy"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Remove a user from a group",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Remove a user from a group",
"operationId": "iam-3-remove-group-user",
"parameters": [
{
"type": "string",
"description": "group name",
"name": "group",
"in": "path",
"required": true
},
{
"type": "string",
"description": "user name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/iam/user": {
"post": {
"security": [
@@ -2823,6 +3304,37 @@ const docTemplate = `{
}
}
},
"api.IAMGroup": {
"type": "object",
"properties": {
"admins": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string"
}
}
},
"api.IAMGroupUser": {
"type": "object",
"properties": {
"admin": {
"type": "boolean"
},
"name": {
"type": "string"
},
"policies": {
"type": "array",
"items": {
"$ref": "#/definitions/api.IAMPolicy"
}
}
}
},
"api.IAMPolicy": {
"type": "object",
"properties": {