Fix #31191: duplicated "scope" parameter - #31419
Merged
chenrujun merged 5 commits intoOct 15, 2022
Merged
Conversation
chenrujun
requested review from
Netyyyy,
backwind1233,
fangjian0423,
hui1110,
moarychan,
saragluna,
stliu and
yiliuTo
as code owners
October 12, 2022 09:30
Collaborator
|
API change check API changes are not detected in this pull request. |
chenrujun
force-pushed
the
fix_bug_31191_The_parameter_scope_is_duplicated
branch
from
October 12, 2022 09:39
caa3a44 to
5baeae8
Compare
saragluna
requested changes
Oct 12, 2022
2. Update related tests caused by step 1.
saragluna
approved these changes
Oct 14, 2022
moarychan
reviewed
Oct 17, 2022
Comment on lines
+25
to
+28
| protected AbstractOAuth2AuthorizationCodeGrantRequestEntityConverter() { | ||
| addHeadersConverter(this::getHttpHeaders); | ||
| addParametersConverter(this::getHttpBody); | ||
| } |
Member
There was a problem hiding this comment.
We should explicitly use this default constructor in the subclasses
https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/implementation/webapp/AadOAuth2AuthorizationCodeGrantRequestEntityConverter.java#L34-L36
Author
There was a problem hiding this comment.
Not necessary.
Refs:
https://stackoverflow.com/questions/2054022/is-it-unnecessary-to-put-super-in-constructor
Test:
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
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.

Fix #31191. duplicated "scope" parameter.
Root Cause Analysis
This bug is caused by a79493d
AbstractOAuth2AuthorizationGrantRequestEntityConverter#addParametersConverter is not idempotent,
AbstractOAuth2AuthorizationCodeGrantRequestEntityConverter#convertexecute multiple times will cause duplicated parameters.How To Fix
Move the following code into constructor to make sure they only execute once.