fix(auth): treat exact host patterns literally - #4108
Merged
Conversation
Assisted-by: OpenAI Codex (model: GPT-5, autonomous)
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns authentication host matching with the documented exact-host or leading-*. syntax.
Changes:
- Adds literal-safe shared hostname matching.
- Rejects unsupported glob metacharacters.
- Tests request and redirect matching behavior.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/authentication/config.py |
Validates patterns and centralizes host matching. |
src/specify_cli/authentication/http.py |
Reuses shared matching for redirects. |
tests/test_authentication.py |
Covers validation, wildcard boundaries, and redirects. |
Review details
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
Collaborator
|
Thank you! |
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.
Description
*.subdomain behavior in one matcher shared by initial requests and redirect auth retention.?and bracket glob metacharacters during config validation.This keeps authentication host matching aligned with the documented exact-host-or-leading-
*.syntax.Testing
uv run specify --helpuv sync && uv run pytestAdditional validation:
.\.venv\Scripts\python.exe -m pytest tests/test_authentication.py -q(158 passed, 1 skipped)uvx ruff@0.15.0 check src testsgit diff --check upstream/main...HEADAI Disclosure
OpenAI Codex (GPT-5, autonomous) analyzed the mismatch, authored the code and tests, ran the validations above, and prepared this PR on behalf of @NgoQuocViet2001. The operator requested this contribution but did not manually author or line-by-line review the patch.