Skip to content

Add new OIDC Auth tests#1254

Closed
hectorcast-db wants to merge 3 commits intomainfrom
add-oidc-auth-tests
Closed

Add new OIDC Auth tests#1254
hectorcast-db wants to merge 3 commits intomainfrom
add-oidc-auth-tests

Conversation

@hectorcast-db
Copy link
Contributor

@hectorcast-db hectorcast-db commented Feb 10, 2026

What changes are proposed in this pull request?

Add new Auth tests for Databricks SP (M2M) and Azure Client Secret.

This increases coverage for existing Auth types and mirrors the tests added in the Go SDK:
databricks/databricks-sdk-go#1470

Tests added:

  • test_workspace_oauth_m2m_auth: Tests OAuth M2M (machine-to-machine) authentication for
    WorkspaceClient
  • test_workspace_azure_client_secret_auth: Tests Azure Client Secret authentication for WorkspaceClient
  • test_account_oauth_m2m_auth: Tests OAuth M2M authentication for AccountClient
  • test_account_azure_client_secret_auth: Tests Azure Client Secret authentication for AccountClient

How is this tested?

Run integration tests with appropriate environment variables set.

NO_CHANGELOG=true

Add new Auth tests for Databricks SP (M2M) and Azure Client Secret.

This increases coverage for existing Auth types and mirrors the tests
added in the Go SDK (databricks/databricks-sdk-go#1470).

Tests added:
- test_workspace_oauth_m2m_auth: Tests OAuth M2M auth for WorkspaceClient
- test_workspace_azure_client_secret_auth: Tests Azure Client Secret auth for WorkspaceClient
- test_account_oauth_m2m_auth: Tests OAuth M2M auth for AccountClient
- test_account_azure_client_secret_auth: Tests Azure Client Secret auth for AccountClient

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Applied black, autoflake, and isort formatting to fix spacing issues.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix oidc_endpoints() property. The method was incorrectly returning
Azure OIDC endpoints when ARM_CLIENT_ID is set, but oidc_endpoints()
is never called for Azure OIDC authentication.

This logic actually caused Databricks M2M OAuth to use the wrong
endpoint when the user set ARM_CLIENT_ID for other purposes.

NOTE: The new logic matches the behavior of the Go SDK and Java SDK.

Mirrors: databricks/databricks-sdk-java#657

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
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-py

Inputs:

  • PR number: 1254
  • Commit SHA: 8f1810dab48ffdf5f8768c7e00e1e3125fc2a058

Checks will be approved automatically on success.

@hectorcast-db
Copy link
Contributor Author

Couldn't merge this since the tests failed (due to core logic being wrong). Added directly to the PR with the changes.

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