Enable origins - #195
Enable origins#195
Conversation
|
Warning Review limit reached
More reviews will be available in 9 minutes and 22 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR hardens CORS configuration by adding a comma-split validator for ChangesCORS Origins Configuration
422 Constant Fix and JWT Test Hardening
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hub_adapter/conf.py`:
- Around line 97-102: The parse_origins method in the field_validator for
cors_allowed_origins does not validate that at least one origin is present after
parsing an empty string input, which results in an empty list that blocks all
CORS origins. Add validation logic after processing the comma-separated string
to raise a ValueError or validation error if the resulting list is empty,
ensuring users are explicitly warned when their configuration results in
disabled CORS checking.
In `@hub_adapter/routers/node.py`:
- Around line 57-62: The HTTP status code constant
HTTP_422_UNPROCESSABLE_CONTENT used in the ValidationError exception handler (at
lines 57 and 62 in the detail dictionary and status_code parameter) may not
exist in Starlette versions prior to 0.48.0, while FastAPI 0.120.1 permits
Starlette versions as old as 0.40.0. Replace both occurrences of
HTTP_422_UNPROCESSABLE_CONTENT with the legacy constant
HTTP_422_UNPROCESSABLE_ENTITY which is available in all compatible Starlette
versions, or alternatively update the dependencies to pin Starlette to >=0.48.0
for forward compatibility.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d35f2af2-788a-4827-a64e-d025cbb60a21
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
hub_adapter/conf.pyhub_adapter/routers/node.pyhub_adapter/server.pypyproject.tomltests/router_tests/test_node.pytests/test_middleware.py
Summary by CodeRabbit
New Features
Chores