Skip to content

Stop suggesting https://*.pages.dev as a cors_origins example - #629

Merged
neuromechanist merged 3 commits into
developfrom
fix/cors-origin-example
Oct 27, 2026
Merged

neuromechanist merged 3 commits into
developfrom
fix/cors-origin-example

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

The cors_origins validator's error message and the field's docstring (src/core/config/community.py) offered https://*.pages.dev as the wildcard example. Copied into a community's config.yaml, that would authorize every Cloudflare Pages site, anyone's.

Changes

  • The error message's example is now https://*.example.org, and so are the examples in _wildcard_origin_to_regex's docstring (src/api/main.py) and a wildcard-syntax test.
  • The docstring's example is now https://*.hedtags.org, and it says why a shared host must never be wildcarded and that a wildcard never matches the domain itself.
  • .context/community_onboarding_review.md and .context/implementation_summary.md are corrected the same way.
  • The same change for the public docs is docs(osa): load the widget from demo.osc.earth, not osa-demo.pages.dev documentation#44.

No community config uses a shared-host wildcard (checked every src/assistants/*/config.yaml), and validation behavior is unchanged.

Tested

tests/test_core/test_config/test_community.py and tests/test_api/test_cors.py pass (485). No test asserts the old example text; the validator tests match only the Invalid CORS origin prefix. ruff check and ruff format --check are clean.

Review

One Sonnet pass, covering this PR and documentation#44 together.

  • Fixed: the regex helper's docstring and the wildcard-syntax test still used *.pages.dev, and the docs did not say a wildcard never matches the domain itself.

The validator's error message and the cors_origins docstring offered
https://*.pages.dev as the wildcard example, which would authorize every
Cloudflare Pages site. They now use a wildcard on a domain the community
controls, and the docstring says why. Two .context notes likewise. No
community config uses a shared-host wildcard. CORS tests pass (13), ruff
clean.
_wildcard_origin_to_regex's docstring and a wildcard-syntax test used
https://*.pages.dev as their example; both now use example.org. The
cors_origins docstring and the .context note add that a wildcard never
matches the domain itself. Community config and CORS tests pass.
@neuromechanist
neuromechanist merged commit f22a318 into develop Oct 27, 2026
11 checks passed
@neuromechanist
neuromechanist deleted the fix/cors-origin-example branch October 27, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant