Skip to content

credentials/u2m: add WithDiscoveryAccountTarget option#1701

Merged
simonfaltum merged 2 commits into
mainfrom
simonfaltum/discovery-account-target
May 28, 2026
Merged

credentials/u2m: add WithDiscoveryAccountTarget option#1701
simonfaltum merged 2 commits into
mainfrom
simonfaltum/discovery-account-target

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

Changes

Adds a new PersistentAuth option, WithDiscoveryAccountTarget(), that sets target=ACCOUNT on the login.databricks.com authorize URL during discovery login.

  • Before: discovery login always lands the user on the workspace selector.
  • Now: when WithDiscoveryAccountTarget() is set alongside WithDiscoveryLogin(), the authorize URL includes target=ACCOUNT so the user lands directly on the account selector.

The new top-level target parameter is set alongside destination_url; the rest of the URL shape is unchanged.

This is needed for clients (e.g. the Databricks CLI) that want an account-only login path (databricks auth login --skip-workspace) without forcing the user through a workspace pick they will never use.

Tests

  • New TestBuildDiscoveryAuthorizeURL_Target covers both the no-target default and target=ACCOUNT.
  • New TestWithDiscoveryAccountTarget verifies the option sets the field.
  • Existing tests updated for the internal buildDiscoveryAuthorizeURL signature change (added trailing target arg). The exported BuildDiscoveryAuthorizeURL signature is unchanged.

Adds a new PersistentAuth option that sets target=ACCOUNT on the
login.databricks.com authorize URL during discovery login. With this
option the discovery flow lands the user directly on the account
selector instead of the workspace selector, which is the right UX when
the caller only wants account-level access.

Co-authored-by: Isaac
Signed-off-by: simon <simon.faltum@databricks.com>
@github-actions
Copy link
Copy Markdown

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1701
  • Commit SHA: 4505da5651bd711830206ad37c290dcdbf18f59a

Checks will be approved automatically on success.

@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 28, 2026 14:52 — with GitHub Actions Inactive
@simonfaltum simonfaltum added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit c2087e1 May 28, 2026
14 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/discovery-account-target branch May 28, 2026 15:56
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