Skip to content

Commit 68b2393

Browse files
committed
Fix custom cert writes, fix schema
1 parent 2b88f56 commit 68b2393

File tree

7 files changed

+103
-6
lines changed

7 files changed

+103
-6
lines changed

backend/internal/certificate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ const internalCertificate = {
584584
}
585585
});
586586

587-
const certificate = internalCertificate.update(access, {
587+
const certificate = await internalCertificate.update(access, {
588588
id: data.id,
589589
expires_on: moment(validations.certificate.dates.to, "X").format("YYYY-MM-DD HH:mm:ss"),
590590
domain_names: [validations.certificate.cn],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "array",
3+
"description": "Audit Log list",
4+
"items": {
5+
"$ref": "./audit-log-object.json"
6+
}
7+
}

backend/schema/components/audit-log-object.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
{
22
"type": "object",
33
"description": "Audit Log object",
4-
"required": ["id", "created_on", "modified_on", "user_id", "object_type", "object_id", "action", "meta"],
4+
"required": [
5+
"id",
6+
"created_on",
7+
"modified_on",
8+
"user_id",
9+
"object_type",
10+
"object_id",
11+
"action",
12+
"meta"
13+
],
514
"additionalProperties": false,
615
"properties": {
716
"id": {
@@ -27,6 +36,9 @@
2736
},
2837
"meta": {
2938
"type": "object"
39+
},
40+
"user": {
41+
"$ref": "./user-object.json"
3042
}
3143
}
3244
}

backend/schema/components/stream-object.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"type": "string",
34-
"format": "ipv4"
34+
"format": "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$"
3535
},
3636
{
3737
"type": "string",

backend/schema/paths/audit-log/get.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"operationId": "getAuditLog",
3-
"summary": "Get Audit Log",
2+
"operationId": "getAuditLogs",
3+
"summary": "Get Audit Logs",
44
"tags": ["Audit Log"],
55
"security": [
66
{
@@ -44,7 +44,7 @@
4444
}
4545
},
4646
"schema": {
47-
"$ref": "../../components/audit-log-object.json"
47+
"$ref": "../../components/audit-log-list.json"
4848
}
4949
}
5050
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"operationId": "getAuditLog",
3+
"summary": "Get Audit Log Event",
4+
"tags": [
5+
"Audit Log"
6+
],
7+
"security": [
8+
{
9+
"BearerAuth": [
10+
"audit-log"
11+
]
12+
}
13+
],
14+
"parameters": [
15+
{
16+
"in": "path",
17+
"name": "id",
18+
"schema": {
19+
"type": "integer",
20+
"minimum": 1
21+
},
22+
"required": true,
23+
"example": 1
24+
}
25+
],
26+
"responses": {
27+
"200": {
28+
"description": "200 response",
29+
"content": {
30+
"application/json": {
31+
"examples": {
32+
"default": {
33+
"value": {
34+
"id": 1,
35+
"created_on": "2025-09-15T17:27:45.000Z",
36+
"modified_on": "2025-09-15T17:27:45.000Z",
37+
"user_id": 1,
38+
"object_type": "user",
39+
"object_id": 1,
40+
"action": "created",
41+
"meta": {
42+
"id": 1,
43+
"created_on": "2025-09-15T17:27:45.000Z",
44+
"modified_on": "2025-09-15T17:27:45.000Z",
45+
"is_disabled": false,
46+
"email": "jc@jc21.com",
47+
"name": "Jamie",
48+
"nickname": "Jamie",
49+
"avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
50+
"roles": [
51+
"admin"
52+
],
53+
"permissions": {
54+
"visibility": "all",
55+
"proxy_hosts": "manage",
56+
"redirection_hosts": "manage",
57+
"dead_hosts": "manage",
58+
"streams": "manage",
59+
"access_lists": "manage",
60+
"certificates": "manage"
61+
}
62+
}
63+
}
64+
}
65+
},
66+
"schema": {
67+
"$ref": "../../../components/audit-log-object.json"
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}

backend/schema/swagger.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
"$ref": "./paths/audit-log/get.json"
3030
}
3131
},
32+
"/audit-log/{id}": {
33+
"get": {
34+
"$ref": "./paths/audit-log/id/get.json"
35+
}
36+
},
3237
"/nginx/access-lists": {
3338
"get": {
3439
"$ref": "./paths/nginx/access-lists/get.json"

0 commit comments

Comments
 (0)