Repository navigation
Drop dead osa-demo.pages.dev origin allowlist entries - #626
Merged
neuromechanist merged 4 commits intoOct 27, 2026
Merged
Conversation
frontend/index.html redirects every osa-demo.pages.dev visit to the osc.earth custom domains before any script calls the API, and the pages.dev name is account-scoped. Keep osa-dash.pages.dev for dashboard PR previews. Tests assert the removed origins are refused. Refs #625
Also from the sync_worker_cors.py template that regenerates it, so a sync does not restore it. The routing test now checks the preflight refuses both names and still allows the demo hosts. Refs #625
This was referenced Nov 11, 2026
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.
Closes #625
Why these entries are dead
frontend/index.htmlredirects everyosa-demo.pages.devand<branch>.osa-demo.pages.devvisit todemo.osc.earthor<branch>-demo.osc.earth.The redirect is the first script in
<head>, ahead ofosa-chat-widget.jsand the page script that calls the API, so the demo never calls the API or embeds a notebook from a pages.dev origin.The
*.pages.devname is also account-scoped: after the move to another Cloudflare account the Pages project gets a suffixed name (osa-demo-<suffix>.pages.dev), so the literal entries would allow a name the project no longer owns.What changed
src/api/main.py: drophttps://osa-demo.pages.devandhttps://*.osa-demo.pages.devfrom the default CORS origins; the docstring now lists the actual defaults.src/api/routers/community.py: drop both from the platform origins_is_authorized_originaccepts for widget requests.workers/osa-worker/index.js: drop both fromisAllowedOrigin.scripts/sync_worker_cors.py: drop both from the template that regeneratesisAllowedOrigin, so a CORS sync does not put them back (running the script reports "No changes needed").scripts/build_notebook_site.py: drop both from the notebookframe-ancestors(production and develop).What is kept, and why
https://osa-dash.pages.devandhttps://*.osa-dash.pages.devstay in the backend CORS defaults: dashboard PR previews are served there and call the API. A test now pins them.frontend/index.htmlandfrontend/osa-chat-widget.jsis untouched; it is how pages.dev visitors reach the custom domains.tests/test_core/test_config/test_community.pykeepshttps://*.osa-demo.pages.devas sample input to theCommunityConfig.cors_originsvalidator; it does not allow anything.Tests
Access-Control-Allow-Origin, are absent from_collect_cors_config, and are refused by_is_authorized_origin; anosa-dash.pages.devpreview is still allowed. The wildcard-to-regex helper test now useshttps://*.example.pages.dev.demo.osc.earthfallback, not the asking origin, for both removed names, and still echoesdemo.osc.earthanddevelop-demo.osc.earth.frame-ancestorscontains anosa-demo.pages.devsource.uv run pytest tests/ -q(Python 3.12): 5367 passed, 83 skipped, 2 failed, both unrelated to this change:test_documentation_urls_accessible[fieldtrip]hit araw.githubusercontent.comread timeout and passes on rerun, andtest_real_program_suggests_a_schema_tagruns only where a local hed-lsp checkout exists (skipped in CI)bun workers/osa-worker/test-routing.js: 162 passed;bun workers/osa-worker/test-mounted-hosts.js: 37 passeduv run ruff check .andruff format --checkclean