Skip to content

auth: --skip-workspace skips workspace selector in discovery flow#5347

Draft
simonfaltum wants to merge 1 commit into
mainfrom
simonfaltum/skip-workspace-account-target
Draft

auth: --skip-workspace skips workspace selector in discovery flow#5347
simonfaltum wants to merge 1 commit into
mainfrom
simonfaltum/skip-workspace-account-target

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

Why

When the user runs databricks auth login --skip-workspace (without --host), the CLI uses the discovery flow via login.databricks.com. Today the discovery page asks the user to pick a workspace before sending them to OAuth, even though they explicitly said they only want account-level access. That workspace pick is wasted: the resulting profile is account-only either way.

Changes

  • Before: --skip-workspace was silently ignored in the discovery flow. The user landed on the workspace selector and had to pick a workspace anyway.
  • Now: when --skip-workspace is set and the discovery flow is used, the CLI passes u2m.WithDiscoveryAccountTarget() to the SDK. The SDK sets target=ACCOUNT on the discovery authorize URL, so login.databricks.com lands the user directly on the account selector instead of the workspace selector.

Behavior outside the discovery flow (i.e. when --host is set) is unchanged.

Depends on databricks/databricks-sdk-go#1701 (u2m.WithDiscoveryAccountTarget) being merged and the SDK bumped in the CLI. CI will fail compilation until that happens; that's expected.

Test plan

  • New unit test TestDiscoveryLogin_SkipWorkspaceAddsAccountTargetOption verifies that running discoveryLogin with skipWorkspace: true results in exactly one additional PersistentAuthOption being passed to the SDK relative to the baseline. The SDK PR's tests cover what that option actually does to the URL.
  • go test ./cmd/auth/... (existing tests still green)
  • ./task checks (with local SDK replace)

`databricks auth login --skip-workspace` (no --host) now lands the user
on the account selector at login.databricks.com instead of the workspace
selector. The workspace pick was a wasted step when the caller already
said they only want account-level access.

Wired through u2m.WithDiscoveryAccountTarget() from databricks-sdk-go,
which sets target=ACCOUNT on the discovery authorize URL.

Co-authored-by: Isaac
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: ddfa00c

Run: 26514436844

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