Repository navigation
Stop suggesting https://*.pages.dev as a cors_origins example - #629
Merged
Conversation
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.
Merged
13 of 14 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.
The
cors_originsvalidator's error message and the field's docstring (src/core/config/community.py) offeredhttps://*.pages.devas the wildcard example. Copied into a community'sconfig.yaml, that would authorize every Cloudflare Pages site, anyone's.Changes
https://*.example.org, and so are the examples in_wildcard_origin_to_regex's docstring (src/api/main.py) and a wildcard-syntax test.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.mdand.context/implementation_summary.mdare corrected the same way.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.pyandtests/test_api/test_cors.pypass (485). No test asserts the old example text; the validator tests match only theInvalid CORS originprefix.ruff checkandruff format --checkare clean.Review
One Sonnet pass, covering this PR and documentation#44 together.
*.pages.dev, and the docs did not say a wildcard never matches the domain itself.