update swagger docs
This commit is contained in:
785
swagger/docs.go
785
swagger/docs.go
@@ -11,7 +11,7 @@ const docTemplate = `{
|
||||
"title": "{{.Title}}",
|
||||
"contact": {
|
||||
"name": "ACC Server Manager Support",
|
||||
"url": "https://github.com/yourusername/acc-server-manager"
|
||||
"url": "https://github.com/FJurmanovic/acc-server-manager"
|
||||
},
|
||||
"license": {
|
||||
"name": "MIT",
|
||||
@@ -22,199 +22,7 @@ const docTemplate = `{
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/auth/login": {
|
||||
"post": {
|
||||
"description": "Authenticate a user and receive a JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "User login",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Login credentials",
|
||||
"name": "credentials",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT token",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Invalid credentials",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/membership": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get a list of all registered users",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "List all users",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of users",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Create a new user account with specified role",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Create a new user",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "User details",
|
||||
"name": "user",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Created user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"409": {
|
||||
"description": "User already exists",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/server": {
|
||||
"/v1/api/server": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@@ -305,6 +113,111 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/login": {
|
||||
"post": {
|
||||
"description": "Authenticate a user and receive a JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "User login",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Login credentials",
|
||||
"name": "credentials",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT token",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Invalid credentials",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/me": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get details of the currently authenticated user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "Get current user details",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Current user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/lookup/car-models": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -569,6 +482,361 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/membership": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get a list of all registered users",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "List all users",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of users",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Create a new user account with specified role",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Create a new user",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "User details",
|
||||
"name": "user",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Created user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"409": {
|
||||
"description": "User already exists",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/membership/roles": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get a list of all available user roles",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Get all roles",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of roles",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.Role"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/membership/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get detailed information about a specific user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Get user by ID",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "User ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "User details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid user ID format",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Update user details by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Update user",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "User ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Updated user details",
|
||||
"name": "user",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/service.UpdateUserRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Updated user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body or ID format",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Delete a specific user by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Delete user",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "User ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "User successfully deleted"
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid user ID format",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/server": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -854,6 +1122,71 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Delete an existing ACC server",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Server"
|
||||
],
|
||||
"summary": "Delete an ACC server",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Server ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Deleted server details",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid server data or ID",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Server not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/server/{id}/config": {
|
||||
@@ -1086,27 +1419,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control": {
|
||||
"get": {
|
||||
"description": "Return service control status",
|
||||
"tags": [
|
||||
"service-control"
|
||||
],
|
||||
"summary": "Return service control status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/restart": {
|
||||
"/v1/server/{id}/service/restart": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1185,7 +1498,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/start": {
|
||||
"/v1/server/{id}/service/start": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1270,7 +1583,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/stop": {
|
||||
"/v1/server/{id}/service/stop": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1355,7 +1668,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/{service}": {
|
||||
"/v1/server/{id}/service/{service}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1463,6 +1776,26 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/system/health": {
|
||||
"get": {
|
||||
"description": "Return service control status",
|
||||
"tags": [
|
||||
"system"
|
||||
],
|
||||
"summary": "Return service control status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
@@ -1617,6 +1950,20 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"service.UpdateUserRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"roleId": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
@@ -1632,7 +1979,7 @@ const docTemplate = `{
|
||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||
var SwaggerInfo = &swag.Spec{
|
||||
Version: "1.0",
|
||||
Host: "localhost:3000",
|
||||
Host: "https://acc.jurmanovic.com",
|
||||
BasePath: "/api/v1",
|
||||
Schemes: []string{"http", "https"},
|
||||
Title: "ACC Server Manager API",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"title": "ACC Server Manager API",
|
||||
"contact": {
|
||||
"name": "ACC Server Manager Support",
|
||||
"url": "https://github.com/yourusername/acc-server-manager"
|
||||
"url": "https://github.com/FJurmanovic/acc-server-manager"
|
||||
},
|
||||
"license": {
|
||||
"name": "MIT",
|
||||
@@ -17,202 +17,10 @@
|
||||
},
|
||||
"version": "1.0"
|
||||
},
|
||||
"host": "localhost:3000",
|
||||
"host": "https://acc.jurmanovic.com",
|
||||
"basePath": "/api/v1",
|
||||
"paths": {
|
||||
"/auth/login": {
|
||||
"post": {
|
||||
"description": "Authenticate a user and receive a JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "User login",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Login credentials",
|
||||
"name": "credentials",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT token",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Invalid credentials",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/membership": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get a list of all registered users",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "List all users",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of users",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Create a new user account with specified role",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Create a new user",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "User details",
|
||||
"name": "user",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Created user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"409": {
|
||||
"description": "User already exists",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/server": {
|
||||
"/v1/api/server": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@@ -303,6 +111,111 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/login": {
|
||||
"post": {
|
||||
"description": "Authenticate a user and receive a JWT token",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "User login",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Login credentials",
|
||||
"name": "credentials",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT token",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Invalid credentials",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/auth/me": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get details of the currently authenticated user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
],
|
||||
"summary": "Get current user details",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Current user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/lookup/car-models": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -567,6 +480,361 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/membership": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get a list of all registered users",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "List all users",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of users",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Create a new user account with specified role",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Create a new user",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "User details",
|
||||
"name": "user",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Created user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"409": {
|
||||
"description": "User already exists",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/membership/roles": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get a list of all available user roles",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Get all roles",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "List of roles",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.Role"
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/membership/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Get detailed information about a specific user",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Get user by ID",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "User ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "User details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid user ID format",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Update user details by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Update user",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "User ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Updated user details",
|
||||
"name": "user",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/service.UpdateUserRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Updated user details",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.User"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request body or ID format",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Delete a specific user by ID",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User Management"
|
||||
],
|
||||
"summary": "Delete user",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "User ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "User successfully deleted"
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid user ID format",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "User not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/server": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -852,6 +1120,71 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Delete an existing ACC server",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Server"
|
||||
],
|
||||
"summary": "Delete an ACC server",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Server ID (UUID format)",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Deleted server details",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid server data or ID",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Insufficient permissions",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Server not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/error_handler.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/server/{id}/config": {
|
||||
@@ -1084,27 +1417,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control": {
|
||||
"get": {
|
||||
"description": "Return service control status",
|
||||
"tags": [
|
||||
"service-control"
|
||||
],
|
||||
"summary": "Return service control status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/restart": {
|
||||
"/v1/server/{id}/service/restart": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1183,7 +1496,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/start": {
|
||||
"/v1/server/{id}/service/start": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1268,7 +1581,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/stop": {
|
||||
"/v1/server/{id}/service/stop": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1353,7 +1666,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/service-control/{service}": {
|
||||
"/v1/server/{id}/service/{service}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@@ -1461,6 +1774,26 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/system/health": {
|
||||
"get": {
|
||||
"description": "Return service control status",
|
||||
"tags": [
|
||||
"system"
|
||||
],
|
||||
"summary": "Return service control status",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
@@ -1615,6 +1948,20 @@
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"service.UpdateUserRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"roleId": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
|
||||
@@ -103,11 +103,20 @@ definitions:
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
host: localhost:3000
|
||||
service.UpdateUserRequest:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
roleId:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
host: https://acc.jurmanovic.com
|
||||
info:
|
||||
contact:
|
||||
name: ACC Server Manager Support
|
||||
url: https://github.com/yourusername/acc-server-manager
|
||||
url: https://github.com/FJurmanovic/acc-server-manager
|
||||
description: API for managing Assetto Corsa Competizione dedicated servers
|
||||
license:
|
||||
name: MIT
|
||||
@@ -115,130 +124,7 @@ info:
|
||||
title: ACC Server Manager API
|
||||
version: "1.0"
|
||||
paths:
|
||||
/auth/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Authenticate a user and receive a JWT token
|
||||
parameters:
|
||||
- description: Login credentials
|
||||
in: body
|
||||
name: credentials
|
||||
required: true
|
||||
schema:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: JWT token
|
||||
schema:
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
type: object
|
||||
"400":
|
||||
description: Invalid request body
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Invalid credentials
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
summary: User login
|
||||
tags:
|
||||
- Authentication
|
||||
/membership:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get a list of all registered users
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: List of users
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/model.User'
|
||||
type: array
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List all users
|
||||
tags:
|
||||
- User Management
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Create a new user account with specified role
|
||||
parameters:
|
||||
- description: User details
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
role:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Created user details
|
||||
schema:
|
||||
$ref: '#/definitions/model.User'
|
||||
"400":
|
||||
description: Invalid request body
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"409":
|
||||
description: User already exists
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Create a new user
|
||||
tags:
|
||||
- User Management
|
||||
/server:
|
||||
/v1/api/server:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -294,6 +180,73 @@ paths:
|
||||
summary: List all servers (API format)
|
||||
tags:
|
||||
- Server
|
||||
/v1/auth/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Authenticate a user and receive a JWT token
|
||||
parameters:
|
||||
- description: Login credentials
|
||||
in: body
|
||||
name: credentials
|
||||
required: true
|
||||
schema:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: JWT token
|
||||
schema:
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
type: object
|
||||
"400":
|
||||
description: Invalid request body
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Invalid credentials
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
summary: User login
|
||||
tags:
|
||||
- Authentication
|
||||
/v1/auth/me:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get details of the currently authenticated user
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Current user details
|
||||
schema:
|
||||
$ref: '#/definitions/model.User'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"404":
|
||||
description: User not found
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get current user details
|
||||
tags:
|
||||
- Authentication
|
||||
/v1/lookup/car-models:
|
||||
get:
|
||||
consumes:
|
||||
@@ -461,6 +414,233 @@ paths:
|
||||
summary: Get available tracks
|
||||
tags:
|
||||
- Lookups
|
||||
/v1/membership:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get a list of all registered users
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: List of users
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/model.User'
|
||||
type: array
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: List all users
|
||||
tags:
|
||||
- User Management
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Create a new user account with specified role
|
||||
parameters:
|
||||
- description: User details
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
properties:
|
||||
password:
|
||||
type: string
|
||||
role:
|
||||
type: string
|
||||
username:
|
||||
type: string
|
||||
type: object
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Created user details
|
||||
schema:
|
||||
$ref: '#/definitions/model.User'
|
||||
"400":
|
||||
description: Invalid request body
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"409":
|
||||
description: User already exists
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Create a new user
|
||||
tags:
|
||||
- User Management
|
||||
/v1/membership/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Delete a specific user by ID
|
||||
parameters:
|
||||
- description: User ID (UUID format)
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"204":
|
||||
description: User successfully deleted
|
||||
"400":
|
||||
description: Invalid user ID format
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"404":
|
||||
description: User not found
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Delete user
|
||||
tags:
|
||||
- User Management
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get detailed information about a specific user
|
||||
parameters:
|
||||
- description: User ID (UUID format)
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: User details
|
||||
schema:
|
||||
$ref: '#/definitions/model.User'
|
||||
"400":
|
||||
description: Invalid user ID format
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"404":
|
||||
description: User not found
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get user by ID
|
||||
tags:
|
||||
- User Management
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Update user details by ID
|
||||
parameters:
|
||||
- description: User ID (UUID format)
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
- description: Updated user details
|
||||
in: body
|
||||
name: user
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/service.UpdateUserRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Updated user details
|
||||
schema:
|
||||
$ref: '#/definitions/model.User'
|
||||
"400":
|
||||
description: Invalid request body or ID format
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"404":
|
||||
description: User not found
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Update user
|
||||
tags:
|
||||
- User Management
|
||||
/v1/membership/roles:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Get a list of all available user roles
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: List of roles
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/model.Role'
|
||||
type: array
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Get all roles
|
||||
tags:
|
||||
- User Management
|
||||
/v1/server:
|
||||
get:
|
||||
consumes:
|
||||
@@ -557,6 +737,48 @@ paths:
|
||||
tags:
|
||||
- Server
|
||||
/v1/server/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Delete an existing ACC server
|
||||
parameters:
|
||||
- description: Server ID (UUID format)
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Deleted server details
|
||||
schema:
|
||||
type: object
|
||||
"400":
|
||||
description: Invalid server data or ID
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"403":
|
||||
description: Insufficient permissions
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"404":
|
||||
description: Server not found
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/error_handler.ErrorResponse'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
summary: Delete an ACC server
|
||||
tags:
|
||||
- Server
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -792,20 +1014,7 @@ paths:
|
||||
summary: Update server configuration file
|
||||
tags:
|
||||
- Server Configuration
|
||||
/v1/service-control:
|
||||
get:
|
||||
description: Return service control status
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
summary: Return service control status
|
||||
tags:
|
||||
- service-control
|
||||
/v1/service-control/{service}:
|
||||
/v1/server/{id}/service/{service}:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -849,7 +1058,7 @@ paths:
|
||||
summary: Get service status
|
||||
tags:
|
||||
- Service Control
|
||||
/v1/service-control/restart:
|
||||
/v1/server/{id}/service/restart:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -899,7 +1108,7 @@ paths:
|
||||
summary: Restart a Windows service
|
||||
tags:
|
||||
- Service Control
|
||||
/v1/service-control/start:
|
||||
/v1/server/{id}/service/start:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -953,7 +1162,7 @@ paths:
|
||||
summary: Start a Windows service
|
||||
tags:
|
||||
- Service Control
|
||||
/v1/service-control/stop:
|
||||
/v1/server/{id}/service/stop:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@@ -1033,6 +1242,19 @@ paths:
|
||||
summary: Return StateHistorys
|
||||
tags:
|
||||
- StateHistory
|
||||
/v1/system/health:
|
||||
get:
|
||||
description: Return service control status
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
summary: Return service control status
|
||||
tags:
|
||||
- system
|
||||
schemes:
|
||||
- http
|
||||
- https
|
||||
|
||||
Reference in New Issue
Block a user