feat: audit log of admin writes, sign-ins and key creation, with an audit tab [CI]

This commit is contained in:
justme committed 2026-10-07 22:17:52 +08:00
1 parent 359313a57b
commit 1379b8c7cb
21 files changed
+579 -7

No files matched your search

+86
View File
@@ -814,6 +814,23 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/admin/audit": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** Audit log of admin actions, newest first */
get: operations["audit_list"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/admin/api-tokens": {
parameters: {
query?: never;
@@ -1183,6 +1200,19 @@ export interface components {
/** Format: date-time */
revoked_at: unknown;
};
AuditDto: {
/** Format: int64 */
id: number | string;
/** Format: date-time */
at: unknown;
actor: string;
method: string;
action: string;
target: null | string;
detail: null | string;
remote: null | string;
success: boolean;
};
BackendUpdateDto: {
channel: string;
enabled: boolean;
@@ -1634,6 +1664,10 @@ export interface components {
items: components["schemas"]["ApiTokenDto"][];
next_cursor: null | string;
};
PageDtoOfAuditDto: {
items: components["schemas"]["AuditDto"][];
next_cursor: null | string;
};
PageDtoOfEventDto: {
items: components["schemas"]["EventDto"][];
next_cursor: null | string;
@@ -4783,6 +4817,58 @@ export interface operations {
};
};
};
audit_list: {
parameters: {
query?: {
actor?: string;
action?: string;
limit?: number | string;
cursor?: string;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["PageDtoOfAuditDto"];
};
};
/** @description Bad Request */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/problem+json": components["schemas"]["ProblemDto"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/problem+json": components["schemas"]["ProblemDto"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/problem+json": components["schemas"]["ProblemDto"];
};
};
};
};
api_tokens_list: {
parameters: {
query?: never;