Skip to content

fix(auth): treat exact host patterns literally - #4108

Merged
mnriem merged 1 commit into
github:mainfrom
NgoQuocViet2001:fix-literal-auth-hosts
Aug 13, 2026
Merged

fix(auth): treat exact host patterns literally#4108
mnriem merged 1 commit into
github:mainfrom
NgoQuocViet2001:fix-literal-auth-hosts

Conversation

@NgoQuocViet2001

Copy link
Copy Markdown
Contributor

Description

  • Treat configured exact auth hosts as literal matches instead of general glob patterns.
  • Keep the documented *. subdomain behavior in one matcher shared by initial requests and redirect auth retention.
  • Reject unsupported ? and bracket glob metacharacters during config validation.

This keeps authentication host matching aligned with the documented exact-host-or-leading-*. syntax.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

Additional validation:

  • .\.venv\Scripts\python.exe -m pytest tests/test_authentication.py -q (158 passed, 1 skipped)
  • uvx ruff@0.15.0 check src tests
  • git diff --check upstream/main...HEAD

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

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.

Assisted-by: OpenAI Codex (model: GPT-5, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mnriem
mnriem merged commit b66044a into github:main Aug 13, 2026
14 checks passed
@mnriem

mnriem commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants