feat: add organization audit logging - #580
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The latest updates on your projects. Learn more about Unkey Deploy
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
Greptile SummaryAdds an organization-scoped audit ledger and transactional audit coverage across privileged mutations.
Confidence Score: 4/5The PR appears safe to merge, with one non-blocking voice-dialog messaging regression for unsupported browsers. The audit ledger, authorization, transaction, replay, and tenant-scoping changes do not expose a concrete blocking failure, but the voice dialog now misrepresents unsupported voice input as ready to use. Files Needing Attention: apps/dashboard/components/agent/agent-voice-dialog.tsx Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant API as Auth/RPC Handler
participant TX as Database Transaction
participant Audit as Audit Ledger
participant Cache
Client->>API: Privileged organization/resource mutation
API->>API: Authenticate and authorize
API->>TX: Begin transaction
TX->>TX: Apply mutation
TX->>Audit: Append organization-scoped event
Audit-->>TX: Event persisted
TX-->>API: Commit mutation and event
API->>Cache: Invalidate affected caches
API-->>Client: Return result
|
Summary
Validation
bun run check-typesbun run testSummary by cubic
Adds organization-level audit logging with a durable outbox and transactional writes across auth, API keys, and websites. Introduces audit log APIs and tightens client IP capture to trusted proxy headers.
New Features
audit_events) with durable outbox and API replay loop.audit-logs.listandaudit-logs.getById(requiresaudit_log:read; granted to admin/owner).@databuddy/shared(auditActions, outcomes, sources).getTrustedClientIp.Migration
IP_HEADER_VERIFIED=trueTRUSTED_IP_HEADER(defaults tocf-connecting-ip; set to your edge header if different).Written for commit 717d6cf. Summary will update on new commits.