From afcd88983252b249204d53830dd03884050b41af Mon Sep 17 00:00:00 2001 From: lhazlewood <121180+lhazlewood@users.noreply.github.com> Date: Sun, 28 Jan 2024 16:52:21 -0800 Subject: [PATCH] 0.12.4 staging (#913) Released 0.12.4, with the following additional changes: - Added 0.12.4 release version references - Added CI 'workflow_dispatch' event trigger - Changed git url from ssh to https --- .github/workflows/ci.yml | 1 + README.md | 26 +++++++++---------- api/pom.xml | 2 +- extensions/gson/pom.xml | 2 +- extensions/jackson/pom.xml | 2 +- .../jackson/io/JacksonDeserializerTest.groovy | 1 + extensions/orgjson/pom.xml | 2 +- extensions/pom.xml | 2 +- impl/pom.xml | 2 +- .../impl/DelegatingClaimsMutator.java | 4 +-- .../io/jsonwebtoken/impl/lang/Services.java | 1 + .../impl/security/AesAlgorithm.java | 5 ++++ .../security/AbstractEcJwkFactoryTest.groovy | 1 + .../security/Pbes2HsAkwAlgorithmTest.groovy | 3 +++ .../impl/security/SecretJwkFactoryTest.groovy | 4 +++ pom.xml | 6 ++--- tdjar/pom.xml | 2 +- 17 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 488dd5ed7..4e83275dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI on: + workflow_dispatch: pull_request: # all pull requests push: branches: diff --git a/README.md b/README.md index 374ea0b18..794f95b5c 100644 --- a/README.md +++ b/README.md @@ -543,18 +543,18 @@ If you're building a (non-Android) JDK project, you will want to define the foll io.jsonwebtoken jjwt-api - 0.12.3 + 0.12.4 io.jsonwebtoken jjwt-impl - 0.12.3 + 0.12.4 runtime io.jsonwebtoken jjwt-jackson - 0.12.3 + 0.12.4 runtime ``` @@ -3049,7 +3049,7 @@ scope which is the typical JJWT default). That is: ```groovy dependencies { - implementation 'io.jsonwebtoken:jjwt-jackson:0.12.3' + implementation 'io.jsonwebtoken:jjwt-jackson:0.12.4' } ``` @@ -3157,7 +3157,7 @@ scope which is the typical JJWT default). That is: io.jsonwebtoken jjwt-gson - 0.12.3 + 0.12.4 compile ``` @@ -3166,7 +3166,7 @@ scope which is the typical JJWT default). That is: ```groovy dependencies { - implementation 'io.jsonwebtoken:jjwt-gson:0.12.3' + implementation 'io.jsonwebtoken:jjwt-gson:0.12.4' } ``` diff --git a/api/pom.xml b/api/pom.xml index 80a49db9b..6ee645b6d 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../pom.xml diff --git a/extensions/gson/pom.xml b/extensions/gson/pom.xml index fb17afece..4b3a296ef 100644 --- a/extensions/gson/pom.xml +++ b/extensions/gson/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../../pom.xml diff --git a/extensions/jackson/pom.xml b/extensions/jackson/pom.xml index 658ebd679..00f09665d 100644 --- a/extensions/jackson/pom.xml +++ b/extensions/jackson/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../../pom.xml diff --git a/extensions/jackson/src/test/groovy/io/jsonwebtoken/jackson/io/JacksonDeserializerTest.groovy b/extensions/jackson/src/test/groovy/io/jsonwebtoken/jackson/io/JacksonDeserializerTest.groovy index 2363057de..b21667441 100644 --- a/extensions/jackson/src/test/groovy/io/jsonwebtoken/jackson/io/JacksonDeserializerTest.groovy +++ b/extensions/jackson/src/test/groovy/io/jsonwebtoken/jackson/io/JacksonDeserializerTest.groovy @@ -123,6 +123,7 @@ class JacksonDeserializerTest { /** * Asserts https://github.com/jwtk/jjwt/issues/877 + * @since 0.12.4 */ @Test void testStrictDuplicateDetection() { diff --git a/extensions/orgjson/pom.xml b/extensions/orgjson/pom.xml index 0936fe406..f37fe1b04 100644 --- a/extensions/orgjson/pom.xml +++ b/extensions/orgjson/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../../pom.xml diff --git a/extensions/pom.xml b/extensions/pom.xml index e04955207..0ee8810ba 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../pom.xml diff --git a/impl/pom.xml b/impl/pom.xml index bb7fb61aa..7c1f137d8 100644 --- a/impl/pom.xml +++ b/impl/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../pom.xml diff --git a/impl/src/main/java/io/jsonwebtoken/impl/DelegatingClaimsMutator.java b/impl/src/main/java/io/jsonwebtoken/impl/DelegatingClaimsMutator.java index 7740fe275..9c408a154 100644 --- a/impl/src/main/java/io/jsonwebtoken/impl/DelegatingClaimsMutator.java +++ b/impl/src/main/java/io/jsonwebtoken/impl/DelegatingClaimsMutator.java @@ -47,7 +47,7 @@ T put(Parameter param, F value) { return self(); } - @Override + @Override // override starting in 0.12.4 public Object put(String key, Object value) { if (AUDIENCE_STRING.getId().equals(key)) { // https://github.com/jwtk/jjwt/issues/890 if (value instanceof String) { @@ -63,7 +63,7 @@ public Object put(String key, Object value) { return super.put(key, value); } - @Override + @Override // overridden starting in 0.12.4 public void putAll(Map m) { if (m == null) return; for (Map.Entry entry : m.entrySet()) { diff --git a/impl/src/main/java/io/jsonwebtoken/impl/lang/Services.java b/impl/src/main/java/io/jsonwebtoken/impl/lang/Services.java index 6125ebc09..f0c056699 100644 --- a/impl/src/main/java/io/jsonwebtoken/impl/lang/Services.java +++ b/impl/src/main/java/io/jsonwebtoken/impl/lang/Services.java @@ -65,6 +65,7 @@ private Services() { * @param The type of the SPI * @return The first available instance of the service. * @throws UnavailableImplementationException When no implementation of the SPI class can be found. + * @since 0.12.4 */ public static T get(Class spi) { // TODO: JDK8, replace this find/putIfAbsent logic with ConcurrentMap.computeIfAbsent diff --git a/impl/src/main/java/io/jsonwebtoken/impl/security/AesAlgorithm.java b/impl/src/main/java/io/jsonwebtoken/impl/security/AesAlgorithm.java index a7d68117a..32355571f 100644 --- a/impl/src/main/java/io/jsonwebtoken/impl/security/AesAlgorithm.java +++ b/impl/src/main/java/io/jsonwebtoken/impl/security/AesAlgorithm.java @@ -55,6 +55,11 @@ abstract class AesAlgorithm extends CryptoAlgorithm implements KeyBuilderSupplie protected final int tagBitLength; protected final boolean gcm; + /** + * Ensures {@code keyBitLength is a valid AES key length} + * @param keyBitLength the key length (in bits) to check + * @since 0.12.4 + */ static void assertKeyBitLength(int keyBitLength) { if (keyBitLength == 128 || keyBitLength == 192 || keyBitLength == 256) return; // valid String msg = "Invalid AES key length: " + Bytes.bitsMsg(keyBitLength) + ". AES only supports " + diff --git a/impl/src/test/groovy/io/jsonwebtoken/impl/security/AbstractEcJwkFactoryTest.groovy b/impl/src/test/groovy/io/jsonwebtoken/impl/security/AbstractEcJwkFactoryTest.groovy index fbbd144db..e11e0e842 100644 --- a/impl/src/test/groovy/io/jsonwebtoken/impl/security/AbstractEcJwkFactoryTest.groovy +++ b/impl/src/test/groovy/io/jsonwebtoken/impl/security/AbstractEcJwkFactoryTest.groovy @@ -44,6 +44,7 @@ class AbstractEcJwkFactoryTest { /** * Asserts correct behavior per https://github.com/jwtk/jjwt/issues/901 + * @since 0.12.4 */ @Test void fieldElementByteArrayLength() { diff --git a/impl/src/test/groovy/io/jsonwebtoken/impl/security/Pbes2HsAkwAlgorithmTest.groovy b/impl/src/test/groovy/io/jsonwebtoken/impl/security/Pbes2HsAkwAlgorithmTest.groovy index 36142646e..242308bf3 100644 --- a/impl/src/test/groovy/io/jsonwebtoken/impl/security/Pbes2HsAkwAlgorithmTest.groovy +++ b/impl/src/test/groovy/io/jsonwebtoken/impl/security/Pbes2HsAkwAlgorithmTest.groovy @@ -53,6 +53,9 @@ class Pbes2HsAkwAlgorithmTest { } } + /** + * @since 0.12.4 + */ @Test void testExceedsMaxIterations() { for (Pbes2HsAkwAlgorithm alg : ALGS) { diff --git a/impl/src/test/groovy/io/jsonwebtoken/impl/security/SecretJwkFactoryTest.groovy b/impl/src/test/groovy/io/jsonwebtoken/impl/security/SecretJwkFactoryTest.groovy index 6af9c1384..4eeb81062 100644 --- a/impl/src/test/groovy/io/jsonwebtoken/impl/security/SecretJwkFactoryTest.groovy +++ b/impl/src/test/groovy/io/jsonwebtoken/impl/security/SecretJwkFactoryTest.groovy @@ -131,6 +131,9 @@ class SecretJwkFactoryTest { assertEquals 'AES', result.toKey().getAlgorithm() } + /** + * @since 0.12.4 + */ @Test // 'oct' type, but 'alg' value is not a secret key algorithm (and therefore malformed) void testMismatchedAlgorithm() { @@ -176,6 +179,7 @@ class SecretJwkFactoryTest { * * This test asserts this allowed behavior per https://github.com/jwtk/jjwt/issues/905 * @see JJWT Issue 905 + * @since 0.12.4 */ @Test void testAllowedKeyLengths() { diff --git a/pom.xml b/pom.xml index 69e29a101..a49bb2a1f 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT JJWT JSON Web Token support for the JVM and Android pom @@ -50,8 +50,8 @@ scm:git:https://github.com/jwtk/jjwt.git - scm:git:git@github.com:jwtk/jjwt.git - git@github.com:jwtk/jjwt.git + scm:git:https://github.com/jwtk/jjwt.git + https://github.com/jwtk/jjwt.git HEAD diff --git a/tdjar/pom.xml b/tdjar/pom.xml index 52cbbc2af..c22c9c559 100644 --- a/tdjar/pom.xml +++ b/tdjar/pom.xml @@ -21,7 +21,7 @@ io.jsonwebtoken jjwt-root - 0.12.4-SNAPSHOT + 0.12.5-SNAPSHOT ../pom.xml