Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -17,6 +17,39 @@ export const DEFAULT_AUDIT_RETENTION_DAYS = 365; // baseline / "none" scope
|
||||
export const SOC2_AUDIT_RETENTION_DAYS = 7 * 365; // SOC2 + HIPAA: 7y
|
||||
export const GDPR_AUDIT_RETENTION_DAYS = 6 * 365; // GDPR: 6y
|
||||
|
||||
// AK-P3 AP-2 — cron wiring. Mirrors plugin-audit-retention so the worker
|
||||
// bootstrap can install a nightly scheduler for the AuditEvent sweep.
|
||||
export const AUDIT_RETENTION_QUEUE = "audit-retention" as const;
|
||||
export const AUDIT_RETENTION_JOB_ID = "audit-retention" as const;
|
||||
/** Nightly at 03:30 UTC (offset from plugin-audit-retention's 03:00). */
|
||||
export const AUDIT_RETENTION_CRON_DEFAULT = "30 3 * * *" as const;
|
||||
|
||||
export type AuditRetentionEnv = Readonly<Record<string, string | undefined>>;
|
||||
|
||||
/**
|
||||
* Install (or replace) the nightly AuditEvent-retention schedule on a
|
||||
* BullMQ-like queue. Idempotent via a stable scheduler key. Cron pattern
|
||||
* overridable via `AUDIT_RETENTION_CRON`.
|
||||
*/
|
||||
export async function registerAuditRetentionCron(
|
||||
queue: {
|
||||
upsertJobScheduler: (
|
||||
schedulerId: string,
|
||||
options: { pattern: string },
|
||||
template: { name: string; data?: Record<string, unknown> },
|
||||
) => Promise<unknown>;
|
||||
},
|
||||
env: AuditRetentionEnv | undefined = process.env,
|
||||
): Promise<{ pattern: string }> {
|
||||
const pattern = env?.AUDIT_RETENTION_CRON?.trim() || AUDIT_RETENTION_CRON_DEFAULT;
|
||||
await queue.upsertJobScheduler(
|
||||
AUDIT_RETENTION_JOB_ID,
|
||||
{ pattern },
|
||||
{ name: AUDIT_RETENTION_JOB_ID, data: { task: AUDIT_RETENTION_JOB_ID } },
|
||||
);
|
||||
return { pattern };
|
||||
}
|
||||
|
||||
export type AuditRetentionPolicy = {
|
||||
/** Hard cap in days. Events older than this are pruned. */
|
||||
retentionDays: number;
|
||||
|
||||
Reference in new issue
Block a user