Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean host URL in the auth login command #1879

Merged
merged 5 commits into from
Nov 5, 2024
Merged

Conversation

shreyas-goenka
Copy link
Contributor

Changes

The host URL for databricks workspaces includes the workspaceId by default as a positional arg. Eg: https://e2-dogfood.staging.cloud.databricks.com/?o=1234

Thus a user can't simply copy paste the URL today to the auth login command. They'll see a runtime error:

➜  cli git:(main) ✗ databricks auth login --host https://e2-dogfood.staging.cloud.databricks.com/\?o\=xxx --profile new-dg
Error: oidc: fetch .well-known: failed to unmarshal response body: invalid character '<' looking for beginning of value. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:
GET /login.html
...

Tests

Unit tests and manually. Now auth login works even when the workspace_id is included in the URL.

@shreyas-goenka shreyas-goenka requested review from pietern and andrewnester and removed request for pietern and andrewnester November 4, 2024 12:04
libs/auth/oauth.go Outdated Show resolved Hide resolved
libs/auth/oauth_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

The path was not needed after all?

libs/auth/oauth.go Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Nov 5, 2024

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

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 1879
  • Commit SHA: d85cfbb31ddac97b8a7d7c363a8bd4102a2e21ce

Checks will be approved automatically on success.

@eng-dev-ecosystem-bot
Copy link
Collaborator

Test Details: go/deco-tests/11687272053

@shreyas-goenka
Copy link
Contributor Author

shreyas-goenka commented Nov 5, 2024

The path was not needed after all?

@pietern Yeah, it's not. Both account and workspace authentication work without paths. In both cases the account_id or the workspace_id is a query arg in the browser URL. Example:

https://accounts.cloud.databricks.com/cloud-resources/credential-configurations?account_id=xxx

@shreyas-goenka shreyas-goenka added this pull request to the merge queue Nov 5, 2024
Merged via the queue into main with commit b81008e Nov 5, 2024
9 checks passed
@shreyas-goenka shreyas-goenka deleted the login-clean-host branch November 5, 2024 15:34
andrewnester added a commit that referenced this pull request Nov 6, 2024
CLI:
 * Clean host URL in the `auth login` command ([#1879](#1879)).

Bundles:
 * Fix bundle run when run interactively ([#1880](#1880)).
 * Fix relative path resolution for dashboards on Windows ([#1881](#1881)).

Internal:
 * Address goreleaser deprecation warning ([#1872](#1872)).
 * Update actions/github-script to v7 ([#1873](#1873)).
 * Use Go 1.23 ([#1871](#1871)).
 * [Internal] Always write message for manual integration test trigger ([#1874](#1874)).
 * Add `cmd-exec-id` to user agent ([#1808](#1808)).
 * Added E2E test to run Python wheels on interactive cluster created in bundle ([#1864](#1864)).

Dependency updates:
 * Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0 ([#1877](#1877)).
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2024
CLI:
* Clean host URL in the `auth login` command
([#1879](#1879)).

Bundles:
* Fix bundle run when run interactively
([#1880](#1880)).
* Fix relative path resolution for dashboards on Windows
([#1881](#1881)).

Internal:
* Address goreleaser deprecation warning
([#1872](#1872)).
* Update actions/github-script to v7
([#1873](#1873)).
 * Use Go 1.23 ([#1871](#1871)).
* [Internal] Always write message for manual integration test trigger
([#1874](#1874)).
* Add `cmd-exec-id` to user agent
([#1808](#1808)).
* Added E2E test to run Python wheels on interactive cluster created in
bundle ([#1864](#1864)).


Dependency updates:
* Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0
([#1877](#1877)).
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.

4 participants