style: apply Biome formatting to enterprise files

This commit is contained in:
SnapOtter
2026-06-14 14:53:44 +08:00
parent 954cfb01a6
commit e7bef34918
23 changed files with 166 additions and 228 deletions
+1 -5
View File
@@ -16,11 +16,7 @@ export function computeHmac(data: Record<string, unknown>, key: Buffer): string
return createHmac("sha256", key).update(canonicalize(data)).digest("hex");
}
export function verifyHmac(
data: Record<string, unknown>,
hmac: string,
key: Buffer,
): boolean {
export function verifyHmac(data: Record<string, unknown>, hmac: string, key: Buffer): boolean {
const computed = computeHmac(data, key);
return computed === hmac;
}
+1 -4
View File
@@ -100,10 +100,7 @@ export async function auditLog(
requestId,
};
const integrity = computeHmac(rowData, hmacKey);
await db
.update(schema.auditLog)
.set({ integrity })
.where(eq(schema.auditLog.id, id));
await db.update(schema.auditLog).set({ integrity }).where(eq(schema.auditLog.id, id));
}
} catch {
logger.warn({ event }, "Failed to compute audit HMAC");
+1 -6
View File
@@ -1,9 +1,4 @@
import {
createCipheriv,
createDecipheriv,
randomBytes,
hkdf as hkdfCb,
} from "node:crypto";
import { createCipheriv, createDecipheriv, hkdf as hkdfCb, randomBytes } from "node:crypto";
import { promisify } from "node:util";
const hkdf = promisify(hkdfCb);
+6 -1
View File
@@ -50,7 +50,12 @@ export async function deliverWebhook(
lastError = `HTTP ${response.status}`;
// Don't retry 4xx errors (client errors = won't succeed on retry)
if (response.status >= 400 && response.status < 500) {
return { success: false, statusCode: response.status, error: lastError, attempts: attempt + 1 };
return {
success: false,
statusCode: response.status,
error: lastError,
attempts: attempt + 1,
};
}
} catch (err) {
lastError = err instanceof Error ? err.message : String(err);