Skip to content

fix(login): show only the user's workspaces and accept names - #103

Merged
mrchtr merged 1 commit into
mainfrom
fix/login-picker-own-workspaces
Oct 23, 2026
Merged

mrchtr merged 1 commit into
mainfrom
fix/login-picker-own-workspaces

Conversation

@mrchtr

@mrchtr mrchtr commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

What

haystack-enterprise login (OAuth path):

  • Only the user's own workspaces. The workspace picker read GET /api/v1/workspaces, which returns every workspace of the organization to org members. It now reads GET /api/v1/users/me → organization.workspaces, which lists only the workspaces the user holds a role in (all of them for org admins). A user with access to a single workspace is no longer prompted.
  • Pick by number or name. Both the organization and workspace prompts accept either; an unknown entry re-prompts. An exact name wins over a number, so a workspace literally named 2 stays reachable.

The organization list needed no change: /api/v1/sso/organizations already returns only the orgs the user is a member of (same endpoint the UI uses).

Follow-up

The /api/v1/workspaces behaviour itself lives in hep and also drives the UI workspace switcher; tracked separately.

Tests

  • Updated test_login_with_oauth for /users/me.
  • Added test_login_with_oauth_picks_by_name (pick by name, invalid entry and out-of-range number re-prompt).
  • make types, make all-fix clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_016g6JRrEa3sMZSfJFj7WUzt

The workspace picker read /workspaces, which lists every workspace of the
organization to its members. Read /users/me instead, which only lists the
workspaces the user has a role in (all of them for org admins).

Both the organization and workspace prompts now accept a name as well as a
number, and re-prompt on an unknown entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

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
Project Total  

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

@mrchtr
mrchtr merged commit a2dcadd into main Oct 23, 2026
6 checks passed
@mrchtr
mrchtr deleted the fix/login-picker-own-workspaces branch October 23, 2026 09:04
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