Improve authorization and async request-path performance#28
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIntroduces a generic async dispatcher and migrates background work (audit, API key last-used, webhooks) to it; moves rate-limit middleware scope to /api/v1; adds repo-level AuthorizeUser with superuser bypass; and adds benchmarks and tests for router, middleware, and async components. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Component (e.g., APIKeyService / AuditService / WebhookService)
participant Dispatcher as asyncDispatcher
participant Worker as Dispatcher Worker
participant Store as Store/DB
participant Logger as slog.Logger
Caller->>Dispatcher: Enqueue(task)
Dispatcher-->>Caller: return immediately
Worker->>Dispatcher: receive task
Worker->>Logger: Log start / errors
Worker->>Store: perform DB operation (CreateAuditLog / UpdateAPIKeyLastUsed / List & deliver webhooks)
Store-->>Worker: result / error
Worker->>Logger: Log errors if any
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
/api/v1, exempt health endpoints, and add focused router/middleware benchmarks plus supporting testsmake bench-perffor repeatable perf runsType of change
Changes
AuthorizeUserand expand RBAC/tenant-scope coverageTesting
Summary by CodeRabbit
Bug Fixes
Performance Improvements
Authorization
New Features / Tests
Chores