-
Notifications
You must be signed in to change notification settings - Fork 910
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
Add builder for OAuth1aToken #2770
Conversation
Motivation: Related line#2680 (comment) The current implementation for building OAuth 1a token isn't convinient. Modifcations: - Add `OAuth1aTokenBuilder`. Result: - You can now easily create `OAuth1aToken`.
core/src/main/java/com/linecorp/armeria/common/auth/OAuth1aTokenBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/auth/OAuth1aToken.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2770 +/- ##
============================================
+ Coverage 72.66% 72.92% +0.25%
- Complexity 11746 11901 +155
============================================
Files 1032 1043 +11
Lines 45883 46201 +318
Branches 5723 5765 +42
============================================
+ Hits 33340 33690 +350
+ Misses 9610 9562 -48
- Partials 2933 2949 +16 Continue to review full report at Codecov.
|
core/src/main/java/com/linecorp/armeria/common/auth/OAuth1aToken.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/auth/OAuth1aTokenBuilder.java
Outdated
Show resolved
Hide resolved
@@ -125,13 +137,60 @@ public OAuth1aTokenBuilder version(String version) { | |||
} | |||
|
|||
/** | |||
* Sets additional (or user-defined) parameters. | |||
* Sets additional parameters. If the specified {@code additionals} has pre-defined parameters, | |||
* the parameters are set automatically to this builder and removed from the {@code additionals}. | |||
*/ | |||
public OAuth1aTokenBuilder additionals(Map<String, String> additionals) { |
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.
This method is not only for additional parameters but any parameters including pre-defined ones. Perhaps we should rename it to putAll()
? We could also add methods like put(CharSequence, CharSequence)
.
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.
Thanks, added put()
and putAll()
. I didn't use CharSequence
though because I feel it's too much.
If it's necessary, jut let me know. 😉
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.
SGTM. Thanks, @minwoox
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.
Nice work, @minwoox ❤️
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.
Thanks! @minwoox
Left some nits :-)
core/src/main/java/com/linecorp/armeria/common/auth/OAuth1aTokenBuilder.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/common/auth/OAuth1aTokenTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/auth/OAuth1aTokenBuilder.java
Show resolved
Hide resolved
Thanks a lot, @minwoox |
Thanks for reviewing. 😉 |
Motivation: Related: line#2680 (comment) The current implementation for building OAuth 1a token isn't convenient. Modifcations: - Add `OAuth1aTokenBuilder`. Result: - You can now easily create `OAuth1aToken`.
Motivation:
Related #2680 (comment)
The current implementation for building OAuth 1a token isn't convenient.
Modifcations:
OAuth1aTokenBuilder
.Result:
OAuth1aToken
.