Repository navigation
feat: Implement AllowlistCORSMiddleware for private network access co… - #68
Merged
Merged
Conversation
…ntrol - Added AllowlistCORSMiddleware to restrict private network access to allowed origins. - Updated setup_middleware.py to use AllowlistCORSMiddleware instead of CORSMiddleware. - Enhanced rate limiting middleware to handle backend unavailability, returning 503 status with appropriate error message. - Introduced checks for backend availability during application startup, raising StartupCheckError if any configured backend is unreachable. - Created tests for new middleware and startup checks to ensure proper functionality and error handling. - Updated dependencies to version 1.0.0rc3.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
10xgraph-api 1.0.0rc3: startup checks, rate limiter outage, local playground
Third 1.0 release candidate. Requires
10xgraph>=1.0.0rc3(stores haveaping()). Found while testing the hosted playground against a local10xgraph devwith the production config.Startup check (new, dev and production)
aping());STARTUP_CHECK_TIMEOUT_SECONDS(default 30), then refuses to start, naming each failed backend and itshost:port(no credentials).STARTUP_CHECKS=falseskips it./health/readychecks, so startup and readiness agree./pingwith a fake 429.Rate limiter backend outage answers 503
fail_open: falseand the backend unreachable, requests get503 RATE_LIMIT_UNAVAILABLEwithRetry-After: 5. A real limit hit stays429 RATE_LIMIT_EXCEEDED.RateLimitDecision.backend_unavailable()lets a custom backend signal the same. Backends that only allow or deny are unchanged.Hosted playground can reach a local server
Access-Control-Request-Private-Network) for origins inORIGINS. Before, it answered 400 and the browser reported a CORS error.AllowlistCORSMiddlewareremoves the grant for origins outsideORIGINS; stock Starlette adds it even on refusals.Release
1.0.0rc3; core floor>=1.0.0rc3;uv.lockrefreshed.[1.0.0rc3] - 2026-10-30;RELEASE_NOTES.mdhas an rc3 section.10xgraph-clientstays at 1.0.0-rc.2.Testing
test_startup_checks.py(12);test_rate_limit_unavailable.py(6);test_middleware_order.py.STARTUP_CHECKS=false(pytest env); the startup check tests turn it on themselves.