From 74b4950e12df035c78245f184975dd25a7df9fd6 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:45:27 +0100 Subject: [PATCH 01/14] fix: Set certificate files format to binary --- backend/schema/common.json | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/backend/schema/common.json b/backend/schema/common.json index 00b06e005f..2305ca741e 100644 --- a/backend/schema/common.json +++ b/backend/schema/common.json @@ -16,6 +16,7 @@ "type": "null" }, { + "type": "array", "type": "array", "minItems": 1, "items": { @@ -86,7 +87,10 @@ "type": "string", "pattern": "^[^&| @!#%^();:/\\\\}{=+?<>,~`'\"]+$" }, - "example": ["example.com", "www.example.com"] + "example": [ + "example.com", + "www.example.com" + ] }, "enabled": { "description": "Is Enabled", @@ -136,7 +140,10 @@ }, "directive": { "type": "string", - "enum": ["allow", "deny"], + "enum": [ + "allow", + "deny" + ], "example": "allow" }, "address": { @@ -214,18 +221,24 @@ "schema": { "type": "object", "additionalProperties": false, - "required": ["certificate", "certificate_key"], + "required": [ + "certificate", + "certificate_key" + ], "properties": { "certificate": { "type": "string", + "format": "binary", "example": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----" }, "certificate_key": { "type": "string", + "format": "binary", "example": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----" }, "intermediate_certificate": { "type": "string", + "format": "binary", "example": "-----BEGIN CERTIFICATE-----\nMIID...-----END CERTIFICATE-----" } } From 8f7dc2cfe091ab1ca65f034233070cfa041d453e Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:46:30 +0100 Subject: [PATCH 02/14] fix: Expand user permissions --- backend/schema/paths/users/userID/get.json | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/backend/schema/paths/users/userID/get.json b/backend/schema/paths/users/userID/get.json index 2cf5587d9f..e002c9084e 100644 --- a/backend/schema/paths/users/userID/get.json +++ b/backend/schema/paths/users/userID/get.json @@ -1,10 +1,14 @@ { "operationId": "getUser", "summary": "Get a user", - "tags": ["users"], + "tags": [ + "users" + ], "security": [ { - "bearerAuth": ["admin"] + "bearerAuth": [ + "admin" + ] } ], "parameters": [ @@ -26,6 +30,17 @@ "required": true, "description": "User ID or 'me' for yourself", "example": 1 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "permissions" + ] + } } ], "responses": { @@ -44,7 +59,9 @@ "name": "Jamie Curnow", "nickname": "James", "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm", - "roles": ["admin"] + "roles": [ + "admin" + ] } } }, From 13fa25979aa28223bceae7d7bbe91f74fd073195 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:46:48 +0100 Subject: [PATCH 03/14] fix: Expand access list owner, items, clients and proxy hosts --- .../paths/nginx/access-lists/listID/get.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/schema/paths/nginx/access-lists/listID/get.json b/backend/schema/paths/nginx/access-lists/listID/get.json index 9705826f20..8224dc9cef 100644 --- a/backend/schema/paths/nginx/access-lists/listID/get.json +++ b/backend/schema/paths/nginx/access-lists/listID/get.json @@ -22,6 +22,20 @@ }, "required": true, "example": 1 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "owner", + "items", + "clients", + "proxy_hosts" + ] + } } ], "responses": { From 5163bac5a052ce418620904e31b8d71231bd4c31 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:50:03 +0100 Subject: [PATCH 04/14] fix: Access list object owner, items and clients --- .../schema/components/access-list-list.json | 7 ++ .../schema/components/access-list-object.json | 99 ++++++++++++++++++- 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 backend/schema/components/access-list-list.json diff --git a/backend/schema/components/access-list-list.json b/backend/schema/components/access-list-list.json new file mode 100644 index 0000000000..69104320bb --- /dev/null +++ b/backend/schema/components/access-list-list.json @@ -0,0 +1,7 @@ +{ + "type": "array", + "description": "Access list list", + "items": { + "$ref": "./access-list-object.json" + } +} diff --git a/backend/schema/components/access-list-object.json b/backend/schema/components/access-list-object.json index d80eb06d8f..1d9cba93c2 100644 --- a/backend/schema/components/access-list-object.json +++ b/backend/schema/components/access-list-object.json @@ -1,7 +1,17 @@ { "type": "object", "description": "Access List object", - "required": ["id", "created_on", "modified_on", "owner_user_id", "name", "meta", "satisfy_any", "pass_auth", "proxy_host_count"], + "required": [ + "id", + "created_on", + "modified_on", + "owner_user_id", + "name", + "meta", + "satisfy_any", + "pass_auth", + "proxy_host_count" + ], "properties": { "id": { "$ref": "../common.json#/properties/id" @@ -36,6 +46,93 @@ "type": "integer", "minimum": 0, "example": 3 + }, + "owner": { + "$ref": "./user-object.json" + }, + "items": { + "type": "array", + "minItems": 0, + "items": { + "type": "object", + "required": [ + "id", + "created_on", + "modified_on", + "access_list_id", + "username", + "password", + "hint", + "meta" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "../common.json#/properties/id" + }, + "created_on": { + "$ref": "../common.json#/properties/created_on" + }, + "modified_on": { + "$ref": "../common.json#/properties/modified_on" + }, + "access_list_id": { + "$ref": "../common.json#/properties/access_list_id" + }, + "username": { + "$ref": "../common.json#/properties/authorization_username" + }, + "password": { + "$ref": "../common.json#/properties/authorization_password" + }, + "hint": { + "$ref": "../common.json#/properties/authorization_hint" + }, + "meta": { + "type": "object" + } + } + } + }, + "clients": { + "type": "array", + "minItems": 0, + "items": { + "type": "object", + "required": [ + "id", + "created_on", + "modified_on", + "access_list_id", + "address", + "directive", + "meta" + ], + "additionalProperties": false, + "properties": { + "id": { + "$ref": "../common.json#/properties/id" + }, + "created_on": { + "$ref": "../common.json#/properties/created_on" + }, + "modified_on": { + "$ref": "../common.json#/properties/modified_on" + }, + "access_list_id": { + "$ref": "../common.json#/properties/access_list_id" + }, + "address": { + "$ref": "../common.json#/properties/access_address" + }, + "directive": { + "$ref": "../common.json#/properties/access_directive" + }, + "meta": { + "type": "object" + } + } + } } } } From e9fe767ada22c7100941b2c919af2907947f0adc Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:50:44 +0100 Subject: [PATCH 05/14] fix: Permission object required fields --- .../schema/components/permission-object.json | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/backend/schema/components/permission-object.json b/backend/schema/components/permission-object.json index cae9d26c02..c627500989 100644 --- a/backend/schema/components/permission-object.json +++ b/backend/schema/components/permission-object.json @@ -1,47 +1,83 @@ { "type": "object", - "minProperties": 1, + "required": [ + "visibility", + "access_lists", + "dead_hosts", + "proxy_hosts", + "redirection_hosts", + "streams", + "certificates" + ], + "additionalProperties": false, "properties": { "visibility": { "type": "string", "description": "Visibility Type", - "enum": ["all", "user"], + "enum": [ + "all", + "user" + ], "example": "all" }, "access_lists": { "type": "string", "description": "Access Lists Permissions", - "enum": ["hidden", "view", "manage"], + "enum": [ + "hidden", + "view", + "manage" + ], "example": "view" }, "dead_hosts": { "type": "string", "description": "404 Hosts Permissions", - "enum": ["hidden", "view", "manage"], + "enum": [ + "hidden", + "view", + "manage" + ], "example": "manage" }, "proxy_hosts": { "type": "string", "description": "Proxy Hosts Permissions", - "enum": ["hidden", "view", "manage"], + "enum": [ + "hidden", + "view", + "manage" + ], "example": "hidden" }, "redirection_hosts": { "type": "string", "description": "Redirection Permissions", - "enum": ["hidden", "view", "manage"], + "enum": [ + "hidden", + "view", + "manage" + ], "example": "view" }, "streams": { "type": "string", "description": "Streams Permissions", - "enum": ["hidden", "view", "manage"], + "enum": [ + "hidden", + "view", + "manage" + ], "example": "manage" }, "certificates": { "type": "string", "description": "Certificates Permissions", - "enum": ["hidden", "view", "manage"], + "enum": [ + "hidden", + "view", + "manage" + ], "example": "hidden" } } From 4b11ef8ac41df52ac5fb47bb8734c60dd7df4469 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:53:54 +0100 Subject: [PATCH 06/14] fix: User permissions object ref --- backend/schema/components/user-object.json | 56 +--------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/backend/schema/components/user-object.json b/backend/schema/components/user-object.json index 7acd0a4290..b578662393 100644 --- a/backend/schema/components/user-object.json +++ b/backend/schema/components/user-object.json @@ -56,61 +56,7 @@ } }, "permissions": { - "type": "object", - "description": "Permissions if expanded in request", - "required": [ - "visibility", - "proxy_hosts", - "redirection_hosts", - "dead_hosts", - "streams", - "access_lists", - "certificates" - ], - "properties": { - "visibility": { - "type": "string", - "description": "Visibility level", - "example": "all", - "pattern": "^(all|user)$" - }, - "proxy_hosts": { - "type": "string", - "description": "Proxy Hosts access level", - "example": "manage", - "pattern": "^(manage|view|hidden)$" - }, - "redirection_hosts": { - "type": "string", - "description": "Redirection Hosts access level", - "example": "manage", - "pattern": "^(manage|view|hidden)$" - }, - "dead_hosts": { - "type": "string", - "description": "Dead Hosts access level", - "example": "manage", - "pattern": "^(manage|view|hidden)$" - }, - "streams": { - "type": "string", - "description": "Streams access level", - "example": "manage", - "pattern": "^(manage|view|hidden)$" - }, - "access_lists": { - "type": "string", - "description": "Access Lists access level", - "example": "hidden", - "pattern": "^(manage|view|hidden)$" - }, - "certificates": { - "type": "string", - "description": "Certificates access level", - "example": "view", - "pattern": "^(manage|view|hidden)$" - } - } + "$ref": "./permission-object.json" } } } From 3bbb6dab0172b75b6d85ed4e64192fee31ad77f9 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 10:54:05 +0100 Subject: [PATCH 07/14] fix: User common refs --- backend/schema/components/user-object.json | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/backend/schema/components/user-object.json b/backend/schema/components/user-object.json index b578662393..c2725c32ef 100644 --- a/backend/schema/components/user-object.json +++ b/backend/schema/components/user-object.json @@ -1,24 +1,27 @@ { "type": "object", "description": "User object", - "required": ["id", "created_on", "modified_on", "is_disabled", "email", "name", "nickname", "avatar", "roles"], + "required": [ + "id", + "created_on", + "modified_on", + "is_disabled", + "email", + "name", + "nickname", + "avatar", + "roles" + ], "additionalProperties": false, "properties": { "id": { - "type": "integer", - "description": "User ID", - "minimum": 1, - "example": 1 + "$ref": "../common.json#/properties/user_id" }, "created_on": { - "type": "string", - "description": "Created Date", - "example": "2020-01-30T09:36:08.000Z" + "$ref": "../common.json#/properties/created_on" }, "modified_on": { - "type": "string", - "description": "Modified Date", - "example": "2020-01-30T09:41:04.000Z" + "$ref": "../common.json#/properties/modified_on" }, "is_disabled": { "type": "boolean", @@ -26,10 +29,7 @@ "example": true }, "email": { - "type": "string", - "description": "Email", - "minLength": 3, - "example": "jc@jc21.com" + "$ref": "../common.json#/properties/email" }, "name": { "type": "string", @@ -49,7 +49,9 @@ }, "roles": { "description": "Roles applied", - "example": ["admin"], + "example": [ + "admin" + ], "type": "array", "items": { "type": "string" From 9ac10422e1e084871dc53ffa44aa323c5e30f3c2 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 11:10:04 +0100 Subject: [PATCH 08/14] fix: Add missing expands --- .../paths/nginx/certificates/certID/get.json | 23 +++++++++++++++--- .../paths/nginx/dead-hosts/hostID/get.json | 24 ++++++++++++++++--- .../paths/nginx/proxy-hosts/hostID/get.json | 17 ++++++++++++- .../nginx/redirection-hosts/hostID/get.json | 24 ++++++++++++++++--- .../paths/nginx/streams/streamID/get.json | 20 ++++++++++++++-- 5 files changed, 96 insertions(+), 12 deletions(-) diff --git a/backend/schema/paths/nginx/certificates/certID/get.json b/backend/schema/paths/nginx/certificates/certID/get.json index 46afbf8753..f47bf5ee57 100644 --- a/backend/schema/paths/nginx/certificates/certID/get.json +++ b/backend/schema/paths/nginx/certificates/certID/get.json @@ -1,10 +1,14 @@ { "operationId": "getCertificate", "summary": "Get a Certificate", - "tags": ["certificates"], + "tags": [ + "certificates" + ], "security": [ { - "bearerAuth": ["certificates.view"] + "bearerAuth": [ + "certificates.view" + ] } ], "parameters": [ @@ -18,6 +22,17 @@ }, "required": true, "example": 1 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "owner" + ] + } } ], "responses": { @@ -34,7 +49,9 @@ "owner_user_id": 1, "provider": "letsencrypt", "nice_name": "test.example.com", - "domain_names": ["test.example.com"], + "domain_names": [ + "test.example.com" + ], "expires_on": "2025-01-07T04:34:18.000Z", "meta": { "dns_challenge": false diff --git a/backend/schema/paths/nginx/dead-hosts/hostID/get.json b/backend/schema/paths/nginx/dead-hosts/hostID/get.json index a3c24edc34..4b39a9e8ee 100644 --- a/backend/schema/paths/nginx/dead-hosts/hostID/get.json +++ b/backend/schema/paths/nginx/dead-hosts/hostID/get.json @@ -1,10 +1,14 @@ { "operationId": "getDeadHost", "summary": "Get a 404 Host", - "tags": ["404-hosts"], + "tags": [ + "404-hosts" + ], "security": [ { - "bearerAuth": ["dead_hosts.view"] + "bearerAuth": [ + "dead_hosts.view" + ] } ], "parameters": [ @@ -18,6 +22,18 @@ }, "required": true, "example": 1 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "owner", + "certificate" + ] + } } ], "responses": { @@ -32,7 +48,9 @@ "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"], + "domain_names": [ + "test.example.com" + ], "certificate_id": 0, "ssl_forced": false, "advanced_config": "", diff --git a/backend/schema/paths/nginx/proxy-hosts/hostID/get.json b/backend/schema/paths/nginx/proxy-hosts/hostID/get.json index 351451c4f6..9e74c33b4a 100644 --- a/backend/schema/paths/nginx/proxy-hosts/hostID/get.json +++ b/backend/schema/paths/nginx/proxy-hosts/hostID/get.json @@ -1,7 +1,9 @@ { "operationId": "getProxyHost", "summary": "Get a Proxy Host", - "tags": ["proxy-hosts"], + "tags": [ + "proxy-hosts" + ], "security": [ { "bearerAuth": [ @@ -20,6 +22,19 @@ }, "required": true, "example": 1 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "access_list", + "owner", + "certificate" + ] + } } ], "responses": { diff --git a/backend/schema/paths/nginx/redirection-hosts/hostID/get.json b/backend/schema/paths/nginx/redirection-hosts/hostID/get.json index 577b5144a9..85609b7ffb 100644 --- a/backend/schema/paths/nginx/redirection-hosts/hostID/get.json +++ b/backend/schema/paths/nginx/redirection-hosts/hostID/get.json @@ -1,10 +1,14 @@ { "operationId": "getRedirectionHost", "summary": "Get a Redirection Host", - "tags": ["redirection-hosts"], + "tags": [ + "redirection-hosts" + ], "security": [ { - "bearerAuth": ["redirection_hosts.view"] + "bearerAuth": [ + "redirection_hosts.view" + ] } ], "parameters": [ @@ -18,6 +22,18 @@ }, "required": true, "example": 1 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "owner", + "certificate" + ] + } } ], "responses": { @@ -32,7 +48,9 @@ "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"], + "domain_names": [ + "test.example.com" + ], "forward_domain_name": "something-else.com", "preserve_path": false, "certificate_id": 0, diff --git a/backend/schema/paths/nginx/streams/streamID/get.json b/backend/schema/paths/nginx/streams/streamID/get.json index 22fae8872b..3f9d3bac8f 100644 --- a/backend/schema/paths/nginx/streams/streamID/get.json +++ b/backend/schema/paths/nginx/streams/streamID/get.json @@ -1,10 +1,14 @@ { "operationId": "getStream", "summary": "Get a Stream", - "tags": ["streams"], + "tags": [ + "streams" + ], "security": [ { - "bearerAuth": ["streams.view"] + "bearerAuth": [ + "streams.view" + ] } ], "parameters": [ @@ -18,6 +22,18 @@ }, "required": true, "example": 2 + }, + { + "in": "query", + "name": "expand", + "description": "Expansions", + "schema": { + "type": "string", + "enum": [ + "owner", + "certificate" + ] + } } ], "responses": { From 1aadeab3ea4c726c1911ba02b8c8aff7b084fe16 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 11:10:45 +0100 Subject: [PATCH 09/14] fix: authorization username and password --- backend/schema/common.json | 31 +++++++++++++++++-- .../schema/components/access-list-object.json | 2 +- .../schema/paths/nginx/access-lists/get.json | 30 ++++++++++-------- .../paths/nginx/access-lists/listID/put.json | 12 +++++-- 4 files changed, 55 insertions(+), 20 deletions(-) diff --git a/backend/schema/common.json b/backend/schema/common.json index 2305ca741e..87d754a282 100644 --- a/backend/schema/common.json +++ b/backend/schema/common.json @@ -37,6 +37,32 @@ } ] }, + "access_directive": { + "description": "Access Directive", + "type": "string", + "enum": [ + "allow", + "deny" + ], + "example": "allow" + }, + "authorization_username": { + "description": "Username", + "type": "string", + "minLength": 1, + "example": "admin" + }, + "authorization_password": { + "description": "Password", + "type": "string", + "example": "pass" + }, + "authorization_hint": { + "description": "Password Hint", + "type": "string", + "minLength": 1, + "example": "p***" + }, "created_on": { "description": "Date and time of creation", "readOnly": true, @@ -170,11 +196,10 @@ "additionalProperties": false, "properties": { "username": { - "type": "string", - "minLength": 1 + "$ref": "#/properties/authorization_username" }, "password": { - "type": "string" + "$ref": "#/properties/authorization_password" } }, "example": { diff --git a/backend/schema/components/access-list-object.json b/backend/schema/components/access-list-object.json index 1d9cba93c2..5b4e0e8d69 100644 --- a/backend/schema/components/access-list-object.json +++ b/backend/schema/components/access-list-object.json @@ -123,7 +123,7 @@ "$ref": "../common.json#/properties/access_list_id" }, "address": { - "$ref": "../common.json#/properties/access_address" + "$ref": "../common.json#/properties/address" }, "directive": { "$ref": "../common.json#/properties/access_directive" diff --git a/backend/schema/paths/nginx/access-lists/get.json b/backend/schema/paths/nginx/access-lists/get.json index ada40f5bf7..05c7fc5938 100644 --- a/backend/schema/paths/nginx/access-lists/get.json +++ b/backend/schema/paths/nginx/access-lists/get.json @@ -1,7 +1,9 @@ { "operationId": "getAccessLists", "summary": "Get all access lists", - "tags": ["access-lists"], + "tags": [ + "access-lists" + ], "security": [ { "bearerAuth": [ @@ -30,19 +32,21 @@ "description": "200 response", "content": { "application/json": { - "example": { - "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": true, - "pass_auth": false, - "proxy_host_count": 0 - }, + "example": [ + { + "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": true, + "pass_auth": false, + "proxy_host_count": 0 + } + ], "schema": { - "$ref": "../../../components/access-list-object.json" + "$ref": "../../../components/access-list-list.json" } } } diff --git a/backend/schema/paths/nginx/access-lists/listID/put.json b/backend/schema/paths/nginx/access-lists/listID/put.json index 61e8044013..0d7830cd6d 100644 --- a/backend/schema/paths/nginx/access-lists/listID/put.json +++ b/backend/schema/paths/nginx/access-lists/listID/put.json @@ -1,10 +1,14 @@ { "operationId": "updateAccessList", "summary": "Update a Access List", - "tags": ["access-lists"], + "tags": [ + "access-lists" + ], "security": [ { - "bearerAuth": ["access_lists.manage"] + "bearerAuth": [ + "access_lists.manage" + ] } ], "parameters": [ @@ -93,7 +97,9 @@ "name": "Administrator", "nickname": "some guy", "avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm", - "roles": ["admin"] + "roles": [ + "admin" + ] }, "items": [ { From 061c354ca3040e644c748eb44f5a223a131f271e Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 11:21:53 +0100 Subject: [PATCH 10/14] fix: Common meta object --- backend/schema/common.json | 5 +++++ .../schema/components/access-list-object.json | 7 +++---- .../schema/components/audit-log-object.json | 3 +-- .../schema/components/dead-host-object.json | 19 ++++++++++++++++--- backend/schema/components/stream-object.json | 3 +-- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/backend/schema/common.json b/backend/schema/common.json index 87d754a282..1d329838eb 100644 --- a/backend/schema/common.json +++ b/backend/schema/common.json @@ -274,6 +274,11 @@ } } } + }, + "meta": { + "description": "Meta Information", + "type": "object", + "example": {} } } } diff --git a/backend/schema/components/access-list-object.json b/backend/schema/components/access-list-object.json index 5b4e0e8d69..a366eab5b0 100644 --- a/backend/schema/components/access-list-object.json +++ b/backend/schema/components/access-list-object.json @@ -31,8 +31,7 @@ "example": "My Access List" }, "meta": { - "type": "object", - "example": {} + "$ref": "../common.json#/properties/meta" }, "satisfy_any": { "type": "boolean", @@ -89,7 +88,7 @@ "$ref": "../common.json#/properties/authorization_hint" }, "meta": { - "type": "object" + "$ref": "../common.json#/properties/meta" } } } @@ -129,7 +128,7 @@ "$ref": "../common.json#/properties/access_directive" }, "meta": { - "type": "object" + "$ref": "../common.json#/properties/meta" } } } diff --git a/backend/schema/components/audit-log-object.json b/backend/schema/components/audit-log-object.json index 307cac8227..c8747e7b50 100644 --- a/backend/schema/components/audit-log-object.json +++ b/backend/schema/components/audit-log-object.json @@ -37,8 +37,7 @@ "example": "created" }, "meta": { - "type": "object", - "example": {} + "$ref": "../common.json#/properties/meta" }, "user": { "$ref": "./user-object.json" diff --git a/backend/schema/components/dead-host-object.json b/backend/schema/components/dead-host-object.json index b876ebf0a8..036fecdd32 100644 --- a/backend/schema/components/dead-host-object.json +++ b/backend/schema/components/dead-host-object.json @@ -1,7 +1,21 @@ { "type": "object", "description": "404 Host object", - "required": ["id", "created_on", "modified_on", "owner_user_id", "domain_names", "certificate_id", "ssl_forced", "hsts_enabled", "hsts_subdomains", "http2_support", "advanced_config", "enabled", "meta"], + "required": [ + "id", + "created_on", + "modified_on", + "owner_user_id", + "domain_names", + "certificate_id", + "ssl_forced", + "hsts_enabled", + "hsts_subdomains", + "http2_support", + "advanced_config", + "enabled", + "meta" + ], "additionalProperties": false, "properties": { "id": { @@ -42,8 +56,7 @@ "$ref": "../common.json#/properties/enabled" }, "meta": { - "type": "object", - "example": {} + "$ref": "../common.json#/properties/meta" }, "certificate": { "oneOf": [ diff --git a/backend/schema/components/stream-object.json b/backend/schema/components/stream-object.json index 602073ceca..514859c8ca 100644 --- a/backend/schema/components/stream-object.json +++ b/backend/schema/components/stream-object.json @@ -74,8 +74,7 @@ "$ref": "../common.json#/properties/certificate_id" }, "meta": { - "type": "object", - "example": {} + "$ref": "../common.json#/properties/meta" }, "certificate": { "oneOf": [ From 3a62b3b6ff9fb6dee078ce5c5f75039310fa2d93 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 12:04:43 +0100 Subject: [PATCH 11/14] fix: Add missing examples --- .../schema/paths/nginx/access-lists/get.json | 49 ++++++++++++++++++- .../paths/nginx/access-lists/listID/get.json | 49 ++++++++++++++++++- 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/backend/schema/paths/nginx/access-lists/get.json b/backend/schema/paths/nginx/access-lists/get.json index 05c7fc5938..05ec361d42 100644 --- a/backend/schema/paths/nginx/access-lists/get.json +++ b/backend/schema/paths/nginx/access-lists/get.json @@ -42,7 +42,54 @@ "meta": {}, "satisfy_any": true, "pass_auth": false, - "proxy_host_count": 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_disabled": false, + "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": { diff --git a/backend/schema/paths/nginx/access-lists/listID/get.json b/backend/schema/paths/nginx/access-lists/listID/get.json index 8224dc9cef..78786e4a12 100644 --- a/backend/schema/paths/nginx/access-lists/listID/get.json +++ b/backend/schema/paths/nginx/access-lists/listID/get.json @@ -54,7 +54,54 @@ "meta": {}, "satisfy_any": false, "pass_auth": false, - "proxy_host_count": 1 + "proxy_host_count": 1, + "owner": { + "id": 1, + "created_on": "2024-10-07T22:43:55.000Z", + "modified_on": "2024-10-08T12:52:54.000Z", + "is_disabled": false, + "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": [] } } }, From e3860cbc50c60b77da5de44cc6dce7c6ee04d553 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Sat, 29 Nov 2025 12:17:07 +0100 Subject: [PATCH 12/14] fix: Add missing examples --- .../schema/components/access-list-object.json | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/backend/schema/components/access-list-object.json b/backend/schema/components/access-list-object.json index a366eab5b0..b418197ad9 100644 --- a/backend/schema/components/access-list-object.json +++ b/backend/schema/components/access-list-object.json @@ -91,7 +91,19 @@ "$ref": "../common.json#/properties/meta" } } - } + }, + "example": [ + { + "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": "", + "hint": "a****", + "meta": {} + } + ] }, "clients": { "type": "array", @@ -131,7 +143,18 @@ "$ref": "../common.json#/properties/meta" } } - } + }, + "example": [ + { + "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": {} + } + ] } } } From f13759125c5d8be347802d2425487c4da437ad12 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Fri, 5 Dec 2025 22:21:23 +0100 Subject: [PATCH 13/14] fix: Remove properties from permissions object --- backend/schema/paths/users/post.json | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/backend/schema/paths/users/post.json b/backend/schema/paths/users/post.json index 49025e3250..3feb9bf0af 100644 --- a/backend/schema/paths/users/post.json +++ b/backend/schema/paths/users/post.json @@ -1,10 +1,14 @@ { "operationId": "createUser", "summary": "Create a User", - "tags": ["users"], + "tags": [ + "users" + ], "security": [ { - "bearerAuth": ["admin"] + "bearerAuth": [ + "admin" + ] } ], "requestBody": { @@ -15,7 +19,11 @@ "schema": { "type": "object", "additionalProperties": false, - "required": ["name", "nickname", "email"], + "required": [ + "name", + "nickname", + "email" + ], "properties": { "name": { "$ref": "../../components/user-object.json#/properties/name" @@ -61,12 +69,10 @@ "name": "Jamie Curnow", "nickname": "James", "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm", - "roles": ["admin"], + "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", From f569e1e59923c5815c7d43a896ab3fdfb31d6e49 Mon Sep 17 00:00:00 2001 From: Sander Jochems Date: Fri, 5 Dec 2025 22:27:15 +0100 Subject: [PATCH 14/14] fix: Remove duplicate line --- backend/schema/common.json | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/schema/common.json b/backend/schema/common.json index 1d329838eb..70bd9f84c2 100644 --- a/backend/schema/common.json +++ b/backend/schema/common.json @@ -16,7 +16,6 @@ "type": "null" }, { - "type": "array", "type": "array", "minItems": 1, "items": {