Repository navigation
Hosting batch 1: configurable CORS, forwarded host, per-route rate limits, DB timeouts, OpenAPI security (#527 #528 #529 #531 #534) - #571
Merged
Conversation
… rate-limit registries, new host settings, middleware slots Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
… RateLimit dependency (#529) rate_limit_authenticated is now keyed per user instead of per IP. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
# Conflicts: # CHANGELOG.md
… readable cross-origin (#527) Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
… key only for signed-in requests Security review: behind an appending proxy the leftmost forwarded host is client-controlled, and anonymous traffic sharing a tenant bucket could drain the tenant's budget. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
# Conflicts: # CHANGELOG.md # CLAUDE.md # framework/hosting/tests/test_build_time_settings_marked.py # framework/hosting/tests/test_middleware_order.py
…or web and worker engines (#531) Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
# Conflicts: # CHANGELOG.md # framework/hosting/tests/test_build_time_settings_marked.py
# Conflicts: # CHANGELOG.md
…-1 not-yet-consumed allowlist Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…ingle registries argument, restore stray header Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…ep uses effective route Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
…settings.py under size cap Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
# Conflicts: # CHANGELOG.md
Deploying simple-module-python with
|
| Latest commit: |
281130e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://15c0bfcf.simple-module-python.pages.dev |
| Branch Preview URL: | https://feat-hosting-batch-1.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # CHANGELOG.md # docs/.vitepress/config.ts # framework/hosting/simple_module_hosting/_registrations.py
19 tasks
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.
Summary
Closes #527
Closes #528
Closes #529
Closes #531
Closes #534
The design was approved in session; the spec is
docs/superpowers/specs/2026-10-21-hosting-batch-1-design.md.cors_*, restart-required. An empty origin list means no CORS.*combined with credentials is rejected.register_cors_policies(registry)for per-path policies (exact, then regex, then longest prefix).Rangerequests, exposingContent-Range,Accept-RangesandETag. The DB settingpublic_files_cors(default on) turns this off.forwarded_host_allowlist(exact or*.example.com). It applies only behindSM_TRUSTED_PROXYfrom a trusted peer.X-Forwarded-Host, the value the trusted proxy appended; this changed after a security review. Anything else is ignored. When no port is given it comes fromX-Forwarded-Proto.register_rate_limits(registry)hook for path rules, and aRateLimit("10/minute", key=...)dependency for single routes.user,ip,user_or_iportenant. The tenant key applies to signed-in requests only, so anonymous traffic can't drain a tenant's budget.rate_limit_authenticatednow counts per user instead of per IP. It is off by default.db_pool_timeout,db_connect_timeout,db_statement_timeout_msanddb_idle_in_tx_timeout_ms(env still wins), passed to each driver in its own form. SQLite ignores them.SM_BG_TASKS_DB_*pool overrides. The outbox keeps its 1+2 pool.bearerAuthandsessionCookie. Protected operations list both; public ones list[]./apiroute with no permission or public declaration. A newAuthenticated()marker silences it for routes any signed-in user may call; added to the self-service tenants and users routes.module.py299 → 251 lines), plus shared path-matching registries.Verification
main:make lintpasses.make test-py: 5189 passed, 25 skipped.make test-jspasses.make ci-doctorpasses.Range206, forwarded-host spoofing, 429 withRetry-After, timeout settings, schema security, no SM031).redis-serverhere (CI has Redis);pg_sleepstatement-timeout tests.Accepted / follow-ups
bearerAuthis listed on every protected route because it covers provider access tokens; personal API tokens work only onTokenAllowed()routes (documented).Test plan
https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4