mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 02:06:25 +00:00
Refactor API Schema and validation
- /schema now returns full openapi/swagger schema - That schema is used to validate incoming requests - And used as a contract in future integration tests - Moved route files up one level - Fixed incorrect 404 reponses when getting objects - Fixed saving new objects and passing jsonschemavalidation
This commit is contained in:
53
backend/schema/paths/audit-log/get.json
Normal file
53
backend/schema/paths/audit-log/get.json
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"operationId": "getAuditLog",
|
||||
"summary": "Get Audit Log",
|
||||
"tags": ["Audit Log"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["audit-log"]
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 7,
|
||||
"created_on": "2024-10-08T13:09:54.000Z",
|
||||
"modified_on": "2024-10-08T13:09:54.000Z",
|
||||
"user_id": 1,
|
||||
"object_type": "user",
|
||||
"object_id": 3,
|
||||
"action": "updated",
|
||||
"meta": {
|
||||
"name": "John Doe",
|
||||
"permissions": {
|
||||
"user_id": 3,
|
||||
"visibility": "all",
|
||||
"access_lists": "manage",
|
||||
"dead_hosts": "hidden",
|
||||
"proxy_hosts": "manage",
|
||||
"redirection_hosts": "view",
|
||||
"streams": "hidden",
|
||||
"certificates": "manage",
|
||||
"id": 3,
|
||||
"modified_on": "2024-10-08T13:09:54.000Z",
|
||||
"created_on": "2024-10-08T13:09:51.000Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/audit-log-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
backend/schema/paths/get.json
Normal file
29
backend/schema/paths/get.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"operationId": "health",
|
||||
"summary": "Returns the API health status",
|
||||
"tags": ["Public"],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"status": "OK",
|
||||
"version": {
|
||||
"major": 2,
|
||||
"minor": 1,
|
||||
"revision": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../components/health-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
backend/schema/paths/nginx/access-lists/get.json
Normal file
50
backend/schema/paths/nginx/access-lists/get.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"operationId": "getAccessLists",
|
||||
"summary": "Get all access lists",
|
||||
"tags": ["Access Lists"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["access_lists"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["owner", "items", "clients", "proxy_hosts"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"owner_user_id": 1,
|
||||
"name": "test1234",
|
||||
"meta": {},
|
||||
"satisfy_any": 1,
|
||||
"pass_auth": 0,
|
||||
"proxy_host_count": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/access-list-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
39
backend/schema/paths/nginx/access-lists/listID/delete.json
Normal file
39
backend/schema/paths/nginx/access-lists/listID/delete.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"operationId": "deleteAccessList",
|
||||
"summary": "Delete a Access List",
|
||||
"tags": ["Access Lists"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["access_lists"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "listID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
backend/schema/paths/nginx/access-lists/listID/get.json
Normal file
49
backend/schema/paths/nginx/access-lists/listID/get.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"operationId": "getAccessList",
|
||||
"summary": "Get a access List",
|
||||
"tags": ["Access Lists"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["access_lists"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "listID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2020-01-30T09:36:08.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/access-list-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
164
backend/schema/paths/nginx/access-lists/listID/put.json
Normal file
164
backend/schema/paths/nginx/access-lists/listID/put.json
Normal file
@ -0,0 +1,164 @@
|
||||
{
|
||||
"operationId": "updateAccessList",
|
||||
"summary": "Update a Access List",
|
||||
"tags": ["Access Lists"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["access_lists"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "listID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Access List Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"name": {
|
||||
"$ref": "../../../../components/access-list-object.json#/properties/name"
|
||||
},
|
||||
"satisfy_any": {
|
||||
"$ref": "../../../../components/access-list-object.json#/properties/satisfy_any"
|
||||
},
|
||||
"pass_auth": {
|
||||
"$ref": "../../../../components/access-list-object.json#/properties/pass_auth"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"clients": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"address": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^all$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"directive": {
|
||||
"$ref": "../../../../components/access-list-object.json#/properties/directive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:34:34.000Z",
|
||||
"owner_user_id": 1,
|
||||
"name": "test123!!",
|
||||
"meta": {},
|
||||
"satisfy_any": 1,
|
||||
"pass_auth": 0,
|
||||
"proxy_host_count": 0,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-07T22:43:55.000Z",
|
||||
"modified_on": "2024-10-08T12:52:54.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "some guy",
|
||||
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"access_list_id": 1,
|
||||
"username": "admin",
|
||||
"password": "",
|
||||
"meta": {},
|
||||
"hint": "a****"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"access_list_id": 1,
|
||||
"username": "asdad",
|
||||
"password": "",
|
||||
"meta": {},
|
||||
"hint": "a*****"
|
||||
}
|
||||
],
|
||||
"clients": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"access_list_id": 1,
|
||||
"address": "127.0.0.1",
|
||||
"directive": "allow",
|
||||
"meta": {}
|
||||
}
|
||||
],
|
||||
"proxy_hosts": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/access-list-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
155
backend/schema/paths/nginx/access-lists/post.json
Normal file
155
backend/schema/paths/nginx/access-lists/post.json
Normal file
@ -0,0 +1,155 @@
|
||||
{
|
||||
"operationId": "createAccessList",
|
||||
"summary": "Create a Access List",
|
||||
"tags": ["Access Lists"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["access_lists"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Access List Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"$ref": "../../../components/access-list-object.json#/properties/name"
|
||||
},
|
||||
"satisfy_any": {
|
||||
"$ref": "../../../components/access-list-object.json#/properties/satisfy_any"
|
||||
},
|
||||
"pass_auth": {
|
||||
"$ref": "../../../components/access-list-object.json#/properties/pass_auth"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"username": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"clients": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"address": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^all$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"directive": {
|
||||
"$ref": "../../../components/access-list-object.json#/properties/directive"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/access-list-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"owner_user_id": 1,
|
||||
"name": "test1234",
|
||||
"meta": {},
|
||||
"satisfy_any": 1,
|
||||
"pass_auth": 0,
|
||||
"proxy_host_count": 0,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-07T22:43:55.000Z",
|
||||
"modified_on": "2024-10-08T12:52:54.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "some guy",
|
||||
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"access_list_id": 1,
|
||||
"username": "admin",
|
||||
"password": "",
|
||||
"meta": {},
|
||||
"hint": "a****"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"access_list_id": 1,
|
||||
"username": "asdad",
|
||||
"password": "",
|
||||
"meta": {},
|
||||
"hint": "a*****"
|
||||
}
|
||||
],
|
||||
"proxy_hosts": [],
|
||||
"clients": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T22:15:40.000Z",
|
||||
"modified_on": "2024-10-08T22:15:40.000Z",
|
||||
"access_list_id": 1,
|
||||
"address": "127.0.0.1",
|
||||
"directive": "allow",
|
||||
"meta": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/access-list-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
39
backend/schema/paths/nginx/certificates/certID/delete.json
Normal file
39
backend/schema/paths/nginx/certificates/certID/delete.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"operationId": "deleteCertificate",
|
||||
"summary": "Delete a Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "certID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
{
|
||||
"operationId": "downloadCertificate",
|
||||
"summary": "Downloads a Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "certID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/zip": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "binary"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
53
backend/schema/paths/nginx/certificates/certID/get.json
Normal file
53
backend/schema/paths/nginx/certificates/certID/get.json
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"operationId": "getCertificate",
|
||||
"summary": "Get a Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "certID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 4,
|
||||
"created_on": "2024-10-09T05:31:58.000Z",
|
||||
"modified_on": "2024-10-09T05:32:11.000Z",
|
||||
"owner_user_id": 1,
|
||||
"provider": "letsencrypt",
|
||||
"nice_name": "test.example.com",
|
||||
"domain_names": ["test.example.com"],
|
||||
"expires_on": "2025-01-07T04:34:18.000Z",
|
||||
"meta": {
|
||||
"letsencrypt_email": "jc@jc21.com",
|
||||
"letsencrypt_agree": true,
|
||||
"dns_challenge": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/certificate-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
{
|
||||
"operationId": "renewCertificate",
|
||||
"summary": "Renews a Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "certID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"expires_on": "2025-01-07T06:41:58.000Z",
|
||||
"modified_on": "2024-10-09T07:39:51.000Z",
|
||||
"id": 4,
|
||||
"created_on": "2024-10-09T05:31:58.000Z",
|
||||
"owner_user_id": 1,
|
||||
"is_deleted": 0,
|
||||
"provider": "letsencrypt",
|
||||
"nice_name": "My Test Cert",
|
||||
"domain_names": ["test.jc21.supernerd.pro"],
|
||||
"meta": {
|
||||
"letsencrypt_email": "jc@jc21.com",
|
||||
"letsencrypt_agree": true,
|
||||
"dns_challenge": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/certificate-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
{
|
||||
"operationId": "uploadCertificate",
|
||||
"summary": "Uploads a custom Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "certID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Certificate Files",
|
||||
"required": true,
|
||||
"content": {
|
||||
"multipart/form-data": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["certificate", "certificate_key"],
|
||||
"properties": {
|
||||
"certificate": {
|
||||
"type": "string"
|
||||
},
|
||||
"certificate_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"intermediate_certificate": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"certificate": "-----BEGIN CERTIFICATE-----\nMIIEYDCCAsigAwIBAgIRAPoSC0hvitb26ODMlsH6YbowDQYJKoZIhvcNAQELBQAw\ngZExHjAcBgNVBAoTFW1rY2VydCBkZXZlbG9wbWVudCBDQTEzMDEGA1UECwwqamN1\ncm5vd0BKYW1pZXMtTGFwdG9wLmxvY2FsIChKYW1pZSBDdXJub3cpMTowOAYDVQQD\nDDFta2NlcnQgamN1cm5vd0BKYW1pZXMtTGFwdG9wLmxvY2FsIChKYW1pZSBDdXJu\nb3cpMB4XDTI0MTAwOTA3MjIxN1oXDTI3MDEwOTA3MjIxN1owXjEnMCUGA1UEChMe\nbWtjZXJ0IGRldmVsb3BtZW50IGNlcnRpZmljYXRlMTMwMQYDVQQLDCpqY3Vybm93\nQEphbWllcy1MYXB0b3AubG9jYWwgKEphbWllIEN1cm5vdykwggEiMA0GCSqGSIb3\nDQEBAQUAA4IBDwAwggEKAoIBAQC1n9j9C5Bes1ndqACDckERauxXVNKCnUlUM1bu\nGBx1xc+j2e2Ar23wUJJuWBY18VfT8yqfqVDktO2wrbmvZvLuPmXePOKbIKS+XXh+\n2NG9L5bDG9rwGFCRXnbQj+GWCdMfzx14+CR1IHgeYz6Cv/Si2/LJPCh/CoBfM4hU\nQJON3lxAWrWBpdbZnKYMrxuPBRfW9OuzTbCVXToQoxRAHiOR9081Xn1WeoKr7kVB\nIa5UphlvWXa12w1YmUwJu7YndnJGIavLWeNCVc7ZEo+nS8Wr/4QWicatIWZXpVaE\nOPhRoeplQDxNWg5b/Q26rYoVd7PrCmRs7sVcH79XzGONeH1PAgMBAAGjZTBjMA4G\nA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAfBgNVHSMEGDAWgBSB\n/vfmBUd4W7CvyEMl7YpMVQs8vTAbBgNVHREEFDASghB0ZXN0LmV4YW1wbGUuY29t\nMA0GCSqGSIb3DQEBCwUAA4IBgQASwON/jPAHzcARSenY0ZGY1m5OVTYoQ/JWH0oy\nl8SyFCQFEXt7UHDD/eTtLT0vMyc190nP57P8lTnZGf7hSinZz1B1d6V4cmzxpk0s\nVXZT+irL6bJVJoMBHRpllKAhGULIo33baTrWFKA0oBuWx4AevSWKcLW5j87kEawn\nATCuMQ1I3ifR1mSlB7X8fb+vF+571q0NGuB3a42j6rdtXJ6SmH4+9B4qO0sfHDNt\nIImpLCH/tycDpcYrGSCn1QrekFG1bSEh+Bb9i8rqMDSDsYrTFPZTuOQ3EtjGni9u\nm+rEP3OyJg+md8c+0LVP7/UU4QWWnw3/Wolo5kSCxE8vNTFqi4GhVbdLnUtcIdTV\nXxuR6cKyW87Snj1a0nG76ZLclt/akxDhtzqeV60BO0p8pmiev8frp+E94wFNYCmp\n1cr3CnMEGRaficLSDFC6EBENzlZW2BQT6OMIV+g0NBgSyQe39s2zcdEl5+SzDVuw\nhp8bJUp/QN7pnOVCDbjTQ+HVMXw=\n-----END CERTIFICATE-----\n",
|
||||
"certificate_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC1n9j9C5Bes1nd\nqACDckERauxXVNKCnUlUM1buGBx1xc+j2e2Ar23wUJJuWBY18VfT8yqfqVDktO2w\nrbmvZvLuPmXePOKbIKS+XXh+2NG9L5bDG9rwGFCRXnbQj+GWCdMfzx14+CR1IHge\nYz6Cv/Si2/LJPCh/CoBfM4hUQJON3lxAWrWBpdbZnKYMrxuPBRfW9OuzTbCVXToQ\noxRAHiOR9081Xn1WeoKr7kVBIa5UphlvWXa12w1YmUwJu7YndnJGIavLWeNCVc7Z\nEo+nS8Wr/4QWicatIWZXpVaEOPhRoeplQDxNWg5b/Q26rYoVd7PrCmRs7sVcH79X\nzGONeH1PAgMBAAECggEAANb3Wtwl07pCjRrMvc7WbC0xYIn82yu8/g2qtjkYUJcU\nia5lQbYN7RGCS85Oc/tkq48xQEG5JQWNH8b918jDEMTrFab0aUEyYcru1q9L8PL6\nYHaNgZSrMrDcHcS8h0QOXNRJT5jeGkiHJaTR0irvB526tqF3knbK9yW22KTfycUe\na0Z9voKn5xRk1DCbHi/nk2EpT7xnjeQeLFaTIRXbS68omkr4YGhwWm5OizoyEGZu\nW0Zum5BkQyMr6kor3wdxOTG97ske2rcyvvHi+ErnwL0xBv0qY0Dhe8DpuXpDezqw\no72yY8h31Fu84i7sAj24YuE5Df8DozItFXQpkgbQ6QKBgQDPrufhvIFm2S/MzBdW\nH8JxY7CJlJPyxOvc1NIl9RczQGAQR90kx52cgIcuIGEG6/wJ/xnGfMmW40F0DnQ+\nN+oLgB9SFxeLkRb7s9Z/8N3uIN8JJFYcerEOiRQeN2BXEEWJ7bUThNtsVrAcKoUh\nELsDmnHW/3V+GKwhd0vpk842+wKBgQDf4PGLG9PTE5tlAoyHFodJRd2RhTJQkwsU\nMDNjLJ+KecLv+Nl+QiJhoflG1ccqtSFlBSCG067CDQ5LV0xm3mLJ7pfJoMgjcq31\nqjEmX4Ls91GuVOPtbwst3yFKjsHaSoKB5fBvWRcKFpBUezM7Qcw2JP3+dQT+bQIq\ncMTkRWDSvQKBgQDOdCQFDjxg/lR7NQOZ1PaZe61aBz5P3pxNqa7ClvMaOsuEQ7w9\nvMYcdtRq8TsjA2JImbSI0TIg8gb2FQxPcYwTJKl+FICOeIwtaSg5hTtJZpnxX5LO\nutTaC0DZjNkTk5RdOdWA8tihyUdGqKoxJY2TVmwGe2rUEDjFB++J4inkEwKBgB6V\ng0nmtkxanFrzOzFlMXwgEEHF+Xaqb9QFNa/xs6XeNnREAapO7JV75Cr6H2hFMFe1\nmJjyqCgYUoCWX3iaHtLJRnEkBtNY4kzyQB6m46LtsnnnXO/dwKA2oDyoPfFNRoDq\nYatEd3JIXNU9s2T/+x7WdOBjKhh72dTkbPFmTPDdAoGAU6rlPBevqOFdObYxdPq8\nEQWu44xqky3Mf5sBpOwtu6rqCYuziLiN7K4sjN5GD5mb1cEU+oS92ZiNcUQ7MFXk\n8yTYZ7U0VcXyAcpYreWwE8thmb0BohJBr+Mp3wLTx32x0HKdO6vpUa0d35LUTUmM\nRrKmPK/msHKK/sVHiL+NFqo=\n-----END PRIVATE KEY-----\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
54
backend/schema/paths/nginx/certificates/get.json
Normal file
54
backend/schema/paths/nginx/certificates/get.json
Normal file
@ -0,0 +1,54 @@
|
||||
{
|
||||
"operationId": "getCertificates",
|
||||
"summary": "Get all certificates",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["owner"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 4,
|
||||
"created_on": "2024-10-09T05:31:58.000Z",
|
||||
"modified_on": "2024-10-09T05:32:11.000Z",
|
||||
"owner_user_id": 1,
|
||||
"provider": "letsencrypt",
|
||||
"nice_name": "test.example.com",
|
||||
"domain_names": ["test.example.com"],
|
||||
"expires_on": "2025-01-07T04:34:18.000Z",
|
||||
"meta": {
|
||||
"letsencrypt_email": "jc@jc21.com",
|
||||
"letsencrypt_agree": true,
|
||||
"dns_challenge": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/certificate-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
77
backend/schema/paths/nginx/certificates/post.json
Normal file
77
backend/schema/paths/nginx/certificates/post.json
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"operationId": "createCertificate",
|
||||
"summary": "Create a Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Certificate Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["provider"],
|
||||
"properties": {
|
||||
"provider": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/provider"
|
||||
},
|
||||
"nice_name": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/nice_name"
|
||||
},
|
||||
"domain_names": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/domain_names"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"expires_on": "2025-01-07 04:30:17",
|
||||
"modified_on": "2024-10-09 05:28:51",
|
||||
"id": 5,
|
||||
"created_on": "2024-10-09 05:28:35",
|
||||
"owner_user_id": 1,
|
||||
"is_deleted": 0,
|
||||
"provider": "letsencrypt",
|
||||
"nice_name": "test.example.com",
|
||||
"domain_names": ["test.example.com"],
|
||||
"meta": {
|
||||
"letsencrypt_email": "jc@jc21.com",
|
||||
"letsencrypt_agree": true,
|
||||
"dns_challenge": false,
|
||||
"letsencrypt_certificate": {
|
||||
"cn": "test.example.com",
|
||||
"issuer": "C = US, O = Let's Encrypt, CN = E5",
|
||||
"dates": {
|
||||
"from": 1728448218,
|
||||
"to": 1736224217
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/certificate-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
40
backend/schema/paths/nginx/certificates/test-http/get.json
Normal file
40
backend/schema/paths/nginx/certificates/test-http/get.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"operationId": "testHttpReach",
|
||||
"summary": "Test HTTP Reachability",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "domains",
|
||||
"description": "Expansions",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"example": "[\"test.example.ord\",\"test.example.com\",\"nonexistent.example.com\"]"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"test.example.org": "ok",
|
||||
"test.example.com": "other:Invalid domain or IP",
|
||||
"nonexistent.example.com": "404"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
75
backend/schema/paths/nginx/certificates/validate/post.json
Normal file
75
backend/schema/paths/nginx/certificates/validate/post.json
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
"operationId": "validateCertificates",
|
||||
"summary": "Validates given Custom Certificates",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Certificate Files",
|
||||
"required": true,
|
||||
"content": {
|
||||
"multipart/form-data": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["certificate", "certificate_key"],
|
||||
"properties": {
|
||||
"certificate": {
|
||||
"type": "string"
|
||||
},
|
||||
"certificate_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"intermediate_certificate": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"certificate": {
|
||||
"cn": "mkcert",
|
||||
"issuer": "O = mkcert development CA, OU = jc@jc-Laptop.local (John Doe), CN = mkcert jc@jc-Laptop.local (John Doe)",
|
||||
"dates": {
|
||||
"from": 1728458537,
|
||||
"to": 1799479337
|
||||
}
|
||||
},
|
||||
"certificate_key": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Certificate is not valid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
57
backend/schema/paths/nginx/dead-hosts/get.json
Normal file
57
backend/schema/paths/nginx/dead-hosts/get.json
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"operationId": "getDeadHosts",
|
||||
"summary": "Get all 404 hosts",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["owner", "certificate"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:38:52.000Z",
|
||||
"modified_on": "2024-10-09T01:38:52.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/dead-host-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
39
backend/schema/paths/nginx/dead-hosts/hostID/delete.json
Normal file
39
backend/schema/paths/nginx/dead-hosts/hostID/delete.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"operationId": "deleteDeadHost",
|
||||
"summary": "Delete a 404 Host",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "disableDeadHost",
|
||||
"summary": "Disable a 404 Host",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "enableDeadHost",
|
||||
"summary": "Enable a 404 Host",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
56
backend/schema/paths/nginx/dead-hosts/hostID/get.json
Normal file
56
backend/schema/paths/nginx/dead-hosts/hostID/get.json
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"operationId": "getDeadHost",
|
||||
"summary": "Get a 404 Host",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:38:52.000Z",
|
||||
"modified_on": "2024-10-09T01:38:52.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/dead-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
110
backend/schema/paths/nginx/dead-hosts/hostID/put.json
Normal file
110
backend/schema/paths/nginx/dead-hosts/hostID/put.json
Normal file
@ -0,0 +1,110 @@
|
||||
{
|
||||
"operationId": "updateDeadHost",
|
||||
"summary": "Update a 404 Host",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "404 Host Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../../components/dead-host-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:38:52.000Z",
|
||||
"modified_on": "2024-10-09T01:46:06.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T00:59:56.000Z",
|
||||
"modified_on": "2024-10-09T00:59:56.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "Admin",
|
||||
"avatar": "",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"certificate": null,
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/dead-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
95
backend/schema/paths/nginx/dead-hosts/post.json
Normal file
95
backend/schema/paths/nginx/dead-hosts/post.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"operationId": "create404Host",
|
||||
"summary": "Create a 404 Host",
|
||||
"tags": ["404 Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["dead_hosts"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "404 Host Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain_names"],
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/dead-host-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:38:52.000Z",
|
||||
"modified_on": "2024-10-09T01:38:52.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"certificate": null,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T00:59:56.000Z",
|
||||
"modified_on": "2024-10-09T00:59:56.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "Admin",
|
||||
"avatar": "",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/dead-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
65
backend/schema/paths/nginx/proxy-hosts/get.json
Normal file
65
backend/schema/paths/nginx/proxy-hosts/get.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"operationId": "getProxyHosts",
|
||||
"summary": "Get all proxy hosts",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["access_list", "owner", "certificate"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T23:23:03.000Z",
|
||||
"modified_on": "2024-10-08T23:23:04.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_host": "127.0.0.1",
|
||||
"forward_port": 8989,
|
||||
"access_list_id": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"caching_enabled": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"allow_websocket_upgrade": 0,
|
||||
"http2_support": 0,
|
||||
"forward_scheme": "http",
|
||||
"enabled": 1,
|
||||
"locations": null,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/proxy-host-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
39
backend/schema/paths/nginx/proxy-hosts/hostID/delete.json
Normal file
39
backend/schema/paths/nginx/proxy-hosts/hostID/delete.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"operationId": "deleteProxyHost",
|
||||
"summary": "Delete a Proxy Host",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "disableProxyHost",
|
||||
"summary": "Disable a Proxy Host",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "enableProxyHost",
|
||||
"summary": "Enable a Proxy Host",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
64
backend/schema/paths/nginx/proxy-hosts/hostID/get.json
Normal file
64
backend/schema/paths/nginx/proxy-hosts/hostID/get.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"operationId": "getProxyHost",
|
||||
"summary": "Get a Proxy Host",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T23:23:03.000Z",
|
||||
"modified_on": "2024-10-08T23:26:38.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_host": "192.168.0.10",
|
||||
"forward_port": 8989,
|
||||
"access_list_id": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"caching_enabled": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"allow_websocket_upgrade": 0,
|
||||
"http2_support": 0,
|
||||
"forward_scheme": "http",
|
||||
"enabled": 1,
|
||||
"locations": null,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/proxy-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
145
backend/schema/paths/nginx/proxy-hosts/hostID/put.json
Normal file
145
backend/schema/paths/nginx/proxy-hosts/hostID/put.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"operationId": "updateProxyHost",
|
||||
"summary": "Update a Proxy Host",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Proxy Host Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"forward_scheme": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_scheme"
|
||||
},
|
||||
"forward_host": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_host"
|
||||
},
|
||||
"forward_port": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_port"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"block_exploits": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/block_exploits"
|
||||
},
|
||||
"caching_enabled": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/caching_enabled"
|
||||
},
|
||||
"allow_websocket_upgrade": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/allow_websocket_upgrade"
|
||||
},
|
||||
"access_list_id": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/access_list_id"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"enabled": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/enabled"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/meta"
|
||||
},
|
||||
"locations": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/locations"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T23:23:03.000Z",
|
||||
"modified_on": "2024-10-08T23:26:37.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_host": "192.168.0.10",
|
||||
"forward_port": 8989,
|
||||
"access_list_id": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"caching_enabled": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"allow_websocket_upgrade": 0,
|
||||
"http2_support": 0,
|
||||
"forward_scheme": "http",
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-07T22:43:55.000Z",
|
||||
"modified_on": "2024-10-08T12:52:54.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "some guy",
|
||||
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"certificate": null,
|
||||
"access_list": null,
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/proxy-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
130
backend/schema/paths/nginx/proxy-hosts/post.json
Normal file
130
backend/schema/paths/nginx/proxy-hosts/post.json
Normal file
@ -0,0 +1,130 @@
|
||||
{
|
||||
"operationId": "createProxyHost",
|
||||
"summary": "Create a Proxy Host",
|
||||
"tags": ["Proxy Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["proxy_hosts"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Proxy Host Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain_names", "forward_scheme", "forward_host", "forward_port"],
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"forward_scheme": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/forward_scheme"
|
||||
},
|
||||
"forward_host": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/forward_host"
|
||||
},
|
||||
"forward_port": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/forward_port"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"block_exploits": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/block_exploits"
|
||||
},
|
||||
"caching_enabled": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/caching_enabled"
|
||||
},
|
||||
"allow_websocket_upgrade": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/allow_websocket_upgrade"
|
||||
},
|
||||
"access_list_id": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/access_list_id"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"enabled": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/enabled"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/meta"
|
||||
},
|
||||
"locations": {
|
||||
"$ref": "../../../components/proxy-host-object.json#/properties/locations"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T23:23:03.000Z",
|
||||
"modified_on": "2024-10-08T23:23:03.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_host": "127.0.0.1",
|
||||
"forward_port": 8989,
|
||||
"access_list_id": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"caching_enabled": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {},
|
||||
"allow_websocket_upgrade": 0,
|
||||
"http2_support": 0,
|
||||
"forward_scheme": "http",
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"certificate": null,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-07T22:43:55.000Z",
|
||||
"modified_on": "2024-10-08T12:52:54.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "some guy",
|
||||
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"access_list": null,
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/proxy-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
62
backend/schema/paths/nginx/redirection-hosts/get.json
Normal file
62
backend/schema/paths/nginx/redirection-hosts/get.json
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"operationId": "getRedirectionHosts",
|
||||
"summary": "Get all Redirection hosts",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["owner", "certificate"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:13:12.000Z",
|
||||
"modified_on": "2024-10-09T01:13:13.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_domain_name": "something-else.com",
|
||||
"preserve_path": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"forward_scheme": "http",
|
||||
"forward_http_code": 301
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/redirection-host-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
{
|
||||
"operationId": "deleteRedirectionHost",
|
||||
"summary": "Delete a Redirection Host",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "disableRedirectionHost",
|
||||
"summary": "Disable a Redirection Host",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "enableRedirectionHost",
|
||||
"summary": "Enable a Redirection Host",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
61
backend/schema/paths/nginx/redirection-hosts/hostID/get.json
Normal file
61
backend/schema/paths/nginx/redirection-hosts/hostID/get.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"operationId": "getRedirectionHost",
|
||||
"summary": "Get a Redirection Host",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:13:12.000Z",
|
||||
"modified_on": "2024-10-09T01:13:13.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_domain_name": "something-else.com",
|
||||
"preserve_path": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"forward_scheme": "http",
|
||||
"forward_http_code": 301
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/redirection-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
130
backend/schema/paths/nginx/redirection-hosts/hostID/put.json
Normal file
130
backend/schema/paths/nginx/redirection-hosts/hostID/put.json
Normal file
@ -0,0 +1,130 @@
|
||||
{
|
||||
"operationId": "updateRedirectionHost",
|
||||
"summary": "Update a Redirection Host",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "hostID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Redirection Host Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"forward_http_code": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/forward_http_code"
|
||||
},
|
||||
"forward_scheme": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/forward_scheme"
|
||||
},
|
||||
"forward_domain_name": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/forward_domain_name"
|
||||
},
|
||||
"preserve_path": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/preserve_path"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"block_exploits": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/block_exploits"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../../components/redirection-host-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:13:12.000Z",
|
||||
"modified_on": "2024-10-09T01:18:11.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_domain_name": "something-else.com",
|
||||
"preserve_path": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"forward_scheme": "http",
|
||||
"forward_http_code": 301,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T00:59:56.000Z",
|
||||
"modified_on": "2024-10-09T00:59:56.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "Admin",
|
||||
"avatar": "",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"certificate": null,
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/redirection-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
115
backend/schema/paths/nginx/redirection-hosts/post.json
Normal file
115
backend/schema/paths/nginx/redirection-hosts/post.json
Normal file
@ -0,0 +1,115 @@
|
||||
{
|
||||
"operationId": "createRedirectionHost",
|
||||
"summary": "Create a Redirection Host",
|
||||
"tags": ["Redirection Hosts"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["redirection_hosts"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Redirection Host Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["domain_names", "forward_scheme", "forward_http_code", "forward_domain_name"],
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"forward_http_code": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/forward_http_code"
|
||||
},
|
||||
"forward_scheme": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/forward_scheme"
|
||||
},
|
||||
"forward_domain_name": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/forward_domain_name"
|
||||
},
|
||||
"preserve_path": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/preserve_path"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"block_exploits": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/block_exploits"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/redirection-host-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T01:13:12.000Z",
|
||||
"modified_on": "2024-10-09T01:13:12.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_domain_name": "something-else.com",
|
||||
"preserve_path": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {},
|
||||
"http2_support": 0,
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"forward_scheme": "http",
|
||||
"forward_http_code": 301,
|
||||
"certificate": null,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T00:59:56.000Z",
|
||||
"modified_on": "2024-10-09T00:59:56.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "Admin",
|
||||
"avatar": "",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/redirection-host-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
55
backend/schema/paths/nginx/streams/get.json
Normal file
55
backend/schema/paths/nginx/streams/get.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"operationId": "getStreams",
|
||||
"summary": "Get all streams",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["access_list", "owner", "certificate"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T02:33:45.000Z",
|
||||
"modified_on": "2024-10-09T02:33:45.000Z",
|
||||
"owner_user_id": 1,
|
||||
"incoming_port": 9090,
|
||||
"forwarding_host": "router.internal",
|
||||
"forwarding_port": 80,
|
||||
"tcp_forwarding": 0,
|
||||
"udp_forwarding": 0,
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"enabled": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/stream-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
87
backend/schema/paths/nginx/streams/post.json
Normal file
87
backend/schema/paths/nginx/streams/post.json
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"operationId": "createStream",
|
||||
"summary": "Create a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Stream Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["incoming_port", "forwarding_host", "forwarding_port"],
|
||||
"properties": {
|
||||
"incoming_port": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/incoming_port"
|
||||
},
|
||||
"forwarding_host": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/forwarding_host"
|
||||
},
|
||||
"forwarding_port": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/forwarding_port"
|
||||
},
|
||||
"tcp_forwarding": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/tcp_forwarding"
|
||||
},
|
||||
"udp_forwarding": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/udp_forwarding"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T02:33:45.000Z",
|
||||
"modified_on": "2024-10-09T02:33:45.000Z",
|
||||
"owner_user_id": 1,
|
||||
"incoming_port": 9090,
|
||||
"forwarding_host": "router.internal",
|
||||
"forwarding_port": 80,
|
||||
"tcp_forwarding": 0,
|
||||
"udp_forwarding": 0,
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"enabled": 1,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T02:33:16.000Z",
|
||||
"modified_on": "2024-10-09T02:33:16.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "Admin",
|
||||
"avatar": "",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/stream-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
39
backend/schema/paths/nginx/streams/streamID/delete.json
Normal file
39
backend/schema/paths/nginx/streams/streamID/delete.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"operationId": "deleteStream",
|
||||
"summary": "Delete a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "streamID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "disableStream",
|
||||
"summary": "Disable a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "streamID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
59
backend/schema/paths/nginx/streams/streamID/enable/post.json
Normal file
59
backend/schema/paths/nginx/streams/streamID/enable/post.json
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"operationId": "enableStream",
|
||||
"summary": "Enable a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "streamID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "400 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"error": {
|
||||
"code": 400,
|
||||
"message": "Host is already enabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../../components/error-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
54
backend/schema/paths/nginx/streams/streamID/get.json
Normal file
54
backend/schema/paths/nginx/streams/streamID/get.json
Normal file
@ -0,0 +1,54 @@
|
||||
{
|
||||
"operationId": "getStream",
|
||||
"summary": "Get a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "streamID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T02:33:45.000Z",
|
||||
"modified_on": "2024-10-09T02:33:45.000Z",
|
||||
"owner_user_id": 1,
|
||||
"incoming_port": 9090,
|
||||
"forwarding_host": "router.internal",
|
||||
"forwarding_port": 80,
|
||||
"tcp_forwarding": 0,
|
||||
"udp_forwarding": 0,
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"enabled": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/stream-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
145
backend/schema/paths/nginx/streams/streamID/put.json
Normal file
145
backend/schema/paths/nginx/streams/streamID/put.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"operationId": "updateStream",
|
||||
"summary": "Update a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "streamID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Stream Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"domain_names": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/domain_names"
|
||||
},
|
||||
"forward_scheme": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_scheme"
|
||||
},
|
||||
"forward_host": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_host"
|
||||
},
|
||||
"forward_port": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_port"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/http2_support"
|
||||
},
|
||||
"block_exploits": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/block_exploits"
|
||||
},
|
||||
"caching_enabled": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/caching_enabled"
|
||||
},
|
||||
"allow_websocket_upgrade": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/allow_websocket_upgrade"
|
||||
},
|
||||
"access_list_id": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/access_list_id"
|
||||
},
|
||||
"advanced_config": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/advanced_config"
|
||||
},
|
||||
"enabled": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/enabled"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/meta"
|
||||
},
|
||||
"locations": {
|
||||
"$ref": "../../../../components/proxy-host-object.json#/properties/locations"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-08T23:23:03.000Z",
|
||||
"modified_on": "2024-10-08T23:26:37.000Z",
|
||||
"owner_user_id": 1,
|
||||
"domain_names": ["test.example.com"],
|
||||
"forward_host": "192.168.0.10",
|
||||
"forward_port": 8989,
|
||||
"access_list_id": 0,
|
||||
"certificate_id": 0,
|
||||
"ssl_forced": 0,
|
||||
"caching_enabled": 0,
|
||||
"block_exploits": 0,
|
||||
"advanced_config": "",
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"allow_websocket_upgrade": 0,
|
||||
"http2_support": 0,
|
||||
"forward_scheme": "http",
|
||||
"enabled": 1,
|
||||
"hsts_enabled": 0,
|
||||
"hsts_subdomains": 0,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-07T22:43:55.000Z",
|
||||
"modified_on": "2024-10-08T12:52:54.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "some guy",
|
||||
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
|
||||
"roles": ["admin"]
|
||||
},
|
||||
"certificate": null,
|
||||
"access_list": null,
|
||||
"use_default_location": true,
|
||||
"ipv6": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../../components/stream-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
backend/schema/paths/reports/hosts/get.json
Normal file
50
backend/schema/paths/reports/hosts/get.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"operationId": "reportsHosts",
|
||||
"summary": "Report on Host Statistics",
|
||||
"tags": ["Reports"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["reports"]
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"proxy": 20,
|
||||
"redirection": 1,
|
||||
"stream": 0,
|
||||
"dead": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"proxy": {
|
||||
"type": "integer",
|
||||
"description": "Proxy Hosts Count"
|
||||
},
|
||||
"redirection": {
|
||||
"type": "integer",
|
||||
"description": "Redirection Hosts Count"
|
||||
},
|
||||
"stream": {
|
||||
"type": "integer",
|
||||
"description": "Streams Count"
|
||||
},
|
||||
"dead": {
|
||||
"type": "integer",
|
||||
"description": "404 Hosts Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
backend/schema/paths/schema/get.json
Normal file
10
backend/schema/paths/schema/get.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"operationId": "schema",
|
||||
"summary": "Returns this swagger API schema",
|
||||
"tags": ["Public"],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
35
backend/schema/paths/settings/get.json
Normal file
35
backend/schema/paths/settings/get.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"operationId": "getSettings",
|
||||
"summary": "Get all settings",
|
||||
"tags": ["Settings"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["settings"]
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": "default-site",
|
||||
"name": "Default Site",
|
||||
"description": "What to show when Nginx is hit with an unknown Host",
|
||||
"value": "congratulations",
|
||||
"meta": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/setting-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
backend/schema/paths/settings/settingID/get.json
Normal file
46
backend/schema/paths/settings/settingID/get.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"operationId": "getSetting",
|
||||
"summary": "Get a setting",
|
||||
"tags": ["Settings"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["settings"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "settingID",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "Setting ID",
|
||||
"example": "default-site"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": "default-site",
|
||||
"name": "Default Site",
|
||||
"description": "What to show when Nginx is hit with an unknown Host",
|
||||
"value": "congratulations",
|
||||
"meta": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/setting-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
67
backend/schema/paths/settings/settingID/put.json
Normal file
67
backend/schema/paths/settings/settingID/put.json
Normal file
@ -0,0 +1,67 @@
|
||||
{
|
||||
"operationId": "updateSetting",
|
||||
"summary": "Update a setting",
|
||||
"tags": ["Settings"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["settings"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "settingID",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "Setting ID",
|
||||
"example": "default-site"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Setting Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"value": {
|
||||
"$ref": "../../../components/setting-object.json#/properties/value"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/setting-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": "default-site",
|
||||
"name": "Default Site",
|
||||
"description": "What to show when Nginx is hit with an unknown Host",
|
||||
"value": "congratulations",
|
||||
"meta": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/setting-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
30
backend/schema/paths/tokens/get.json
Normal file
30
backend/schema/paths/tokens/get.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"operationId": "refreshToken",
|
||||
"summary": "Refresh your access token",
|
||||
"tags": ["Tokens"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["tokens"]
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"expires": 1566540510,
|
||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/token-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
55
backend/schema/paths/tokens/post.json
Normal file
55
backend/schema/paths/tokens/post.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"operationId": "requestToken",
|
||||
"summary": "Request a new access token from credentials",
|
||||
"tags": ["Tokens"],
|
||||
"requestBody": {
|
||||
"description": "Credentials Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"identity": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"scope": {
|
||||
"minLength": 1,
|
||||
"type": "string",
|
||||
"enum": ["user"]
|
||||
},
|
||||
"secret": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["identity", "secret"],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"result": {
|
||||
"expires": 1566540510,
|
||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/token-object.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "200 response"
|
||||
}
|
||||
}
|
||||
}
|
74
backend/schema/paths/users/get.json
Normal file
74
backend/schema/paths/users/get.json
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"operationId": "getUsers",
|
||||
"summary": "Get all users",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "expand",
|
||||
"description": "Expansions",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": ["permissions"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2020-01-30T09:36:08.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"withPermissions": {
|
||||
"value": [
|
||||
{
|
||||
"id": 1,
|
||||
"created_on": "2020-01-30T09:36:08.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
|
||||
"roles": ["admin"],
|
||||
"permissions": {
|
||||
"visibility": "all",
|
||||
"proxy_hosts": "manage",
|
||||
"redirection_hosts": "manage",
|
||||
"dead_hosts": "manage",
|
||||
"streams": "manage",
|
||||
"access_lists": "manage",
|
||||
"certificates": "manage"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/user-list.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
88
backend/schema/paths/users/post.json
Normal file
88
backend/schema/paths/users/post.json
Normal file
@ -0,0 +1,88 @@
|
||||
{
|
||||
"operationId": "createUser",
|
||||
"summary": "Create a User",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "User Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "nickname", "email"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"$ref": "../../components/user-object.json#/properties/name"
|
||||
},
|
||||
"nickname": {
|
||||
"$ref": "../../components/user-object.json#/properties/nickname"
|
||||
},
|
||||
"email": {
|
||||
"$ref": "../../components/user-object.json#/properties/email"
|
||||
},
|
||||
"roles": {
|
||||
"$ref": "../../components/user-object.json#/properties/roles"
|
||||
},
|
||||
"is_disabled": {
|
||||
"$ref": "../../components/user-object.json#/properties/is_disabled"
|
||||
},
|
||||
"auth": {
|
||||
"type": "object",
|
||||
"description": "Auth Credentials",
|
||||
"example": {
|
||||
"type": "password",
|
||||
"secret": "bigredhorsebanana"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 2,
|
||||
"created_on": "2020-01-30T09:41:04.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
|
||||
"roles": ["admin"],
|
||||
"permissions": {
|
||||
"id": 3,
|
||||
"created_on": "2020-01-30T09:41:04.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"user_id": 2,
|
||||
"visibility": "user",
|
||||
"proxy_hosts": "manage",
|
||||
"redirection_hosts": "manage",
|
||||
"dead_hosts": "manage",
|
||||
"streams": "manage",
|
||||
"access_lists": "manage",
|
||||
"certificates": "manage"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../components/user-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
79
backend/schema/paths/users/userID/auth/put.json
Normal file
79
backend/schema/paths/users/userID/auth/put.json
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"operationId": "updateUserAuth",
|
||||
"summary": "Update a User's Authentication",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^me$"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID or 'me' for yourself",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Auth Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["type", "secret"],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"pattern": "^password$",
|
||||
"example": "password"
|
||||
},
|
||||
"current": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 64,
|
||||
"example": "changeme"
|
||||
},
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"minLength": 8,
|
||||
"maxLength": 64,
|
||||
"example": "mySuperN3wP@ssword!"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
40
backend/schema/paths/users/userID/delete.json
Normal file
40
backend/schema/paths/users/userID/delete.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"operationId": "deleteUser",
|
||||
"summary": "Delete a User",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
58
backend/schema/paths/users/userID/get.json
Normal file
58
backend/schema/paths/users/userID/get.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"operationId": "getUser",
|
||||
"summary": "Get a user",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^me$"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID or 'me' for yourself",
|
||||
"example": 1
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2020-01-30T09:36:08.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/user-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
73
backend/schema/paths/users/userID/login/post.json
Normal file
73
backend/schema/paths/users/userID/login/post.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"operationId": "loginAsUser",
|
||||
"summary": "Login as this user",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"token": "eyJhbGciOiJSUzI1NiIsInR...16OjT8B3NLyXg",
|
||||
"expires": "2020-01-31T10:56:23.239Z",
|
||||
"user": {
|
||||
"id": 1,
|
||||
"created_on": "2020-01-30T10:43:44.000Z",
|
||||
"modified_on": "2020-01-30T10:43:44.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/3c8d73f45fd8763f827b964c76e6032a?default=mm",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"description": "Login object",
|
||||
"required": ["expires", "token", "user"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"expires": {
|
||||
"description": "Token Expiry Unix Time",
|
||||
"example": 1566540249,
|
||||
"minimum": 1,
|
||||
"type": "number"
|
||||
},
|
||||
"token": {
|
||||
"description": "JWT Token",
|
||||
"example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
|
||||
"type": "string"
|
||||
},
|
||||
"user": {
|
||||
"$ref": "../../../../components/user-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
51
backend/schema/paths/users/userID/permissions/put.json
Normal file
51
backend/schema/paths/users/userID/permissions/put.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"operationId": "updateUserPermissions",
|
||||
"summary": "Update a User's Permissions",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Permissions Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "../../../../components/permission-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
88
backend/schema/paths/users/userID/put.json
Normal file
88
backend/schema/paths/users/userID/put.json
Normal file
@ -0,0 +1,88 @@
|
||||
{
|
||||
"operationId": "updateUser",
|
||||
"summary": "Update a User",
|
||||
"tags": ["Users"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["users"]
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "userID",
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^me$"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"required": true,
|
||||
"description": "User ID or 'me' for yourself",
|
||||
"example": 2
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "User Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"properties": {
|
||||
"name": {
|
||||
"$ref": "../../../components/user-object.json#/properties/name"
|
||||
},
|
||||
"nickname": {
|
||||
"$ref": "../../../components/user-object.json#/properties/nickname"
|
||||
},
|
||||
"email": {
|
||||
"$ref": "../../../components/user-object.json#/properties/email"
|
||||
},
|
||||
"roles": {
|
||||
"$ref": "../../../components/user-object.json#/properties/roles"
|
||||
},
|
||||
"is_disabled": {
|
||||
"$ref": "../../../components/user-object.json#/properties/is_disabled"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "200 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 2,
|
||||
"created_on": "2020-01-30T09:36:08.000Z",
|
||||
"modified_on": "2020-01-30T09:41:04.000Z",
|
||||
"is_disabled": 0,
|
||||
"email": "jc@jc21.com",
|
||||
"name": "Jamie Curnow",
|
||||
"nickname": "James",
|
||||
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/user-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user