Skip workspace selection in auth login on account console hosts#5504
Open
simonfaltum wants to merge 2 commits into
Open
Skip workspace selection in auth login on account console hosts#5504simonfaltum wants to merge 2 commits into
simonfaltum wants to merge 2 commits into
Conversation
Classic account console hosts (accounts.*) serve only account-level APIs, so prompting for (or auto-selecting) a workspace during login stores a workspace_id that cannot be used against that host. shouldPromptWorkspace now returns false for these hosts, using the same canonical-host check as needsAccountIDPrompt and ToOAuthArgument. Explicit --workspace-id and host query params keep working unchanged. Co-authored-by: Isaac
Co-authored-by: Isaac
Collaborator
|
Commit: e6710e2
23 interesting tests: 15 SKIP, 7 KNOWN, 1 flaky
Top 28 slowest tests (at least 2 minutes):
|
mihaimitrea-db
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Logging in to an account console host (for example
https://accounts.cloud.databricks.com) with an account ID prompted "Select a workspace", and silently auto-selected one when the account had exactly one workspace. These hosts only serve account-level APIs, so the storedworkspace_idrefers to a workspace the profile can never talk to, and later commands fail in confusing ways.Relates to #5479.
Changes
Before,
databricks auth login --host https://accounts.cloud.databricks.com --account-id <id>prompted for (or auto-selected) a workspace and wroteworkspace_idinto the profile. Now it skips workspace selection entirely on classic account console hosts and writes noworkspace_idkey.shouldPromptWorkspacereturns false when the host is a classic account console host, usingauth.IsClassicAccountHoston the canonical host name (the same checkneedsAccountIDPromptandToOAuthArgumentalready use). Passing--workspace-idexplicitly (or?w=/?o=host query params) still works and is still written to the profile. SPOG and unified hosts keep prompting exactly as before.Test plan
shouldPromptWorkspaceunit tests: classic accounts host, accounts-dod host, host without scheme, accounts host with an explicit workspace ID, and a workspace host that still prompts.go test ./cmd/auth/... ./libs/auth/...passes.go test ./acceptance -run TestAccept/cmd/auth). No acceptance test was added: the harness cannot complete an OAuth challenge against anaccounts.*host, and the workspace selection step only runs after a successful challenge../task fmt-q,./task lint-q, and./task checkspass.This pull request and its description were written by Isaac.