fix(admin): allow pricing recalculation without master key#291
Conversation
Greptile SummaryThis PR removes the Confidence Score: 5/5Safe to merge — the change is a consistent application of the existing admin auth policy with thorough multi-layer test coverage. All findings are P2 or absent. The core logic change is minimal (one route argument removed, one function deleted) and is already the pattern every other admin endpoint follows. Tests cover both the no-master-key open path and the master-key authenticated path at unit, e2e, integration, and release-e2e levels. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[POST /admin/api/v1/usage/recalculate-pricing] --> B{MasterKey == empty?}
B -- Yes --> C[Add /admin/api/v1/* to skip paths]
C --> D[Path matches skip list → allow]
D --> H[RecalculateUsagePricing handler]
B -- No --> E{Auth header present?}
E -- No --> F[401 Unauthorized]
E -- Yes --> G{Token valid?}
G -- No --> F
G -- Yes --> H
H --> I[200 OK]
Reviews (1): Last reviewed commit: "fix(admin): allow pricing recalculation ..." | Re-trigger Greptile |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR removes the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
Verification
Summary by CodeRabbit
Bug Fixes
Tests