Skip to content

fix: support browser login from headless CLI - #8

Merged
guantw merged 1 commit into
masterfrom
fix/cross-platform-cli-browser-login
Sep 1, 2026
Merged

fix: support browser login from headless CLI#8
guantw merged 1 commit into
masterfrom
fix/cross-platform-cli-browser-login

Conversation

@guantw

@guantw guantw commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Changes

  • Add adaptive auto browser selection for desktop, WSL, SSH, CI, and headless Linux sessions.
  • Add an external browser handoff with a structured auth_required event, configurable callback port and timeout, and same-port loopback forwarding guidance.
  • Harden callback binding, CSRF comparison, cancellation, post-callback browser shutdown handling, fallback logging, and one-time URL redaction.
  • Document the browser requirement, cached-token behavior, migration path, and the exact platforms covered by real login verification.

Validation

  • python -m ruff format --check . (68 files already formatted)
  • python -m ruff check .
  • python -m pytest --cov on Windows 11 Pro x64 (292 passed, 2 skipped, 79% coverage)
  • Full Ruff and pytest suite on Ubuntu 24.04.4 LTS x86_64 under WSL2 (293 passed, 1 skipped)
  • New behavior has account- and device-independent regression coverage
  • User-visible changes are documented in CHANGELOG.md
  • No token, certificate, private key, UDID, HAP, log, or machine configuration is committed
  • No dependencies were added, so THIRD_PARTY_NOTICES.md is unchanged
  • Reviewed docs/OPEN_SOURCE_RELEASE.md; this change does not alter portable artifact composition

Manual testing

  • Windows 11 Pro x64 source CLI: auto launched an isolated Edge session and completed a real Huawei login, loopback callback, token exchange, DPAPI cache write, and cached-token reuse.
  • Ubuntu 24.04.4 LTS x86_64 under WSL2: auto opened the Windows default browser and completed the WSL loopback callback, token exchange, mode-0600 cache write, and cached-token reuse.
  • Temporary authentication and verification directories were removed after testing.
  • Native Linux/remote SSH, macOS, GUI, USB, HAP signing, and installation were not included in the real-login verification scope; the documentation states these limits explicitly.

Add adaptive browser selection and a structured external-browser handoff with secure loopback forwarding for SSH, CI, WSL, and headless Linux.

Harden callback handling and document authentication constraints, verified platforms, and migration behavior.
@guantw
guantw merged commit 9b73523 into master Sep 1, 2026
9 checks passed
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