Skip to content

Tolerate trailing slash #1211

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

Merged
merged 3 commits into from
Apr 30, 2025
Merged

Tolerate trailing slash #1211

merged 3 commits into from
Apr 30, 2025

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Apr 29, 2025

What changes are proposed in this pull request?

A recent refactor of U2M logic to the SDK introduced a small bug where a hostname with a trailing slash would be rejected when using databricks auth login, e.g. databricks auth login --host https://myworkspace.cloud.databricks.com/. This happens because AccountOAuthArgument and WorkspaceOAuthArgument both validate that the provided host does not have a trailing slash. Instead, we can tolerate hostnames ending with a slash by using the CanonicalHostName() method of Config to normalize the hostname, removing the unneeded trailing slash before passing the normalized hostname to U2M auth components. I have made a similar fix to getOidcEndpoints.

How is this tested?

Unit tests are added to verify that getOauthArgument on Config works with normalized hostnames, and same for getOidcEndpoints.

@mgyucht mgyucht temporarily deployed to test-trigger-is April 29, 2025 15:51 — with GitHub Actions Inactive
Copy link

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: 1211
  • Commit SHA: 064d162a13d7d2810fe4d70b795e0f06a263a38e

Checks will be approved automatically on success.

@mgyucht mgyucht temporarily deployed to test-trigger-is April 29, 2025 15:53 — with GitHub Actions Inactive
@mgyucht mgyucht enabled auto-merge April 30, 2025 07:33
@mgyucht mgyucht requested a review from hectorcast-db April 30, 2025 07:40
@mgyucht mgyucht added this pull request to the merge queue Apr 30, 2025
Merged via the queue into main with commit eab964f Apr 30, 2025
15 checks passed
@mgyucht mgyucht deleted the fix/tolerate-trailing-slash branch April 30, 2025 08:01
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