-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[C++] Support configuring optional scope field for OAuth2 authentication #12305
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
BewareMyPower
merged 5 commits into
apache:master
from
BewareMyPower:bewaremypower/cpp-oauth2-scope
Oct 9, 2021
Merged
[C++] Support configuring optional scope field for OAuth2 authentication #12305
BewareMyPower
merged 5 commits into
apache:master
from
BewareMyPower:bewaremypower/cpp-oauth2-scope
Oct 9, 2021
Conversation
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
merlimat
approved these changes
Oct 8, 2021
tuteng
reviewed
Oct 9, 2021
tuteng
pushed a commit
that referenced
this pull request
Oct 11, 2021
…ion (#12305) It's a C++ client catchup for #11931. - Add a `scope_` field to `ClientCredentialFlow` and load it from `ParamMap` object whose key is `scope`. - Refactor `ClientCredentialFlow` to simplify code and make it testable: - Use only one constructor instead of two overloaded constructors that might look confused - Add a `generateJsonBody` public method for generating JSON body for post fields in `authenticate` so that it can be tested. - Add a `KeyFile` class like what Java client does to load client id and client secret from `ParamMap` or file. - [x] Make sure that the change passes the CI checks. This change added test `AuthPluginTest.testOauth2RequestBody` for the cases that scope exists or doesn't exist. (cherry picked from commit 44dcc04)
codelipenghui
pushed a commit
that referenced
this pull request
Oct 11, 2021
…ion (#12305) It's a C++ client catchup for #11931. - Add a `scope_` field to `ClientCredentialFlow` and load it from `ParamMap` object whose key is `scope`. - Refactor `ClientCredentialFlow` to simplify code and make it testable: - Use only one constructor instead of two overloaded constructors that might look confused - Add a `generateJsonBody` public method for generating JSON body for post fields in `authenticate` so that it can be tested. - Add a `KeyFile` class like what Java client does to load client id and client secret from `ParamMap` or file. - [x] Make sure that the change passes the CI checks. This change added test `AuthPluginTest.testOauth2RequestBody` for the cases that scope exists or doesn't exist. (cherry picked from commit 44dcc04)
|
@BewareMyPower:Thanks for your contribution. For this PR, do we need to update docs? |
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
…ion (apache#12305) ### Motivation It's a C++ client catchup for apache#11931. ### Modifications - Add a `scope_` field to `ClientCredentialFlow` and load it from `ParamMap` object whose key is `scope`. - Refactor `ClientCredentialFlow` to simplify code and make it testable: - Use only one constructor instead of two overloaded constructors that might look confused - Add a `generateJsonBody` public method for generating JSON body for post fields in `authenticate` so that it can be tested. - Add a `KeyFile` class like what Java client does to load client id and client secret from `ParamMap` or file. ### Verifying this change - [x] Make sure that the change passes the CI checks. This change added test `AuthPluginTest.testOauth2RequestBody` for the cases that scope exists or doesn't exist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-2.8
Archived: 2.8 is end of life
doc-complete
Your PR changes impact docs and the related docs have been already added.
release/2.8.2
type/enhancement
The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
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.
Motivation
It's a C++ client catchup for #11931.
Modifications
scope_field toClientCredentialFlowand load it fromParamMapobject whose key isscope.ClientCredentialFlowto simplify code and make it testable:generateJsonBodypublic method for generating JSON body for post fields inauthenticateso that it can be tested.KeyFileclass like what Java client does to load client id and client secret fromParamMapor file.Verifying this change
This change added test
AuthPluginTest.testOauth2RequestBodyfor the cases that scope exists or doesn't exist.