Skip to content

feat(cli): make device flow the default for login - #99

Merged
mrchtr merged 2 commits into
mainfrom
feat/device-login-default
Oct 23, 2026
Merged

mrchtr merged 2 commits into
mainfrom
feat/device-login-default

Conversation

@mrchtr

@mrchtr mrchtr commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Why

haystack-enterprise login redirected to http://127.0.0.1:<port>/callback. That breaks when the browser and the CLI aren't on the same network path (VPNs, SSH, remote dev boxes, containers).

What

  • login now uses the OAuth device flow by default: it prints a link and a code you confirm in a browser on any device. Nothing has to reach back to the user's machine.
  • --no-device brings back the old browser flow on the same machine.
  • If an identity provider doesn't support device login, the CLI falls back to the browser flow. Platforms without OAuth still use the old browser login.
  • --no-browser and --api-key are unchanged.
  • Docs and AGENTS.md updated.

Before release

On prod the device code expires after 60 seconds. Raise the device code validity for the haystack-enterprise-cli provider in Authentik (EU and US) to about 10 minutes.

Testing

  • make tests-unit (771 passed), make types clean
  • Manual: haystack-enterprise login, approve on another device, then haystack-enterprise whoami

🤖 Generated with Claude Code

https://claude.ai/code/session_01P3nCYHqG2BQyGPLbAfzLqA

The loopback redirect to 127.0.0.1 breaks whenever the browser and CLI
don't share a network path (VPNs, SSH, containers). The device flow has
no redirect, so it is now the default. `--no-device` keeps the local
browser flow, and IdPs without the device grant fall back to it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mrchtr mrchtr changed the title feat(cli)!: make device flow the default for login feat(cli): make device flow the default for login Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack_enterprise_sdk
  cli.py 443-444
  haystack_enterprise_sdk/_api
  oauth.py
Project Total  

This report was generated by python-coverage-comment-action

@mrchtr
mrchtr merged commit 3feb257 into main Oct 23, 2026
9 checks passed
@mrchtr
mrchtr deleted the feat/device-login-default branch October 23, 2026 09:17
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.

2 participants