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.
Various collection properties exist on JwtParserBuilder, JwkBuilder, ClaimsMutator (audience), etc, and they are a pain to consistently represent across builders, with forced overloaded methods (set a single value, set a collection), and currently none of them have the ability to remove or clear existing entries if desired. The likelihood of one builder representing overloaded methods one way and another a different way is high and that possibility should be reduced/eliminated.
This PR enables a consistent collection property mutator design concept that works across all builders with collection properties, and eliminates the need for inconsistent and/or numerous overloaded methods for a cleaner/easier-to-read API.
For example:
ClaimsMutator
'saudience(String)
,audience(Collection)
andaudienceSingle(String)
are removed in favor of a singleaudience()
sub-builderJwkBuilder
operations(KeyOperation)
andoperations(Collection)
are removed in favor of anoperations()
sub-builderProtectedHeaderMutator
->critical()
sub-builder for applied critical header parameter namesJwtParserBuilder
critical()
: sub-builder for supportedcrit
ical header parameterszip()
: sub-builder for compression algorithm customizationenc()
sub-builder for encryption algorithm customizationsig()
: sub-builder for signature and mac algorithm customizationkey()
: sub-builder for key algorithm customizationThese latter
zip()
,enc()
,sig()
andkey()
method names were chosen to parallel theJwts.ZIP
,Jwts.ENC
,Jwts.SIG
andJwts.KEY
registries