forked from unkeyed/unkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: do not send audit logs to tinybird (unkeyed#2206)
* refactor: do not send audit logs to tinybird * refactor: use database for audit logs in trigger app * chore: remove accidentally created file * fix: cache and return properly
- Loading branch information
Showing
57 changed files
with
779 additions
and
1,987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { insertAuditLogs } from "@/lib/audit"; | ||
import { and, db, eq, inArray, schema } from "@/lib/db"; | ||
import { ingestAuditLogsTinybird } from "@/lib/tinybird"; | ||
import { rateLimitedProcedure, ratelimit } from "@/lib/trpc/ratelimitProcedure"; | ||
import { TRPCError } from "@trpc/server"; | ||
import { z } from "zod"; | ||
|
@@ -82,23 +81,4 @@ export const deleteKeys = rateLimitedProcedure(ratelimit.delete) | |
"We are unable to delete the key. Please contact support using [email protected]", | ||
}); | ||
}); | ||
|
||
await ingestAuditLogsTinybird( | ||
workspace.keys.map((key) => ({ | ||
workspaceId: workspace.id, | ||
actor: { type: "user", id: ctx.user.id }, | ||
event: "key.delete", | ||
description: `Deleted ${key.id}`, | ||
resources: [ | ||
{ | ||
type: "key", | ||
id: key.id, | ||
}, | ||
], | ||
context: { | ||
location: ctx.audit.location, | ||
userAgent: ctx.audit.userAgent, | ||
}, | ||
})), | ||
); | ||
}); |
Oops, something went wrong.