-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: Add remoteoauth helpers (TokenAuthTransport
and TokenAuthEditor
)
#1875
Merged
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
⏱️ Benchmark results
|
disq
commented
Aug 23, 2024
|
||
// TokenAuthEditor returns a custom RequestEditorFn to inject the OAuth2 token | ||
func TokenAuthEditor(tokenSource oauth2.TokenSource) func(context.Context, *http.Request) error { | ||
return func(_ context.Context, req *http.Request) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we can't use the ctx
here for the tokenSource.Token()
call.
erezrokah
approved these changes
Aug 23, 2024
kodiakhq bot
pushed a commit
that referenced
this pull request
Sep 3, 2024
🤖 I have created a release *beep* *boop* --- ## [4.61.0](v4.60.0...v4.61.0) (2024-09-02) ### Features * Add remoteoauth helpers (`TokenAuthTransport` and `TokenAuthEditor`) ([#1875](#1875)) ([bb1be84](bb1be84)) * Add warning on duplicate clients for `round-robin` and `shuffle` schedulers ([#1878](#1878)) ([d148b94](d148b94)) ### Bug Fixes * **deps:** Update aws-sdk-go-v2 monorepo ([#1872](#1872)) ([80eb38a](80eb38a)) * **deps:** Update golang.org/x/exp digest to 9b4947d ([#1881](#1881)) ([bbeb846](bbeb846)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/config to v1.27.30 ([#1876](#1876)) ([0319ff3](0319ff3)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/config to v1.27.31 ([#1879](#1879)) ([4dc8f41](4dc8f41)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.8 ([#1870](#1870)) ([96a5194](96a5194)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.9 ([#1873](#1873)) ([76d4f9f](76d4f9f)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.13.0 ([#1874](#1874)) ([e091d8a](e091d8a)) * **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.22.1 ([#1877](#1877)) ([11aaab4](11aaab4)) * **deps:** Update module golang.org/x/oauth2 to v0.22.0 ([#1883](#1883)) ([2a40306](2a40306)) * **deps:** Update module google.golang.org/grpc to v1.66.0 ([#1880](#1880)) ([a907ea6](a907ea6)) * **deps:** Update opentelemetry-go monorepo ([#1884](#1884)) ([9be63fe](9be63fe)) * Fix panic when converting schema changes to string ([#1885](#1885)) ([8274f17](8274f17)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
These helpers can be used to inject dynamic tokens into requests.
TokenAuthTransport
is ahttp.RoundTripper
, with optional custom rewriting capabilityTokenAuthEditor(oauth2.TokenSource)
returns afunc(context.Context, *http.Request) error
to be used as aRequestEditorFn
in openapi clients.