-
Notifications
You must be signed in to change notification settings - Fork 35
Add support for direct dataplane access #453
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
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3afdfa8
Implement direct dataplane access
emmyzhou-db 34f6f48
Small refactor
emmyzhou-db afd1d5b
override generated code temp
emmyzhou-db 4a8832b
Modify all credentials provider which are OAuth
emmyzhou-db 419121e
Finally working :)
emmyzhou-db 594f17e
Update ApiClient
emmyzhou-db ba1b401
add temp test
emmyzhou-db 79e360d
Add host as a field to token sources
emmyzhou-db b60ed0e
Updated tests
emmyzhou-db b56c4d5
Updated tests
emmyzhou-db 1508d67
Fix merge
emmyzhou-db 6213dd8
Fix formatting
emmyzhou-db 6199ed9
Final version
emmyzhou-db 98664de
Add unit tests
emmyzhou-db 0ab3df4
Merge branch 'main' into emmyzhou-db/code-gen
emmyzhou-db d59b798
Fix formatting
emmyzhou-db 21a3b13
Merge branch 'main' into emmyzhou-db/code-gen
emmyzhou-db cd7d6d5
Direct dataplane access with code generation
emmyzhou-db 21ab388
Add unit tests to ErrorTokenSource and DatabricksConfig
emmyzhou-db dc75702
Temporarily changed WorkspaceClient to only include the services rele…
emmyzhou-db fdf130e
Update change log
emmyzhou-db a2ae11b
Fix very annoying formatting issue
emmyzhou-db 9f98250
Small change to order of methods in ApiClient
emmyzhou-db 4a0b8fd
Delete databricks-sdk-java/src/test/java/com/databricks/sdk/service/s…
emmyzhou-db 5655ae5
Small fix
emmyzhou-db ef392fd
Update ApiClient
emmyzhou-db 3777641
Fix typo in changelog
emmyzhou-db b2eb8ab
Updated imp template
emmyzhou-db 8c92152
Remove getReponse() from ApiClient
emmyzhou-db b8564f2
Update databricks-sdk-java/src/main/java/com/databricks/sdk/core/http…
emmyzhou-db 5eadb66
Update OAuthHeaderFactory
emmyzhou-db ec211f3
Add latest generated code
emmyzhou-db dadddd8
Revert "Add latest generated code"
emmyzhou-db 4ea2d8f
Revert API changes
emmyzhou-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
28 changes: 27 additions & 1 deletion
28
databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
71 changes: 71 additions & 0 deletions
71
databricks-sdk-java/src/main/java/com/databricks/sdk/core/http/RequestOptions.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| package com.databricks.sdk.core.http; | ||
|
|
||
| import java.util.function.Function; | ||
|
|
||
| /** | ||
| * A builder class for configuring HTTP request transformations including authentication, URL, and | ||
| * user agent headers. | ||
| * | ||
| * <p>Experimental: this class is experimental and subject to change in backward incompatible ways. | ||
| */ | ||
| public class RequestOptions { | ||
| private Function<Request, Request> authenticateFunc; | ||
| private Function<Request, Request> urlFunc; | ||
| private Function<Request, Request> userAgentFunc; | ||
|
|
||
| /** | ||
| * Constructs a new RequestOptions instance with default identity functions. Initially, all | ||
| * transformations are set to pass through the request unchanged. | ||
| */ | ||
| public RequestOptions() { | ||
| // Default to identity functions | ||
| this.authenticateFunc = request -> request; | ||
| this.urlFunc = request -> request; | ||
| this.userAgentFunc = request -> request; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the authorization header for the request. | ||
| * | ||
| * @param authorization The authorization value to be set in the header | ||
| * @return This RequestOptions instance for method chaining | ||
| */ | ||
| public RequestOptions withAuthorization(String authorization) { | ||
| this.authenticateFunc = request -> request.withHeader("Authorization", authorization); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the URL for the request. | ||
| * | ||
| * @param url The URL to be set for the request | ||
| * @return This RequestOptions instance for method chaining | ||
| */ | ||
| public RequestOptions withUrl(String url) { | ||
| this.urlFunc = request -> request.withUrl(url); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the User-Agent header for the request. | ||
| * | ||
| * @param userAgent The user agent string to be set in the header | ||
| * @return This RequestOptions instance for method chaining | ||
| */ | ||
| public RequestOptions withUserAgent(String userAgent) { | ||
| this.userAgentFunc = request -> request.withHeader("User-Agent", userAgent); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Applies all configured transformations to the given request. The transformations are applied in | ||
| * the following order: 1. Authentication 2. URL 3. User-Agent | ||
| * | ||
| * @param request The original request to be transformed | ||
| * @return A new Request instance with all transformations applied | ||
| */ | ||
| public Request applyOptions(Request request) { | ||
| // Apply all transformation functions in sequence | ||
| return userAgentFunc.apply(urlFunc.apply(authenticateFunc.apply(request))); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.