Skip to content
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 support for passing json values for header and payload #643

Merged
merged 10 commits into from Mar 27, 2023

Conversation

andrewrigas
Copy link
Contributor

Changes

Relates to #622

Added support for json values to be pass to the withHeader & withPayload apis. This should de-couple the library to be only used with java Map and allow easy integration with other languages on JVM.

@andrewrigas andrewrigas requested a review from a team as a code owner November 26, 2022 16:10
Copy link
Contributor

@jimmyjames jimmyjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Only request is to not throw the jackson exception, and instead wrap it in an IllegalArgumentException.

* @return this same Builder instance.
* @throws JsonProcessingException if json value has invalid structure
*/
public Builder withHeader(String headerClaimsJson) throws JsonProcessingException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of throwing an exception from jackson, let's catch and throw an IllegalArgumentException with the nested cause, to be consistent with the other methods and not leak the jackson dependency.

* or if the values are not of a supported type.
* @throws JsonProcessingException if json value has invalid structure
*/
public Builder withPayload(String payloadClaimsJson) throws IllegalArgumentException, JsonProcessingException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here re. the jackson exception.

@andrewrigas andrewrigas requested review from jimmyjames and removed request for jimmyjames March 21, 2023 15:00
Copy link
Contributor

@jimmyjames jimmyjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good, thanks!

@jimmyjames jimmyjames merged commit a18955b into auth0:master Mar 27, 2023
2 checks passed
@jimmyjames jimmyjames mentioned this pull request Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants