mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-16 09:56:36 +00:00
Add logActionAudit and query endpoint
This commit is contained in:
@@ -225,6 +225,28 @@ export const actionAuditLog = sqliteTable("actionAuditLog", {
|
||||
index("idx_actionAuditLog_org_timestamp").on(table.orgId, table.timestamp)
|
||||
]));
|
||||
|
||||
export const identityAuditLog = sqliteTable("identityAuditLog", {
|
||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
||||
timestamp: integer("timestamp").notNull(), // this is EPOCH time in seconds
|
||||
orgId: text("orgId")
|
||||
.notNull()
|
||||
.references(() => orgs.orgId, { onDelete: "cascade" }),
|
||||
actorType: text("actorType").notNull(),
|
||||
actor: text("actor").notNull(),
|
||||
actorId: text("actorId").notNull(),
|
||||
resourceId: integer("resourceId"),
|
||||
ip: text("ip").notNull(),
|
||||
type: text("type").notNull(),
|
||||
action: text("action").notNull(),
|
||||
location: text("location"),
|
||||
path: text("path"),
|
||||
userAgent: text("userAgent"),
|
||||
metadata: text("details")
|
||||
}, (table) => ([
|
||||
index("idx_actionAuditLog_timestamp").on(table.timestamp),
|
||||
index("idx_actionAuditLog_org_timestamp").on(table.orgId, table.timestamp)
|
||||
]));
|
||||
|
||||
export type Limit = InferSelectModel<typeof limits>;
|
||||
export type Account = InferSelectModel<typeof account>;
|
||||
export type Certificate = InferSelectModel<typeof certificates>;
|
||||
|
||||
Reference in New Issue
Block a user