Skip to content

Fail when explicit scopes used with databricks-cli auth#1427

Merged
tejaskochar-db merged 6 commits intomainfrom
config-scope-validation
Jan 29, 2026
Merged

Fail when explicit scopes used with databricks-cli auth#1427
tejaskochar-db merged 6 commits intomainfrom
config-scope-validation

Conversation

@tejaskochar-db
Copy link
Copy Markdown
Contributor

@tejaskochar-db tejaskochar-db commented Jan 20, 2026

Changes

Adds validation to ensure users don't pass explicit scopes when using databricks-cli auth, by returning an error.
Scopes read from the config file are allowed as the auth login command writes them there.

Such validation will be added to the Python and Java SDK's databricks-cli auth as well.

Why

The token store used in databricks-cli currently keys tokens by host only, so user provided scopes would be silently ignored. This validation prevents that from happening by informing users with an error.

How is this tested?

Unit tests for the validation logic


NO_CHANGELOG=true

Comment thread config/config_attributes.go Outdated
Copy link
Copy Markdown
Contributor

@renaudhartert-db renaudhartert-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could simplify that by returning a const errors in validateScopes. This will allow you to directly test the gotErr against the wantErr using errors.Is.

@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: 1427
  • Commit SHA: 50ad962233aa69d961b639d930135e8f69dbd2ab

Checks will be approved automatically on success.

@tejaskochar-db tejaskochar-db added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit f6e7f51 Jan 29, 2026
15 checks passed
@tejaskochar-db tejaskochar-db deleted the config-scope-validation branch January 29, 2026 16:19
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