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

JWE support #279

Merged
merged 235 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
2e460a3
JWE support. Resolves #113
lhazlewood Aug 2, 2018
f5ab064
IF SQUASHING, DO NOT SQUASH THIS COMMIT UNTIL MERGING TO MASTER: Remo…
lhazlewood Aug 18, 2020
93b1783
cleanup after rebasing from master
lhazlewood Oct 13, 2021
ac64d20
adding tests, working towards 100% coverage. Moved api static factor…
lhazlewood Oct 14, 2021
82abdaf
adding tests, removed unused class
lhazlewood Oct 14, 2021
cee1a25
implementation checkpoint (safety save)
lhazlewood Oct 19, 2021
ee73ba0
clean build checkpoint
lhazlewood Oct 22, 2021
27d128e
continued testing w/ more coverage. Replaced PbeKey concept with Pas…
lhazlewood Oct 23, 2021
f0801da
fixed erroneous soptimize imports'
lhazlewood Oct 24, 2021
2d87821
A bit of cleanup, more test cases...
lhazlewood Nov 2, 2021
ad5c8b1
Added ECDH-ES key algorithms + RFC tests
lhazlewood Nov 4, 2021
dc87c42
1. Enabled targeted/limited use of BouncyCastle only when required by…
lhazlewood Nov 7, 2021
be29907
1. EcdhKeyAlgorithm: consolidated duplicate logic to a single private…
lhazlewood Nov 7, 2021
eb4ee64
Minor javadoc update
lhazlewood Nov 7, 2021
7a6b1a2
1. Javadoc cleanup.
lhazlewood Nov 7, 2021
1144c64
Fixed erroneous JavaDoc, enhanced code coverage for DefaultClaims
lhazlewood Nov 7, 2021
1e84170
Added jwe compression test
lhazlewood Nov 7, 2021
5db786c
Added TestKeys concept for Groovy test authoring
lhazlewood Nov 8, 2021
3ba22fe
Added tests, cleaned up state assertions for code coverage
lhazlewood Nov 8, 2021
285c2ae
Added tests, cleaned up state assertions for code coverage
lhazlewood Mar 20, 2022
5283933
Removed unused code
lhazlewood Apr 20, 2022
1e9b969
Merge branch 'master' into jwe-merge
lhazlewood Apr 28, 2022
23e94af
Merge branch 'master' into jwe-merge
lhazlewood Apr 29, 2022
700943b
using groovy syntax to avoid conflict with legacy SignatureAlgorithm …
lhazlewood Apr 29, 2022
8507ce4
JavaDoc fixes
lhazlewood Apr 29, 2022
4f8b1d1
JavaDoc fixes, test additions to work on JDK >= 15
lhazlewood Apr 30, 2022
3928a73
JavaDoc fixes, test additions to work on JDK 7 and JDK >= 15
lhazlewood Apr 30, 2022
f53af05
Test adjustment to work on Java 7
lhazlewood Apr 30, 2022
89214c5
Test adjustment to work on Java 7
lhazlewood Apr 30, 2022
71ce2e7
Merge remote-tracking branch 'origin/master' into jwe
lhazlewood Apr 30, 2022
e436f9d
Merge branch 'master' into jwe
lhazlewood Apr 30, 2022
46e5e9c
code coverage work cont'd
lhazlewood May 1, 2022
a4ee957
code coverage work cont'd
lhazlewood May 2, 2022
9827271
JavaDoc fix
lhazlewood May 2, 2022
6e787d2
Update impl/src/main/java/io/jsonwebtoken/impl/JwtTokenizer.java
lhazlewood May 2, 2022
aa50113
lift edits
lhazlewood May 2, 2022
52c0044
lift edits
lhazlewood May 2, 2022
2c76a71
lift edits
lhazlewood May 2, 2022
8afdc00
code coverage testing cont'd
lhazlewood May 3, 2022
bac861d
PayloadSupplier renamed to Message
lhazlewood May 3, 2022
7d81efc
Added new KeyPairBuilder/KeyPairBuilderSupplier for parity with KeyBu…
lhazlewood May 7, 2022
414939a
- Added lots of JavaDoc
lhazlewood May 11, 2022
fb50c3e
- JavaDoc additions cont'd
lhazlewood May 12, 2022
2da3c81
- JavaDoc additions and syntax cleanup cont'd
lhazlewood May 13, 2022
ca02283
- JavaDoc additions and syntax cleanup cont'd
lhazlewood May 13, 2022
310aeeb
- JavaDoc additions and syntax cleanup cont'd
lhazlewood May 13, 2022
eb5cfe7
- JavaDoc additions and syntax cleanup cont'd
lhazlewood May 13, 2022
766f134
- JavaDoc cont'd
lhazlewood May 13, 2022
4735217
Code coverage updates cont'd
lhazlewood May 20, 2022
92f959e
Propagating exception wrapper function enhancements
lhazlewood May 21, 2022
fc85323
100% code coverage!
lhazlewood May 22, 2022
d72eaf6
Minor test changes to work with JDK >= 11
lhazlewood May 22, 2022
2d6fa5e
Ensured all JWK secret or private values were wrapped in a RedactedSu…
lhazlewood May 23, 2022
c3d218a
- Updated JavaDoc to reflect JWK toString safety and property access
lhazlewood May 24, 2022
a1f404f
Documentation enhancements
lhazlewood May 25, 2022
5d66e37
Fixed erroneous JavaDoc element
lhazlewood May 25, 2022
32759ed
Fixed LocatorAdapter usage now that it's abstract
lhazlewood May 25, 2022
a3e2460
Minor JavaDoc fix
lhazlewood May 25, 2022
b83798c
JavaDoc is now complete (no warnings) for api module
lhazlewood May 25, 2022
cbcde30
Ensured JWS signatures are computed first before deserializing the bo…
lhazlewood May 26, 2022
e471bd0
Removed EllipticCurveSignatureAlgorithm and RsaSignatureAlgorithm con…
lhazlewood May 27, 2022
1fb6cb8
Removed reliance on io.jsonwebtoken.security.KeyPair now that KeyPair…
lhazlewood May 27, 2022
a40a02a
Ensured RsaKeyAlgorithm used PublicKey and PrivateKey parameters due …
lhazlewood May 27, 2022
494b594
cleaned up EC point addition/doubling logic to be more readable and m…
lhazlewood May 27, 2022
a5d30a0
Deprecated JwtParserBuilder setSigningKey* methods in favor of verify…
lhazlewood May 27, 2022
0ed890f
Added PositiveIntegerConverter and PublicJwkConverter for JWE Header …
lhazlewood May 28, 2022
3a40fda
Ensured CompressionCodec inherited Identifiable for consistency w/ al…
lhazlewood May 29, 2022
e8b4fe0
Ensured CompressionCodec inherited Identifiable for consistency w/ al…
lhazlewood May 29, 2022
45b1ee2
Ensured CompressionCodec inherited Identifiable for consistency w/ al…
lhazlewood May 29, 2022
aa544e1
JavaDoc enhancement
lhazlewood May 29, 2022
954338b
Added Jwks.parserBuilder(), JwkParserBuilder and JwkParser concepts
lhazlewood May 29, 2022
4b81219
Ensured ProtoJwkBuilder method names were all congruent (remaining se…
lhazlewood May 29, 2022
a2b47cd
Minor JavaDoc organization change
lhazlewood May 29, 2022
2637661
Changed JweBuilder to have only two encryptWith* methods for consiste…
lhazlewood May 30, 2022
b190da0
Removed DefaultValueGetter in favor of new FieldReadable concept to l…
lhazlewood Jun 2, 2022
5307aa1
Adding copyright headers
lhazlewood Jun 2, 2022
2937114
Deprecated CompressionCodecResolver in favor of Locator<CompressionCo…
lhazlewood Jun 2, 2022
18fbc69
Deprecated CompressionCodecResolver in favor of Locator<CompressionCo…
lhazlewood Jun 2, 2022
417dcd3
Folded in JweBuilder concept and implementation into the existing Jwt…
lhazlewood Jun 3, 2022
a698cae
Cleanup to reduce duplicate logic
lhazlewood Jun 3, 2022
03a2183
Changed plaintext JWT payload type from String to byte[]
lhazlewood Jun 4, 2022
e623585
Minor internal doc fixes
lhazlewood Jun 4, 2022
dd847ab
- Added UnprotectedHeader interface
lhazlewood Jun 4, 2022
f81a732
Updated changelog to reflect the following changes:
lhazlewood Jun 4, 2022
d9af0d4
Adding RFC 7520 test cases.
lhazlewood Jun 5, 2022
1069549
Changed JwtBuilder/JwtParser/JwtHandler/JwtHandlerAdapter `payload` c…
lhazlewood Jun 7, 2022
034ed2c
JavaDoc error fix
lhazlewood Jun 7, 2022
3e7a3b9
Added JwtParserBuilder#addCompressionCodecs method and supporting tests
lhazlewood Jun 7, 2022
03874f6
Updated changelog to reflect recent changes
lhazlewood Jun 7, 2022
9a6709a
doc updates
lhazlewood Jun 8, 2022
71a5b43
Fixed minor types in JWE related change log
bdemers Jun 9, 2022
6ebba12
Enabled Mutator and HeaderBuilder interfaces and implementations
lhazlewood Jun 11, 2022
164935e
Fixed erroneous JavaDoc
lhazlewood Jun 11, 2022
4be3505
Added additional .pem files for testing PEM parsing (TBD at a later d…
lhazlewood Jun 11, 2022
17deaa0
Updating documentation to prepare for JWE release
lhazlewood Jun 13, 2022
9580d63
more docs
lhazlewood Jun 13, 2022
2c7b78a
docs cont'd
lhazlewood Jun 13, 2022
20a4774
Update README.md
lhazlewood Jun 13, 2022
fc3ab40
Update README.md
lhazlewood Jun 14, 2022
744f407
Update README.md
lhazlewood Jun 14, 2022
8b96b0b
Update README.md
lhazlewood Jun 14, 2022
ffbc49b
docs cont'd
lhazlewood Jun 14, 2022
d54011c
docs cont'd
lhazlewood Jun 14, 2022
759a083
docs cont'd
lhazlewood Jun 14, 2022
f6a7b00
documentation checkpoint
lhazlewood Jun 14, 2022
91d0069
documentation checkpoint, still work in progress
lhazlewood Jun 15, 2022
7f636ac
added extra info about Android BouncyCastle registration
lhazlewood Jun 18, 2022
678e20a
added extra info about Android BouncyCastle registration
lhazlewood Jun 18, 2022
950ee30
added extra info about Android BouncyCastle registration
lhazlewood Jun 18, 2022
3a0e464
documentation cont'd
lhazlewood Aug 9, 2022
c2e38ce
documentation cont'd
lhazlewood Aug 12, 2022
79d1589
documentation cont'd
lhazlewood Aug 12, 2022
0ccb76b
documentation cont'd
lhazlewood Aug 12, 2022
f4a9f77
documentation cont'd
lhazlewood Nov 8, 2022
5b5fa1b
Upgraded Jackson to 2.12.7 due to Jackson CVE
lhazlewood Nov 8, 2022
063b858
trying to get sonatype lift working again
lhazlewood Nov 8, 2022
0b6f933
Merge branch 'master' into jwe
lhazlewood Nov 8, 2022
3d22546
Removed unnecessary println statement in test
lhazlewood Nov 8, 2022
5139acd
Added JDK 19
lhazlewood Nov 8, 2022
fa765e6
Removing JDK 19 until we can resolve incompatible groovy version
lhazlewood Nov 8, 2022
5d7ee75
doc formatting test
lhazlewood Nov 8, 2022
48e3b30
Update README.md
lhazlewood Nov 8, 2022
c45e58d
renamed PasswordKey to just Password, removed unnecessary WrappedSecr…
lhazlewood Nov 17, 2022
544e3df
Updated PasswordKey references to Password
lhazlewood Nov 17, 2022
11fc995
Renamed DefaultPassword to PasswordSpec while also implementing KeySp…
lhazlewood Nov 17, 2022
2360dfc
documentation cont'd
lhazlewood Nov 18, 2022
6e864e5
documentation cont'd
lhazlewood Nov 18, 2022
3bf30d2
documentation cont'd
lhazlewood Nov 18, 2022
18cb84f
JWT expired exception is now shows difference as now - expired
bdemers Jul 11, 2022
6b9d78c
documentation cont'd
lhazlewood Nov 18, 2022
f9d43cc
Merge remote-tracking branch 'origin/jwe' into jwe
lhazlewood Nov 18, 2022
cb534b9
Merge remote-tracking branch 'origin/master' into jwe
lhazlewood Nov 18, 2022
0755a5d
Fixed erroneous error message (should be '521' not '512').
lhazlewood Nov 28, 2022
2196659
- Removed EcKeyAlgorithm and RsaKeyAlgorithm in favor of KeyAlgorithm…
lhazlewood Dec 24, 2022
14de1ef
Merge remote-tracking branch 'origin/master' into jwe
lhazlewood Dec 24, 2022
d32231c
Removed JDK 19 builds due to error with Groovy compiler version compa…
lhazlewood Dec 24, 2022
0b72fa5
removed unused test, created https://github.com/jwtk/jjwt/issues/765 …
lhazlewood Dec 24, 2022
b2e2f9d
updated test case to reflect Edwards keys algorithm name differences …
lhazlewood Dec 24, 2022
4f33459
- Reordered JwtBuilder .encryptWith method arguments to match signWit…
lhazlewood Dec 24, 2022
9fd4484
- Reordered JwtBuilder .encryptWith method arguments to match signWit…
lhazlewood Dec 24, 2022
0e35829
Documentation updates
lhazlewood Dec 27, 2022
f54389c
Documentation updates
lhazlewood Dec 27, 2022
23b3c30
Documentation updates
lhazlewood Dec 27, 2022
0ef8891
Adding Java-based tests for README.md code snippets (e.g. new Example…
lhazlewood Dec 27, 2022
717a7ec
Testing README code snippet in examples
lhazlewood Dec 27, 2022
51ad94d
Testing README code snippet in examples
lhazlewood Dec 27, 2022
feade2d
Testing README code snippet in examples
lhazlewood Dec 27, 2022
b5dba54
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 27, 2022
cd15bd0
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 27, 2022
9488cd4
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 27, 2022
bb5b82f
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
2f73441
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
835f270
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
5881f4f
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
939d139
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
8b14106
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
0637c5f
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
10f3945
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
17ef74c
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
884d966
Ensured README.md examples would compile/run by testing code in a Jav…
lhazlewood Dec 28, 2022
bc5184c
Testing coveralls failure fix for JavaReadmeTest (unnecessary for cov…
lhazlewood Dec 28, 2022
f15a522
Message* API refactoring cleanup
lhazlewood Dec 28, 2022
346d062
Refactored SignatureAlgorithm(s) concept as a new DigestAlgorithm hie…
lhazlewood Dec 30, 2022
0569d1e
- Added JwkThumbprint and JWK Thumbprint URI support
lhazlewood Jan 1, 2023
44ecce4
Updated README with JWK examples
lhazlewood Jan 1, 2023
5b793af
- Added logic and test to ensure Parser builder does not allow both a…
lhazlewood Jan 4, 2023
6408a3f
- Added proactive checks to ensure PublicKey instances cannot be spec…
lhazlewood Jan 4, 2023
3ad7c77
minor edit to reflect latest # of test cases
lhazlewood Jan 4, 2023
450375c
Minor JavaDoc improvement
lhazlewood Jan 4, 2023
9ac0e87
Disabled parsing of unsecured compressed payloads by default, with a …
lhazlewood Jan 4, 2023
a6d507d
Refactored JcaTemplate to avoid reflection
lhazlewood Jan 6, 2023
dbc3196
minor readme clarification
lhazlewood Jan 6, 2023
776cb9a
Edwards Curve keys checkpoint
lhazlewood Jan 10, 2023
6aa1397
Edwards Curve keys and related functionality checkpoint. Added lots …
lhazlewood Jan 17, 2023
cd4910f
Edwards Curve keys and related functionality checkpoint. Reached 100…
lhazlewood Feb 2, 2023
e334b9c
Addressed EdwardsCurve differences (and a JDK 11 PKCS8 encoding bug) …
lhazlewood Feb 3, 2023
27d5b33
Addressed EdwardsCurve differences (and a JDK 11 PKCS8 encoding bug) …
lhazlewood Feb 3, 2023
bd7f2a0
Adding --add-opens lines to surefire/test config to avoid unnecessary…
lhazlewood Feb 4, 2023
18875cc
Improved Edwards Key encoding error checks
lhazlewood Feb 4, 2023
42f6254
added some code to test errors in CI
lhazlewood Feb 4, 2023
10ef360
added some code to test errors in CI
lhazlewood Feb 4, 2023
2e0f60f
added some code to test errors in CI
lhazlewood Feb 4, 2023
a36e55c
added some code to test errors in CI
lhazlewood Feb 4, 2023
05370c9
added some code to test errors in CI
lhazlewood Feb 4, 2023
2bb991b
added some code to test errors in CI
lhazlewood Feb 4, 2023
5bb02d1
added some code to test errors in CI
lhazlewood Feb 4, 2023
2d275f9
added some code to test errors in CI
lhazlewood Feb 4, 2023
9f437a5
added some code to test errors in CI
lhazlewood Feb 4, 2023
f33ed0a
added some code to test errors in CI
lhazlewood Feb 4, 2023
e3a33ad
added some code to test errors in CI
lhazlewood Feb 4, 2023
3eff8a5
added some code to test errors in CI
lhazlewood Feb 4, 2023
4169e40
added some code to test errors in CI
lhazlewood Feb 4, 2023
ce0ccc8
Improved Field/FieldBuilder implementation to make it more robust and…
lhazlewood Feb 5, 2023
f9e9de9
Updating CI config to use the Oracle no-fee JDK builds
lhazlewood Feb 5, 2023
b216f86
Updating CI config to use the Oracle no-fee JDK builds
lhazlewood Feb 5, 2023
8e507b0
Updating CI config to use the Oracle no-fee JDK builds
lhazlewood Feb 5, 2023
c3cf04c
JavaDoc fixes
lhazlewood Feb 5, 2023
e9e5ec7
JavaDoc fixes
lhazlewood Feb 5, 2023
04b12ac
JavaDoc fixes
lhazlewood Feb 5, 2023
5c38d7a
Ensured license headers are updated with correct dates based on git h…
lhazlewood Feb 6, 2023
6e9c618
fixed various build warnings and javadoc errors
lhazlewood Feb 7, 2023
3cec630
Maven license plugin config cleanup. Removed now-unused header_format…
lhazlewood Feb 7, 2023
9fc9218
fixed javadoc error causing build failures
lhazlewood Feb 7, 2023
36c5037
Changed Algorithms + Bridge concept to allow nested inner classes for…
lhazlewood Feb 9, 2023
718edc2
Added license headers
lhazlewood Feb 9, 2023
62ae8fd
Moved JwsAlgorithms to an inner class of Algorithms. Will rename to …
lhazlewood Feb 10, 2023
c46fcdb
Extracting Algorithms inner classes up a level - cleaner/easier to ma…
lhazlewood Feb 11, 2023
9738695
Extracting Algorithms inner classes up a level - cleaner/easier to ma…
lhazlewood Feb 11, 2023
f56cc62
Removed Algorithms class in favor of direct `Standard*` `Registry` re…
lhazlewood Feb 28, 2023
4aee488
Minor README.md documentation updates.
lhazlewood Feb 28, 2023
6b7c730
Copying over 6e74486 to test on the jwe branch
lhazlewood Feb 28, 2023
2daee9c
Ensured CI license-check build pulls full (non-shallow) git history t…
lhazlewood Feb 28, 2023
e192888
JavaDoc + impl + test checkpoint
lhazlewood Mar 9, 2023
ea18d48
JavaDoc + impl + test checkpoint. Returned to 100% code coverage
lhazlewood Mar 17, 2023
64634e3
JavaDoc + impl + test checkpoint. Returned to 100% code coverage
lhazlewood Mar 17, 2023
b1fdf31
- Ensured Edwards Curve keys (X25519 and X448) worked with ECDH-ES al…
lhazlewood Mar 20, 2023
fa17dbf
Ensured correct message assertion on all JDKs (value was different on…
lhazlewood Mar 21, 2023
ef0e14b
Ensured correct message assertion on all JDKs (value was different on…
lhazlewood Mar 21, 2023
f3e9721
Merge remote-tracking branch 'origin/master' into jwe
lhazlewood Mar 21, 2023
383517e
- enabled more IANA algorithms in StandardHashAlgorithms
lhazlewood Mar 22, 2023
6f219c8
- JavaDoc fixes/enhancements
lhazlewood Mar 22, 2023
1f2da01
- JavaDoc fixes/enhancements
lhazlewood Mar 22, 2023
5f03b49
Merge remote-tracking branch 'origin/master' into jwe
lhazlewood Mar 22, 2023
52a5a06
- JavaDoc fixes/enhancements required to pass the build on later JDKs
lhazlewood Mar 22, 2023
0a1b834
Minor JavaDoc typo fix
lhazlewood Mar 23, 2023
922d643
Finished implementing all [RFC 8037](https://www.rfc-editor.org/rfc/r…
lhazlewood May 16, 2023
0c724fa
Removed accidentally-committed visibility modifier
lhazlewood May 16, 2023
3bbec28
Added copyright header
lhazlewood May 16, 2023
e1bf1a2
Enabled PublicKey derivation from Edwards curve PrivateKey
lhazlewood May 17, 2023
f9655e1
Enabled PublicKey derivation from Edwards curve PrivateKey. Updated …
lhazlewood May 17, 2023
e65ccf1
Enabled PublicKey derivation from Edwards curve PrivateKey. Updated …
lhazlewood May 17, 2023
f21753d
Doc update to reference Octet JWK RFC.
lhazlewood May 17, 2023
5d6593e
Minor JavaDoc fix
lhazlewood May 17, 2023
d296830
Fixed OctetPrivateJwk discrepancy with generic parameter ordering (co…
lhazlewood May 18, 2023
fe2ffe3
Changed Jwts.header to Jwts.unprotectedHeader, and Jwts.headerBuilder…
lhazlewood May 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,27 @@ jobs:
if [ "$JDK_MAJOR_VERSION" == "7" ]; then export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m"; fi
${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true

# ensure all of our files have the correct/updated license header
license-check:
runs-on: 'ubuntu-latest'
env:
MVN_CMD: ./mvnw --no-transfer-progress -B
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid license plugin history warnings (plus it needs full history)
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
cache: 'maven'
check-latest: true
- name: License Check
# This adds about 1 minute to any build, which is why we don't want to do it on every other build:
run: |
${{env.MVN_CMD}} license:check

code-coverage:
# (commented out for now - see the comments in 'Wait to start' below for why. Keeping this here as a placeholder
# as it may be better to use instead of an artificial delay once we no longer need to build on JDK 7):
Expand Down Expand Up @@ -107,4 +128,4 @@ jobs:
${{env.MVN_CMD}} -pl . clover:clover clover:check coveralls:report \
-DrepoToken="${{ secrets.GITHUB_TOKEN }}" \
-DserviceName=github \
-DserviceBuildNumber="${{ env.GITHUB_RUN_ID }}"
-DserviceBuildNumber="${{ env.GITHUB_RUN_ID }}"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.class
.DS_Store

# Mobile Tools for Java (J2ME)
Expand Down
23 changes: 20 additions & 3 deletions .lift/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
ignoreRules = ["MissingOverride"]
ignoreFiles = '''
#
# Copyright © 2022 jsonwebtoken.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ignoreRules = ["MissingOverride", "MissingSummary", "InconsistentCapitalization", "JavaUtilDate", "TypeParameterUnusedInFormals", "JavaLangClash", "InlineFormatString"]
ignoreFiles = """
impl/**
**/test/**
'''
"""
211 changes: 209 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,215 @@

### JJWT_RELEASE_VERSION

* Adds a simplified "starter" jar that automatically pulls in `jjwt-api`, `jjwt-impl` and `jjwt-jackson`, useful when
upgrading from the older `io.jsonwebtoken:jjwt:*` to the project's current flexible module structure.
This is a big release! JJWT now fully supports Encrypted JSON Web Tokens (JWE) and JSON Web Keys (JWK)! See the
sections below enumerating all new features as well as important notes on breaking changes or backwards-incompatible
changes made in preparation for the upcoming 1.0 release.

#### Simplified Starter Jar

Those upgrading to new modular JJWT versions from old single-jar versions will transparently obtain everything
they need in their Maven, Gradle or Android projects.

JJWT's early releases had one and only one .jar: `jjwt.jar`. Later releases moved to a modular design with 'api' and
'impl' jars including 'plugin' jars for Jackson, GSON, org.json, etc. Some users upgrading from the earlier single
jar to JJWT's later versions have been frustrated by being forced to learn how to configure the more modular .jars.

This release re-introduces the `jjwt.jar` artifact again, but this time it is simply an empty .jar with Maven
metadata that will automatically transitively download the following into a project, retaining the old single-jar
behavior:
* `jjwt-api.jar`
* `jjwt-impl.jar`
* `jjwt-jackson.jar`

Naturally, developers are still encouraged to configure the modular .jars as described in JJWT's documentation for
greater control and to enable their preferred JSON parser, but this stop-gap should help those unaware when upgrading.

#### JSON Web Encryption (JWE) Support!

This has been a long-awaited feature for JJWT, years in the making, and it is quite extensive - so many encryption
algorithms and key management algorithms are defined by the JWA specification, and new API concepts had to be
introduced for all of them, as well as extensive testing with RFC-defined test vectors. The wait is over!
All JWA-defined encryption algorithms and key management algorithms are fully implemented and supported and
available immediately. For example:

```java
AeadAlgorithm enc = Jwts.ENC.A256GCM;
SecretKey key = enc.keyBuilder().build();
String compact = Jwts.builder().setSubject("Joe").encryptWith(key, enc).compact();

Jwe<Claims> jwe = Jwts.parserBuilder().decryptWith(key).build().parseClaimsJwe(compact);
```

Many other RSA and Elliptic Curve examples are in the full README documentation.

#### JSON Web Key (JWK) Support!

Representing cryptographic keys - SecretKeys, RSA Public and Private Keys, Elliptic Curve Public and
Private keys - as fully encoded JSON objects according to the JWK specification - is now fully implemented and
supported. The new `Jwks` utility class exists to create JWK builders and parsers as desired. For example:

```java
SecretKey key = Jwts.SIG.HS256.keyBuilder().build();
SecretJwk jwk = Jwks.builder().forKey(key).build();
assert key.equals(jwk.toKey());

// or if receiving a JWK string:
Jwk<?> parsedJwk = Jwks.parser().build().parse(jwkString);
assert jwk.equals(parsedJwk);
assert key.equals(parsedJwk.toKey());
```

Many JJWT users won't need to use JWKs explicitly, but some JWA Key Management Algorithms (and lots of RFC test
vectors) utilize JWKs when transmitting JWEs. As this was required by JWE, it is now implemented in full for
JWE use as well as general-purpose JWK support.

#### Better PKCS11 and Hardware Security Module (HSM) support

Previous versions of JJWT enforced that Private Keys implemented the `RSAKey` and `ECKey` interfaces to enforce key
length requirements. With this release, JJWT will still perform those checks when those data types are available,
but if not, as is common with keys from PKCS11 and HSM KeyStores, JJWT will still allow those Keys to be used,
expecting the underlying Security Provider to enforce any key requirements. This should reduce or eliminate any
custom code previously written to extend JJWT to use keys from those KeyStores or Providers.

#### Custom Signature Algorithms

The `io.jsonwebtoken.SignatureAlgorithm` enum has been deprecated in favor of new
`io.jsonwebtoken.security.SecureDigestAlgorithm`, `io.jsonwebtoken.security.MacAlgorithm`, and
`io.jsonwebtoken.security.SignatureAlgorithm` interfaces to allow custom algorithm implementations. The new
`SIG` constant in the `Jwts` helper class is a registry of all standard JWS algorithms as expected, exactly like the
old enum. This change was made because enums are a static concept by design and cannot
support custom values: those who wanted to use custom signature algorithms could not do so until now. The new
interface now allows anyone to plug in and support custom algorithms with JJWT as desired.

#### KeyBuilder and KeyPairBuilder

Because the `io.jsonwebtoken.security.Keys#secretKeyFor` and `io.jsonwebtoken.security.Keys#keyPairFor` methods
accepted the now-deprecated `io.jsonwebtoken.SignatureAlgorithm` enum, they have also been deprecated in favor of
calling new `keyBuilder()` or `keyPairBuilder()` methods on `MacAlgorithm` and `SignatureAlgorithm` instances directly.
For example:

```java
SecretKey key = Jwts.SIG.HS256.keyBuilder().build();
KeyPair pair = Jwts.SIG.RS256.keyPairBuilder().build();
```

The builders allow for customization of the JCA `Provider` and `SecureRandom` during Key or KeyPair generation if desired, whereas
the old enum-based static utility methods did not.

#### Preparation for 1.0

Now that the JWE and JWK specifications are implemented, only a few things remain for JJWT to be considered at
version 1.0. We have been waiting to apply the 1.0 release version number until the entire set of JWT specifications
are fully supported and we drop JDK 7 support (to allow users to use JDK 8 APIs). To that end, we have had to
deprecate some concepts, or in some rare cases, completely break backwards compatibility to ensure the transition to
1.0 (and JDK 8 APIs) are possible. Any backwards-incompatible changes are listed in the next section below.

#### Backwards Compatibility Breaking Changes, Warnings and Deprecations

* `io.jsonwebtoken.Jwts`'s `header(Map)`, `jwsHeader()` and `jwsHeader(Map)` methods have been deprecated in favor
of the new `header()` builder-based method to support method chaining and dynamic Header type creation.


* `io.jsonwebtoken.Jwt`'s `getBody()` method has been deprecated in favor of a new `getPayload()` method to
reflect correct JWT specification nomenclature/taxonomy.


* `io.jsonwebtoken.CompressionCodec` now inherits a new `io.jsonwebtoken.Identifiable` interface and its `getId()`
method is preferred over the now-deprecated `getAlgorithmName()` method. This is to guarantee API congruence with
all other JWT-identifiable algorithm names that can be set as a header value.


* `io.jsonwebtoken.Header` has been changed to accept a type-parameter for sub-type method return values, i.e.
`io.jsonwebtoken.Header<T extends Header>` and a new `io.jsonwebtoken.UnprotectedHeader` interface has been
introduced to represent the concrete type of header without integrity protection. This new `UnprotectedHeader` is
to be used where the previous generic `Header` (non-`JweHeader` and non-`JwsHeader`) interface was used.


* Accordingly, the `Jwts.header()` and `Jwts.header(Map<String,?>)` now return instances of `UnprotectedHeader` instead
of just `Header`.


#### Breaking Changes

* **JWTs that do not contain JSON Claims now have a payload type of `byte[]` instead of `String`** (that is,
`Jwt<byte[]>` instead of `Jwt<String>`). This is because JWTs, especially when used with the
`cty` (Content Type) header, are capable of handling _any_ type of payload, not just Strings. The previous JJWT
releases didn't account for this, and now the API accurately reflects the JWT RFC specification payload
capabilities. Additionally, the name of `plaintext` has been changed to `content` in method names and JavaDoc to
reflect this taxonomy. This change has impacted the following JJWT APIs:

* The `JwtBuilder`'s `setPayload(String)` method has been deprecated in favor of two new methods:

* `setContent(byte[])`, and
* `setContent(byte[], String contentType)`

These new methods allow any kind of content
within a JWT, not just Strings. The existing `setPayload(String)` method implementation has been changed to
delegate to this new `setContent(byte[])` method with the argument's UTF-8 bytes, for example
`setContent(payloadString.getBytes(StandardCharsets.UTF_8))`.

* The `JwtParser`'s `Jwt<Header, String> parsePlaintextJwt(String plaintextJwt)` and
`Jws<String> parsePlaintextJws(String plaintextJws)` methods have been changed to
`Jwt<UnprotectedHeader, byte[]> parseContentJwt(String plaintextJwt)` and
`Jws<byte[]> parseContentJws(String plaintextJws)` respectively.

* `JwtHandler`'s `onPlaintextJwt(String)` and `onPlaintextJws(String)` methods have been changed to
`onContentJwt(byte[])` and `onContentJws(byte[])` respectively.

* `io.jsonwebtoken.JwtHandlerAdapter` has been changed to reflect the above-mentioned name and `String`-to-`byte[]`
argument changes, as well adding the `abstract` modifier. This class was never intended
to be instantiated directly, and is provided for subclassing only. The missing modifier has been added to ensure
the class is used as it had always been intended.

* `io.jsonwebtoken.SigningKeyResolver`'s `resolveSigningKey(JwsHeader, String)` method has been changed to
`resolveSigningKey(JwsHeader, byte[])`.

* `io.jsonwebtoken.Jwts`'s `parser()` method deprecated 4 years ago has been renamed to `legacyParser()` to
allow an updated `parser()` method to return a `JwtParserBuilder` instead of a direct `JwtParser` instance.
This `legacyParser()` method will be removed entirely for the 1.0 release - please change your code to use the
updated `parser()` method that returns a builder as soon as possible.

* `io.jsonwebtoken.Jwts`'s `header()` method has been renamed to `unprotectedHeader()` to allow a newer/updated
`header()` method to return a `DynamicHeaderBuilder` instead of a direct `Header` instance. This new method /
return value is the recommended approach for building headers, as it will dynamically create an `UnprotectedHeader`,
`JwsHeader` or `JweHeader` automatically based on builder state.

* `io.jsonwebtoken.Jwts`'s `headerBuilder()` method has been renamed to `header()` and returns a
`DynamicHeaderBuilder` instead of a direct `Header` instance. This builder method is the recommended approach
for building headers in the future, as it will dynamically create an `UnprotectedHeader`, `JwsHeader` or `JweHeader`
automatically based on builder state.

* `io.jsonwebtoken.Jwts`'s `header()` method now returns a `DynamicHeaderBuilder` instead of a
direct `Header` instance. This new method / return value is the recommended approach for building headers
in the future, as it will dynamically create an `UnprotectedHeader`, `JwsHeader` or `JweHeader` automatically
based on builder state.

* Prior to this release, if there was a serialization problem when serializing the JWT Header, an `IllegalStateException`
was thrown. If there was a problem when serializing the JWT claims, an `IllegalArgumentException` was
thrown. This has been changed up to ensure consistency: any serialization error with either headers or claims
will now throw a `io.jsonwebtoken.io.SerializationException`.


* Parsing of unsecured JWTs (`alg` header of `none`) are now disabled by default as mandated by
[RFC 7518, Section 3.6](https://www.rfc-editor.org/rfc/rfc7518.html#section-3.6). If you require parsing of
unsecured JWTs, you must call the `enableUnsecuredJws` method on the `JwtParserBuilder`, but note the security
implications mentioned in that method's JavaDoc before doing so.


* `io.jsonwebtoken.gson.io.GsonSerializer` now requires `Gson` instances that have a registered
`GsonSupplierSerializer` type adapter, for example:
```java
new GsonBuilder()
.registerTypeHierarchyAdapter(io.jsonwebtoken.lang.Supplier.class, GsonSupplierSerializer.INSTANCE)
.disableHtmlEscaping().create();
```
This is to ensure JWKs have `toString()` and application log safety (do not print secure material), but still
serialize to JSON correctly.

* `io.jsonwebtoken.InvalidClaimException` and it's two subclasses (`IncorrectClaimException` and `MissingClaimException`)
were previously mutable, allowing the corresponding claim name and claim value to be set on the exception after
creation. These should have always been immutable without those setters (just getters), and this was a previous
implementation oversight. This release has ensured they are immutable without the setters.

### 0.11.5

Expand Down
Loading