diff --git a/.gitignore b/.gitignore index 6914e5f..c7d7371 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ config.yaml panic.log testdata/ secret/ -data/ \ No newline at end of file +data/ +docs/ \ No newline at end of file diff --git a/docs/docs.go b/docs/docs.go deleted file mode 100644 index 7d7521e..0000000 --- a/docs/docs.go +++ /dev/null @@ -1,1106 +0,0 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": {}, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/api/acl/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Get all resources", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Create resource", - "parameters": [ - { - "description": "Resource", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.createResourceRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/api_acladmin.createResourceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/resources/{resourceId}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Get resource by ID", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resourceId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.getResourceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Delete resource", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resourceId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Update resource", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resourceId", - "in": "path", - "required": true - }, - { - "description": "Resource", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.updateResourceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.updateResourceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get all roles", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Create role", - "parameters": [ - { - "description": "Role", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.createRoleRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/api_acladmin.createRoleResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get role by ID", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.getRoleResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Delete role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Update role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - }, - { - "description": "Role", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.updateRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.updateRoleResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get role resources", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/api_acladmin.getRoleResource" - } - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Assign resource to role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - }, - { - "description": "Resource", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.assignResourceToRoleRequest" - } - } - ], - "responses": { - "201": { - "description": "Created" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}/resources/{resId}": { - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Remove resource from role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - }, - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}/users": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get role users", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/api_acladmin.getRoleUser" - } - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/users/{userId}/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/users" - ], - "summary": "Get user roles by user ID", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "User ID", - "name": "userId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/api_acladmin.getUserRole" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/users" - ], - "summary": "Assign role to user", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "User ID", - "name": "userId", - "in": "path", - "required": true - }, - { - "description": "Role ID", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.assignRoleToUserRequest" - } - } - ], - "responses": { - "201": { - "description": "Created" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/users/{userId}/roles/{roleId}": { - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/users" - ], - "summary": "Remove role from user", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "User ID", - "name": "userId", - "in": "path", - "required": true - }, - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - } - }, - "definitions": { - "api_acladmin.ProblemDetails": { - "type": "object", - "properties": { - "detail": { - "type": "string", - "example": "No role with ID 42" - }, - "instance": { - "type": "string", - "example": "/api/acl/roles/42" - }, - "status": { - "type": "integer", - "example": 404 - }, - "title": { - "type": "string", - "example": "Role not found" - }, - "type": { - "type": "string", - "example": "https://api.triggerssmith.com/errors/role-not-found" - } - } - }, - "api_acladmin.assignResourceToRoleRequest": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "example": 1 - } - } - }, - "api_acladmin.assignRoleToUserRequest": { - "type": "object", - "properties": { - "roleId": { - "type": "integer", - "example": 1 - } - } - }, - "api_acladmin.createResourceRequest": { - "type": "object", - "properties": { - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.createResourceResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.createRoleRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.createRoleResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.getResourceResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.getRoleResource": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "*" - } - } - }, - "api_acladmin.getRoleResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.getRoleUser": { - "type": "object", - "properties": { - "email": { - "type": "string", - "example": "admin@triggerssmith.com" - }, - "id": { - "type": "integer", - "example": 1 - }, - "username": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.getUserRole": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "*" - } - } - }, - "api_acladmin.updateResourceRequest": { - "type": "object", - "properties": { - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.updateResourceResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.updateRoleRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.updateRoleResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "", - Description: "", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/docs/swagger.json b/docs/swagger.json deleted file mode 100644 index 0259efb..0000000 --- a/docs/swagger.json +++ /dev/null @@ -1,1077 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "contact": {} - }, - "paths": { - "/api/acl/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Get all resources", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Create resource", - "parameters": [ - { - "description": "Resource", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.createResourceRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/api_acladmin.createResourceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/resources/{resourceId}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Get resource by ID", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resourceId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.getResourceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Delete resource", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resourceId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/resources" - ], - "summary": "Update resource", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resourceId", - "in": "path", - "required": true - }, - { - "description": "Resource", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.updateResourceRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.updateResourceResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get all roles", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Create role", - "parameters": [ - { - "description": "Role", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.createRoleRequest" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/api_acladmin.createRoleResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get role by ID", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.getRoleResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Delete role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Update role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - }, - { - "description": "Role", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.updateRoleRequest" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api_acladmin.updateRoleResponse" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}/resources": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get role resources", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/api_acladmin.getRoleResource" - } - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Assign resource to role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - }, - { - "description": "Resource", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.assignResourceToRoleRequest" - } - } - ], - "responses": { - "201": { - "description": "Created" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}/resources/{resId}": { - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Remove resource from role", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - }, - { - "type": "integer", - "example": 1, - "description": "Resource ID", - "name": "resId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/roles/{roleId}/users": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/roles" - ], - "summary": "Get role users", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/api_acladmin.getRoleUser" - } - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/users/{userId}/roles": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/users" - ], - "summary": "Get user roles by user ID", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "User ID", - "name": "userId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/api_acladmin.getUserRole" - } - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - }, - "post": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/users" - ], - "summary": "Assign role to user", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "User ID", - "name": "userId", - "in": "path", - "required": true - }, - { - "description": "Role ID", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/api_acladmin.assignRoleToUserRequest" - } - } - ], - "responses": { - "201": { - "description": "Created" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "409": { - "description": "Conflict", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - }, - "/api/acl/users/{userId}/roles/{roleId}": { - "delete": { - "produces": [ - "application/json" - ], - "tags": [ - "acl/users" - ], - "summary": "Remove role from user", - "parameters": [ - { - "type": "integer", - "example": 1, - "description": "User ID", - "name": "userId", - "in": "path", - "required": true - }, - { - "type": "integer", - "example": 1, - "description": "Role ID", - "name": "roleId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "404": { - "description": "Not Found", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/api_acladmin.ProblemDetails" - } - } - } - } - } - }, - "definitions": { - "api_acladmin.ProblemDetails": { - "type": "object", - "properties": { - "detail": { - "type": "string", - "example": "No role with ID 42" - }, - "instance": { - "type": "string", - "example": "/api/acl/roles/42" - }, - "status": { - "type": "integer", - "example": 404 - }, - "title": { - "type": "string", - "example": "Role not found" - }, - "type": { - "type": "string", - "example": "https://api.triggerssmith.com/errors/role-not-found" - } - } - }, - "api_acladmin.assignResourceToRoleRequest": { - "type": "object", - "properties": { - "resourceId": { - "type": "integer", - "example": 1 - } - } - }, - "api_acladmin.assignRoleToUserRequest": { - "type": "object", - "properties": { - "roleId": { - "type": "integer", - "example": 1 - } - } - }, - "api_acladmin.createResourceRequest": { - "type": "object", - "properties": { - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.createResourceResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.createRoleRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.createRoleResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.getResourceResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.getRoleResource": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "*" - } - } - }, - "api_acladmin.getRoleResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.getRoleUser": { - "type": "object", - "properties": { - "email": { - "type": "string", - "example": "admin@triggerssmith.com" - }, - "id": { - "type": "integer", - "example": 1 - }, - "username": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.getUserRole": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "*" - } - } - }, - "api_acladmin.updateResourceRequest": { - "type": "object", - "properties": { - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.updateResourceResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "key": { - "type": "string", - "example": "html.view" - } - } - }, - "api_acladmin.updateRoleRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "admin" - } - } - }, - "api_acladmin.updateRoleResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "admin" - } - } - } - } -} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml deleted file mode 100644 index 8917879..0000000 --- a/docs/swagger.yaml +++ /dev/null @@ -1,718 +0,0 @@ -definitions: - api_acladmin.ProblemDetails: - properties: - detail: - example: No role with ID 42 - type: string - instance: - example: /api/acl/roles/42 - type: string - status: - example: 404 - type: integer - title: - example: Role not found - type: string - type: - example: https://api.triggerssmith.com/errors/role-not-found - type: string - type: object - api_acladmin.assignResourceToRoleRequest: - properties: - resourceId: - example: 1 - type: integer - type: object - api_acladmin.assignRoleToUserRequest: - properties: - roleId: - example: 1 - type: integer - type: object - api_acladmin.createResourceRequest: - properties: - key: - example: html.view - type: string - type: object - api_acladmin.createResourceResponse: - properties: - id: - example: 1 - type: integer - key: - example: html.view - type: string - type: object - api_acladmin.createRoleRequest: - properties: - name: - example: admin - type: string - type: object - api_acladmin.createRoleResponse: - properties: - id: - example: 1 - type: integer - name: - example: admin - type: string - type: object - api_acladmin.getResourceResponse: - properties: - id: - example: 1 - type: integer - key: - example: html.view - type: string - type: object - api_acladmin.getRoleResource: - properties: - id: - example: 1 - type: integer - name: - example: '*' - type: string - type: object - api_acladmin.getRoleResponse: - properties: - id: - example: 1 - type: integer - name: - example: admin - type: string - type: object - api_acladmin.getRoleUser: - properties: - email: - example: admin@triggerssmith.com - type: string - id: - example: 1 - type: integer - username: - example: admin - type: string - type: object - api_acladmin.getUserRole: - properties: - id: - example: 1 - type: integer - name: - example: '*' - type: string - type: object - api_acladmin.updateResourceRequest: - properties: - key: - example: html.view - type: string - type: object - api_acladmin.updateResourceResponse: - properties: - id: - example: 1 - type: integer - key: - example: html.view - type: string - type: object - api_acladmin.updateRoleRequest: - properties: - name: - example: admin - type: string - type: object - api_acladmin.updateRoleResponse: - properties: - id: - example: 1 - type: integer - name: - example: admin - type: string - type: object -info: - contact: {} -paths: - /api/acl/resources: - get: - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - properties: - id: - example: 1 - type: integer - key: - example: html.view - type: string - type: object - type: array - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get all resources - tags: - - acl/resources - post: - consumes: - - application/json - parameters: - - description: Resource - in: body - name: request - required: true - schema: - $ref: '#/definitions/api_acladmin.createResourceRequest' - produces: - - application/json - responses: - "201": - description: Created - schema: - $ref: '#/definitions/api_acladmin.createResourceResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Create resource - tags: - - acl/resources - /api/acl/resources/{resourceId}: - delete: - parameters: - - description: Resource ID - example: 1 - in: path - name: resourceId - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Delete resource - tags: - - acl/resources - get: - parameters: - - description: Resource ID - example: 1 - in: path - name: resourceId - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api_acladmin.getResourceResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get resource by ID - tags: - - acl/resources - patch: - consumes: - - application/json - parameters: - - description: Resource ID - example: 1 - in: path - name: resourceId - required: true - type: integer - - description: Resource - in: body - name: request - required: true - schema: - $ref: '#/definitions/api_acladmin.updateResourceRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api_acladmin.updateResourceResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Update resource - tags: - - acl/resources - /api/acl/roles: - get: - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - items: - properties: - id: - example: 1 - type: integer - name: - example: admin - type: string - type: object - type: array - type: array - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get all roles - tags: - - acl/roles - post: - consumes: - - application/json - parameters: - - description: Role - in: body - name: request - required: true - schema: - $ref: '#/definitions/api_acladmin.createRoleRequest' - produces: - - application/json - responses: - "201": - description: Created - schema: - $ref: '#/definitions/api_acladmin.createRoleResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Create role - tags: - - acl/roles - /api/acl/roles/{roleId}: - delete: - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - produces: - - application/json - responses: - "204": - description: No Content - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Delete role - tags: - - acl/roles - get: - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api_acladmin.getRoleResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get role by ID - tags: - - acl/roles - patch: - consumes: - - application/json - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - - description: Role - in: body - name: request - required: true - schema: - $ref: '#/definitions/api_acladmin.updateRoleRequest' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api_acladmin.updateRoleResponse' - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Update role - tags: - - acl/roles - /api/acl/roles/{roleId}/resources: - get: - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - items: - $ref: '#/definitions/api_acladmin.getRoleResource' - type: array - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get role resources - tags: - - acl/roles - post: - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - - description: Resource - in: body - name: request - required: true - schema: - $ref: '#/definitions/api_acladmin.assignResourceToRoleRequest' - produces: - - application/json - responses: - "201": - description: Created - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Assign resource to role - tags: - - acl/roles - /api/acl/roles/{roleId}/resources/{resId}: - delete: - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - - description: Resource ID - example: 1 - in: path - name: resId - required: true - type: integer - produces: - - application/json - responses: - "204": - description: No Content - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Remove resource from role - tags: - - acl/roles - /api/acl/roles/{roleId}/users: - get: - parameters: - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - items: - $ref: '#/definitions/api_acladmin.getRoleUser' - type: array - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get role users - tags: - - acl/roles - /api/acl/users/{userId}/roles: - get: - parameters: - - description: User ID - example: 1 - in: path - name: userId - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/api_acladmin.getUserRole' - type: array - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Get user roles by user ID - tags: - - acl/users - post: - parameters: - - description: User ID - example: 1 - in: path - name: userId - required: true - type: integer - - description: Role ID - in: body - name: body - required: true - schema: - $ref: '#/definitions/api_acladmin.assignRoleToUserRequest' - produces: - - application/json - responses: - "201": - description: Created - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "409": - description: Conflict - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Assign role to user - tags: - - acl/users - /api/acl/users/{userId}/roles/{roleId}: - delete: - parameters: - - description: User ID - example: 1 - in: path - name: userId - required: true - type: integer - - description: Role ID - example: 1 - in: path - name: roleId - required: true - type: integer - produces: - - application/json - responses: - "204": - description: No Content - "400": - description: Bad Request - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "404": - description: Not Found - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/api_acladmin.ProblemDetails' - summary: Remove role from user - tags: - - acl/users -swagger: "2.0"