Add JwtParserBuilder as the preferred way to create a JwtParser instance#486
Add JwtParserBuilder as the preferred way to create a JwtParser instance#486
Conversation
35c1a85 to
f074bcf
Compare
lhazlewood
left a comment
There was a problem hiding this comment.
Looking good! Just some comments and requests for changes.
| <plugins> | ||
| <plugin> | ||
| <groupId>com.github.siom79.japicmp</groupId> | ||
| <artifactId>japicmp-maven-plugin</artifactId> |
There was a problem hiding this comment.
How does this work exactly? I found https://siom79.github.io/japicmp/ but it's unclear to me what we're using this plugin for. Does it enforce semantic versioning?
There was a problem hiding this comment.
Yup, I've been using it in other projects for Semver (but we are still pre 1.0, so it will not block anything). I'll add a comment to describe it a bit more
Right now it's just configured to break on binary breaking changes (source breaking change are allowed, e.g. adding methods to interfaces)
| * @return the parser method for chaining. | ||
| * @see MissingClaimException | ||
| * @see IncorrectClaimException | ||
| * @deprecated see {@link JwtParserBuilder#requireId(String)} |
There was a problem hiding this comment.
I think we should make these deprecation notices super clear - why they're deprecated, and how they should be using the builder instead. A link to Jwts#parserBuilder() and some minor explanation should be ok.
Also, when I add a deprecation notice, I like to add it in the JavaDoc paragraph as well, with very clear (bold) indications that this method will be removed from 1.0 final.
| * @return the builder for method chaining. | ||
| * @see MissingClaimException | ||
| * @see IncorrectClaimException | ||
| * @deprecated see {@link JwtParserBuilder#requireIssuer(String)} |
There was a problem hiding this comment.
Please see note re: deprecation
|
Oh also, we need to update the documentation to reflect this change everywhere. Also need to update the Changelog. |
501fa75 to
70db63e
Compare
|
@lhazlewood take another look, I just added an |
|
NOTE: I did NOT change the README, as to not confuse anyone before the 0.11.0 release |
lhazlewood
left a comment
There was a problem hiding this comment.
Just some minor change requests, other than that, looks good!
727b660 to
0e67ea7
Compare
- Added new JwtParserBuilder - Copied mutator methods from JwtParser into new JwtParserBuilder - Marked said methods as deprecated in JwtParser - Copied JwtParserTest and JwtsTest to Deprecated*, as to retain coverage on methods that will be removed in 1.0 - Added ImmutableJwtParser This is a stop gap until 1.0, all of the mutable methods will now throw a IllegalStateException. NOTE: this only comes into place when using the new Jwts.parserBuilder(), Jwts.parser() is unchanged. Fixes: #473
0e67ea7 to
499f715
Compare
|
@lhazlewood I hit some odd merge issues, but everything should be resolved now, take another look when you get a second. |
…nce (#486) - Added new JwtParserBuilder - Copied mutator methods from JwtParser into new JwtParserBuilder - Marked said methods as deprecated in JwtParser - Copied JwtParserTest and JwtsTest to Deprecated*, as to retain coverage on methods that will be removed in 1.0 - Added ImmutableJwtParser This is a stop gap until 1.0, all of the mutable methods will now throw a IllegalStateException. NOTE: this only comes into place when using the new Jwts.parserBuilder(), Jwts.parser() is unchanged. Fixes: #473
…#559) - Docs: Adds section to README covering custom object parsing (#500) - Docs: Add note about JwtParserBuilder creating an immutable JwtParser (#508) Doc: #486 Fixes: #494 Doc: #495 Fixes: #171 Updated documentation and changelog to reflect the new Gson extension. Fixes #410. (#476) Co-authored-by: Brian Demers <brian.demers@gmail.com>
* `signWith()` & `setSigningKey()` now prefer to be handed a `Key` type rather than a base64-encoded String - deprecated in jwtk/jjwt#341 * To obtain a configured `JwtParser`, a builder is now preferred, ie `Jwts.parserBuilder().setSigningKey(key).build()` rather than `Jwts.parser().setSigningKey(key)` - deprecated in jwtk/jjwt#486
* `signWith()` & `setSigningKey()` now prefer to be handed a `Key` type rather than a base64-encoded String - deprecated in jwtk/jjwt#341 * To obtain a configured `JwtParser`, a builder is now preferred, ie `Jwts.parserBuilder().setSigningKey(key).build()` rather than `Jwts.parser().setSigningKey(key)` - deprecated in jwtk/jjwt#486 Note that `play-googleauth` currently supports two versions of Play: * Play v2.9, uses jjwt v0.11.5 * Play v3.0, uses jjwt v0.12.6 ...we need to support both, but thankfully everything we're using is supported in both versions of jjwt.
* `signWith()` & `setSigningKey()` now prefer to be handed a `Key` type rather than a base64-encoded String - deprecated in jwtk/jjwt#341 * To obtain a configured `JwtParser`, a builder is now preferred, ie `Jwts.parserBuilder().setSigningKey(key).build()` rather than `Jwts.parser().setSigningKey(key)` - deprecated in jwtk/jjwt#486 Note that `play-googleauth` currently supports two versions of Play: * Play v2.9, uses jjwt v0.11.5 * Play v3.0, uses jjwt v0.12.6 ...we need to support both, but thankfully everything we're using is supported in both versions of jjwt.
* `signWith()` & `setSigningKey()` now prefer to be handed a `Key` type rather than a base64-encoded String - deprecated in jwtk/jjwt#341 * To obtain a configured `JwtParser`, a builder is now preferred, ie `Jwts.parserBuilder().setSigningKey(key).build()` rather than `Jwts.parser().setSigningKey(key)` - deprecated in jwtk/jjwt#486 * Use `io.jsonwebtoken.security.SignatureException` rather than `io.jsonwebtoken.SignatureException` - deprecated in jwtk/jjwt#367 Note that `play-googleauth` currently supports two versions of Play: * Play v2.9, uses jjwt v0.11.5 * Play v3.0, uses jjwt v0.12.6 ...we need to support both, but thankfully everything we're using is supported in both versions of jjwt.
run the build and look at for actual API changes: api/target/japicmp/japicmp.html
This PR still has a few warts and TODOs, but those could change based on feedback, thoughts/ideas welcome.
Fixes: #473
Related README changes are in #499