Skip to content

[Internal] Introduce new TokenSource interface that takes a context.Context #1141

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 2 commits into from
Feb 6, 2025

Conversation

renaudhartert-db
Copy link
Contributor

What changes are proposed in this pull request?

This PR adds a new TokenSource interface which is essentially the same as oauth2.TokenSource but takes a context.Context as input.

The rationale behind this interface is that many of the SDK TokenSource end-up making network calls under the hood. We want these to be done passing the context of the calling method.

This interface is meant to ultimately entirely replace the use of oauth2.TokenSource in the SDK.

How is this tested?

Simple unit tests.

Copy link

github-actions bot commented Feb 6, 2025

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: 1141
  • Commit SHA: 7aad90e270b4f7c897c3cc5febd2d2ca5cf89780

Checks will be approved automatically on success.

@renaudhartert-db renaudhartert-db added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit 3aebd68 Feb 6, 2025
15 checks passed
@renaudhartert-db renaudhartert-db deleted the renaud.hartert/ts branch February 6, 2025 14:39
hectorcast-db added a commit that referenced this pull request Feb 11, 2025
### New Features and Improvements

 * Enable async refreshes for OAuth tokens ([#1143](#1143)).

### Internal Changes

 * Add support for asynchronous data plane token refreshes ([#1142](#1142)).
 * Introduce new TokenSource interface that takes a `context.Context` ([#1141](#1141)).

### API Changes:

 * Added `GetMessageQueryResultByAttachment` method for [w.Genie](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dashboards#GenieAPI) workspace-level service.
 * Added `Id` field for [apps.App](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#App).
 * Added `LimitConfig` field for [billing.UpdateBudgetPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/billing#UpdateBudgetPolicyRequest).
 * Added `Volumes` field for [compute.ClusterLogConf](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ClusterLogConf).
 * Added .
 * Removed `ReviewState`, `Reviews` and `RunnerCollaborators` fields for [cleanrooms.CleanRoomAssetNotebook](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetNotebook).

OpenAPI SHA: 99f644e72261ef5ecf8d74db20f4b7a1e09723cc, Date: 2025-02-11
hectorcast-db added a commit that referenced this pull request Feb 11, 2025
 * Enable async refreshes for OAuth tokens ([#1143](#1143)).

 * Add support for asynchronous data plane token refreshes ([#1142](#1142)).
 * Introduce new TokenSource interface that takes a `context.Context` ([#1141](#1141)).

 * Added `GetMessageQueryResultByAttachment` method for [w.Genie](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dashboards#GenieAPI) workspace-level service.
 * Added `Id` field for [apps.App](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#App).
 * Added `LimitConfig` field for [billing.UpdateBudgetPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/billing#UpdateBudgetPolicyRequest).
 * Added `Volumes` field for [compute.ClusterLogConf](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ClusterLogConf).
 * Added .
 * Removed `ReviewState`, `Reviews` and `RunnerCollaborators` fields for [cleanrooms.CleanRoomAssetNotebook](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetNotebook).

OpenAPI SHA: 99f644e72261ef5ecf8d74db20f4b7a1e09723cc, Date: 2025-02-11
github-merge-queue bot pushed a commit that referenced this pull request Feb 11, 2025
### New Features and Improvements

* Enable async refreshes for OAuth tokens
([#1143](#1143)).


### Internal Changes

* Add support for asynchronous data plane token refreshes
([#1142](#1142)).
* Introduce new TokenSource interface that takes a `context.Context`
([#1141](#1141)).


### API Changes:

* Added `GetMessageQueryResultByAttachment` method for
[w.Genie](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dashboards#GenieAPI)
workspace-level service.
* Added `Id` field for
[apps.App](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#App).
* Added `LimitConfig` field for
[billing.UpdateBudgetPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/billing#UpdateBudgetPolicyRequest).
* Added `Volumes` field for
[compute.ClusterLogConf](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ClusterLogConf).
* [Breaking] Removed `ReviewState`, `Reviews` and `RunnerCollaborators`
fields for
[cleanrooms.CleanRoomAssetNotebook](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/cleanrooms#CleanRoomAssetNotebook).

OpenAPI SHA: 99f644e72261ef5ecf8d74db20f4b7a1e09723cc, Date: 2025-02-11
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