feat(diagnostics): correlate staff operations errors and audit records
This commit is contained in:
1 parent
440ce4e556
commit
a2954e4408
14 files changed
+473
-110
No files matched your search
@@ -58,3 +58,20 @@ it("creates only recognized local operation links", () => {
|
||||
])
|
||||
expect(errorOperationLink({ ...base, context: { path } })).toBeNull();
|
||||
});
|
||||
|
||||
it("links server operation IDs to the audit search without trusting browser IDs", () => {
|
||||
const record = createErrorRecord("server", "test", "failed", {
|
||||
operationId: "op-123",
|
||||
});
|
||||
expect(summarizeErrorGroup([record]).auditLink).toBe(
|
||||
"/admin/logs/audit?search=op-123",
|
||||
);
|
||||
expect(
|
||||
summarizeErrorGroup([{ ...record, source: "browser" }]).auditLink,
|
||||
).toBeNull();
|
||||
expect(
|
||||
summarizeErrorGroup([
|
||||
{ ...record, context: { operationId: "../../secrets" } },
|
||||
]).auditLink,
|
||||
).toBeNull();
|
||||
});
|
||||
Reference in new issue
Block a user