-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Internal] Add support for asynchronous data plane token refreshes #1142
Merged
+202
−19
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hectorcast-db
approved these changes
Feb 7, 2025
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE:
api.go
andimpl.go
are here to help with review and will be removed before merge. These are supposed to be added later on via code generation.What changes are proposed in this pull request?
This PR is a step towards enabling asynchronous refreshes of data plane tokens.
The PR introduces a new interface
dataplane.EndpointTokenSource
which returns data plane tokens for a given endpoint and authorization detail. The default implementation relies onauth.NewCachedTokenSource
to wrap the underlying TokenSources.Note: async refreshes are disabled at the moment and will be enabled in a follow-up PR.
About Config.GetTokenSource():
My first attempt to implement
GetTokenSource()
returned an error if theTokenSource
could not be built (e.g. because of config initialization errors). This didn't work because:WorkspaceClient
is created — sometimes with a config that is not compatible withGetTokenSource()
.Returning a
TokenSource
provider instead of aTokenSource
would have solved the problem but did not feel right. The current solution (i.e. return an ever-failing token source) is the cleanest solution I could think off.How is this tested?
Complete unit test coverage of the new package.