some changes

This commit is contained in:
2025-12-21 00:00:03 +02:00
parent 904f446447
commit 85f8ac60e7
14 changed files with 678 additions and 1475 deletions

View File

@@ -19,15 +19,18 @@
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"key": {
"type": "string",
"example": "html.view"
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"key": {
"type": "string",
"example": "html.view"
}
}
}
}
@@ -36,7 +39,7 @@
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -73,19 +76,19 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.createResourceErrorInvalidResourceKey"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api_acladmin.createResourceErrorResourceAlreadyExists"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -120,19 +123,19 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.getResourceErrorInvalidResourceID"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api_acladmin.getResourceErrorResourceNotFound"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -162,25 +165,25 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.deleteResourceErrorInvalidResourceID"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api_acladmin.deleteResourceErrorResourceNotFound"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api_acladmin.deleteResourceErrorResourceInUse"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -225,25 +228,25 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.updateResourceErrorInvalidResourceKey"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api_acladmin.updateResourceErrorResourceNotFound"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api_acladmin.updateResourceErrorResourceKeyAlreadyExists"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -264,15 +267,18 @@
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"name": {
"type": "string",
"example": "admin"
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"name": {
"type": "string",
"example": "admin"
}
}
}
}
@@ -281,7 +287,7 @@
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -318,25 +324,19 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInvalidRequestBody"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/api_acladmin.createRoleErrorInvalidRoleName"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api_acladmin.createRoleErrorRoleAlreadyExists"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -371,19 +371,19 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.getRoleErrorInvalidRoleID"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api_acladmin.getRoleErrorRoleNotFound"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -413,25 +413,25 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.deleteRoleErrorInvalidRoleID"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api_acladmin.deleteRoleErrorRoleNotFound"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api_acladmin.deleteRoleErrorRoleInUse"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
@@ -476,25 +476,78 @@
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api_acladmin.updateRoleErrorInvalidRoleName"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api_acladmin.updateRoleErrorRoleNotFound"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/api_acladmin.updateRoleErrorRoleNameAlreadyExists"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api_acladmin.errorInternalServerError"
"$ref": "#/definitions/api_acladmin.ProblemDetails"
}
}
}
}
},
"/api/acl/roles/{roleId}/users": {
"get": {
"produces": [
"application/json"
],
"tags": [
"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"
}
}
}
@@ -502,29 +555,28 @@
}
},
"definitions": {
"api_acladmin.createResourceErrorInvalidResourceKey": {
"api_acladmin.ProblemDetails": {
"type": "object",
"properties": {
"details": {
"detail": {
"type": "string",
"example": "Invalid resource key"
"example": "No role with ID 42"
},
"error": {
"instance": {
"type": "string",
"example": "FAILED_TO_CREATE_RESOURCE"
}
}
},
"api_acladmin.createResourceErrorResourceAlreadyExists": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Resource with key 'html.view' already exists"
"example": "/api/acl/roles/42"
},
"error": {
"status": {
"type": "integer",
"example": 404
},
"title": {
"type": "string",
"example": "FAILED_TO_CREATE_RESOURCE"
"example": "Role not found"
},
"type": {
"type": "string",
"example": "https://api.triggerssmith.com/errors/role-not-found"
}
}
},
@@ -550,32 +602,6 @@
}
}
},
"api_acladmin.createRoleErrorInvalidRoleName": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Invalid role name"
},
"error": {
"type": "string",
"example": "FAILED_TO_CREATE_ROLE"
}
}
},
"api_acladmin.createRoleErrorRoleAlreadyExists": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Role with name 'admin' already exists"
},
"error": {
"type": "string",
"example": "FAILED_TO_CREATE_ROLE"
}
}
},
"api_acladmin.createRoleRequest": {
"type": "object",
"properties": {
@@ -598,134 +624,6 @@
}
}
},
"api_acladmin.deleteResourceErrorInvalidResourceID": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Resource ID must be positive integer"
},
"error": {
"type": "string",
"example": "INVALID_RESOURCE_ID"
}
}
},
"api_acladmin.deleteResourceErrorResourceInUse": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Resource with ID 123 is used and cannot be deleted"
},
"error": {
"type": "string",
"example": "FAILED_TO_DELETE_RESOURCE"
}
}
},
"api_acladmin.deleteResourceErrorResourceNotFound": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "No resource with ID 123"
},
"error": {
"type": "string",
"example": "RESOURCE_NOT_FOUND"
}
}
},
"api_acladmin.deleteRoleErrorInvalidRoleID": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Role ID must be positive integer"
},
"error": {
"type": "string",
"example": "INVALID_ROLE_ID"
}
}
},
"api_acladmin.deleteRoleErrorRoleInUse": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Role with ID 123 is assigned to users and cannot be deleted"
},
"error": {
"type": "string",
"example": "FAILED_TO_DELETE_ROLE"
}
}
},
"api_acladmin.deleteRoleErrorRoleNotFound": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "No role with ID 123"
},
"error": {
"type": "string",
"example": "ROLE_NOT_FOUND"
}
}
},
"api_acladmin.errorInternalServerError": {
"type": "object",
"properties": {
"details": {
"type": "string"
},
"error": {
"type": "string"
}
}
},
"api_acladmin.errorInvalidRequestBody": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Request body is not valid JSON"
},
"error": {
"type": "string",
"example": "INVALID_REQUEST_BODY"
}
}
},
"api_acladmin.getResourceErrorInvalidResourceID": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Resource ID must be positive integer"
},
"error": {
"type": "string",
"example": "INVALID_RESOURCE_ID"
}
}
},
"api_acladmin.getResourceErrorResourceNotFound": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "No resource with ID 123"
},
"error": {
"type": "string",
"example": "RESOURCE_NOT_FOUND"
}
}
},
"api_acladmin.getResourceResponse": {
"type": "object",
"properties": {
@@ -739,32 +637,6 @@
}
}
},
"api_acladmin.getRoleErrorInvalidRoleID": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Role ID must be positive integer"
},
"error": {
"type": "string",
"example": "INVALID_ROLE_ID"
}
}
},
"api_acladmin.getRoleErrorRoleNotFound": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "No role with ID 123"
},
"error": {
"type": "string",
"example": "ROLE_NOT_FOUND"
}
}
},
"api_acladmin.getRoleResponse": {
"type": "object",
"properties": {
@@ -778,55 +650,20 @@
}
}
},
"api_acladmin.updateResourceErrorInvalidResourceID": {
"api_acladmin.getRoleUser": {
"type": "object",
"properties": {
"details": {
"userEmail": {
"type": "string",
"example": "Resource ID must be positive integer"
"example": "admin@triggerssmith.com"
},
"error": {
"type": "string",
"example": "INVALID_RESOURCE_ID"
}
}
},
"api_acladmin.updateResourceErrorInvalidResourceKey": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Invalid resource key"
"userId": {
"type": "integer",
"example": 1
},
"error": {
"userName": {
"type": "string",
"example": "FAILED_TO_UPDATE_RESOURCE"
}
}
},
"api_acladmin.updateResourceErrorResourceKeyAlreadyExists": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Resource with key 'html.view' already exists"
},
"error": {
"type": "string",
"example": "FAILED_TO_UPDATE_RESOURCE"
}
}
},
"api_acladmin.updateResourceErrorResourceNotFound": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "No resource with ID 123"
},
"error": {
"type": "string",
"example": "RESOURCE_NOT_FOUND"
"example": "admin"
}
}
},
@@ -852,58 +689,6 @@
}
}
},
"api_acladmin.updateRoleErrorInvalidRoleID": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Role ID must be positive integer"
},
"error": {
"type": "string",
"example": "INVALID_ROLE_ID"
}
}
},
"api_acladmin.updateRoleErrorInvalidRoleName": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Invalid role name"
},
"error": {
"type": "string",
"example": "FAILED_TO_UPDATE_ROLE"
}
}
},
"api_acladmin.updateRoleErrorRoleNameAlreadyExists": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Role with name 'admin' already exists"
},
"error": {
"type": "string",
"example": "FAILED_TO_UPDATE_ROLE"
}
}
},
"api_acladmin.updateRoleErrorRoleNotFound": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "No role with ID 123"
},
"error": {
"type": "string",
"example": "ROLE_NOT_FOUND"
}
}
},
"api_acladmin.updateRoleRequest": {
"type": "object",
"properties": {