diff --git a/.gitignore b/.gitignore index bc177c84..d0ebf14a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ target/ .classpath .project .settings + +.clover + +.java-version diff --git a/.travis.yml b/.travis.yml index 0d370bd3..3f4905b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ language: java jdk: - openjdk7 - oraclejdk8 + - oraclejdk9 before_install: - export BUILD_COVERAGE="$([ $TRAVIS_JDK_VERSION == 'oraclejdk8' ] && echo 'true')" diff --git a/CHANGELOG.md b/CHANGELOG.md index 697cb256..5f68af3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Release Notes +### 0.9.0 + +This is a minor release that includes changes to dependencies and plugins to allow for building jjwt with Java 9. +Javadocs in a few classes were updated as well to support proper linting in both Java 8 and Java 9. + ### 0.8.0 This is a minor feature enhancement, dependency version update and build update release. We switched from Jacoco to diff --git a/pom.xml b/pom.xml index f313eff4..06df1c35 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ io.jsonwebtoken jjwt - 0.9.0-SNAPSHOT + 0.10.0-SNAPSHOT JSON Web Token support for the JVM jar @@ -80,7 +80,7 @@ 3.0.2 3.6.1 - 1.6 + 1.7 UTF-8 ${user.name}-${maven.build.timestamp} @@ -92,10 +92,11 @@ 2.4.11 1.2.3 - 3.4 + 3.5 4.12 - 1.6.6 - 2.19.1 + 2.0.0-beta.5 + 2.20.1 + 2.20.1 4.2.0 @@ -267,10 +268,16 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + org.apache.maven.plugins maven-failsafe-plugin - 2.20 + ${failsafe.plugin.version} **/*IT.java @@ -302,10 +309,10 @@ io/jsonwebtoken/lang/* - 100% - 100% - 100% - 100% + 95% + 92.5% + 94.4% + 93.3 @@ -363,6 +370,7 @@ + org.jwtk.coveralls @@ -370,19 +378,32 @@ 4.4.0 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + + commons-lang + commons-lang + 2.6 + + + - - jdk8 - - 1.8 - - - - -Xdoclint:none - - sign @@ -433,6 +454,14 @@ + + + + commons-lang + commons-lang + 2.6 + + diff --git a/src/main/java/io/jsonwebtoken/Claims.java b/src/main/java/io/jsonwebtoken/Claims.java index 22a3e364..67fb4486 100644 --- a/src/main/java/io/jsonwebtoken/Claims.java +++ b/src/main/java/io/jsonwebtoken/Claims.java @@ -31,7 +31,7 @@ import java.util.Map; * claims.{@link Map#put(Object, Object) put}("someKey", "someValue"); * * - *

Creation

+ *

Creation

* *

It is easiest to create a {@code Claims} instance by calling one of the * {@link Jwts#claims() JWTs.claims()} factory methods.

diff --git a/src/main/java/io/jsonwebtoken/CompressionCodecs.java b/src/main/java/io/jsonwebtoken/CompressionCodecs.java index 779f9893..4374197a 100644 --- a/src/main/java/io/jsonwebtoken/CompressionCodecs.java +++ b/src/main/java/io/jsonwebtoken/CompressionCodecs.java @@ -24,7 +24,7 @@ public final class CompressionCodecs { /** * Codec implementing the gzip compression algorithm. - *
Compatibility Warning
+ *

Compatibility Warning

*

This is not a standard JWA compression algorithm. Be sure to use this only when you are confident * that all parties accessing the token support the gzip algorithm.

*

If you're concerned about compatibility, the {@link #DEFLATE DEFLATE} code is JWA standards-compliant.

diff --git a/src/main/java/io/jsonwebtoken/Header.java b/src/main/java/io/jsonwebtoken/Header.java index 1d8ab9af..3eedd64a 100644 --- a/src/main/java/io/jsonwebtoken/Header.java +++ b/src/main/java/io/jsonwebtoken/Header.java @@ -30,7 +30,7 @@ import java.util.Map; * header.{@link Map#put(Object, Object) put}("headerParamName", "headerParamValue"); * * - *

Creation

+ *

Creation

* *

It is easiest to create a {@code Header} instance by calling one of the * {@link Jwts#header() JWTs.header()} factory methods.

@@ -113,7 +113,7 @@ public interface Header> extends Map { * Returns the JWT zip * (Compression Algorithm) header parameter value or {@code null} if not present. * - *
Compatiblity Note
+ *

Compatiblity Note

* *

While the JWT family of specifications only defines the zip header in the JWE * (JSON Web Encryption) specification, JJWT will also support compression for JWS as well if you choose to use it. @@ -130,8 +130,12 @@ public interface Header> extends Map { * Sets the JWT zip * (Compression Algorithm) header parameter value. A {@code null} value will remove * the property from the JSON map. + *

+ *

The compression algorithm is NOT part of the JWT specification + * and must be used carefully since, is not expected that other libraries (including previous versions of this one) + * be able to deserialize a compressed JTW body correctly.

* - *
Compatiblity Note
+ *

Compatiblity Note

* *

While the JWT family of specifications only defines the zip header in the JWE * (JSON Web Encryption) specification, JJWT will also support compression for JWS as well if you choose to use it. diff --git a/src/main/java/io/jsonwebtoken/JwtBuilder.java b/src/main/java/io/jsonwebtoken/JwtBuilder.java index 782352f0..13df44fa 100644 --- a/src/main/java/io/jsonwebtoken/JwtBuilder.java +++ b/src/main/java/io/jsonwebtoken/JwtBuilder.java @@ -368,7 +368,7 @@ public interface JwtBuilder extends ClaimsMutator { * can be useful. For example, when embedding JWTs in URLs, some browsers may not support URLs longer than a * certain length. Using compression can help ensure the compact JWT fits within that length. However, NOTE:

* - *
Compatibility Warning
+ *

Compatibility Warning

* *

The JWT family of specifications defines compression only for JWE (JSON Web Encryption) * tokens. Even so, JJWT will also support compression for JWS tokens as well if you choose to use it. diff --git a/src/main/java/io/jsonwebtoken/JwtParser.java b/src/main/java/io/jsonwebtoken/JwtParser.java index c0fa1603..1dcdcf58 100644 --- a/src/main/java/io/jsonwebtoken/JwtParser.java +++ b/src/main/java/io/jsonwebtoken/JwtParser.java @@ -228,10 +228,10 @@ public interface JwtParser { * Sets the {@link CompressionCodecResolver} used to acquire the {@link CompressionCodec} that should be used to * decompress the JWT body. If the parsed JWT is not compressed, this resolver is not used. *

NOTE: Compression is not defined by the JWT Specification, and it is not expected that other libraries - * (including JJWT versions < 0.6.0) are able to consume a compressed JWT body correctly. This method is only - * useful if the compact JWT was compressed with JJWT >= 0.6.0 or another library that you know implements + * (including JJWT versions < 0.6.0) are able to consume a compressed JWT body correctly. This method is only + * useful if the compact JWT was compressed with JJWT >= 0.6.0 or another library that you know implements * the same behavior.

- *
Default Support
+ *

Default Support

*

JJWT's default {@link JwtParser} implementation supports both the * {@link io.jsonwebtoken.impl.compression.DeflateCompressionCodec DEFLATE} * and {@link io.jsonwebtoken.impl.compression.GzipCompressionCodec GZIP} algorithms by default - you do not need to diff --git a/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java b/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java index 33983d05..b55ebc32 100644 --- a/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java +++ b/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java @@ -130,6 +130,7 @@ public enum SignatureAlgorithm { * following table: * * + * * * * diff --git a/src/main/java/io/jsonwebtoken/SigningKeyResolver.java b/src/main/java/io/jsonwebtoken/SigningKeyResolver.java index b068db9d..fbd9887f 100644 --- a/src/main/java/io/jsonwebtoken/SigningKeyResolver.java +++ b/src/main/java/io/jsonwebtoken/SigningKeyResolver.java @@ -38,7 +38,7 @@ import java.security.Key; * *

A {@code SigningKeyResolver} is invoked once during parsing before the signature is verified.

* - *

SigningKeyResolverAdapter

+ *

SigningKeyResolverAdapter

* *

If you only need to resolve a signing key for a particular JWS (either a plaintext or Claims JWS), consider using * the {@link io.jsonwebtoken.SigningKeyResolverAdapter} and overriding only the method you need to support instead of diff --git a/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java b/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java index 1ce280bb..aa731e3d 100644 --- a/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java +++ b/src/main/java/io/jsonwebtoken/impl/crypto/MacProvider.java @@ -67,7 +67,7 @@ public abstract class MacProvider extends SignatureProvider { * according to the specified {@code SignatureAlgorithm} using the specified SecureRandom number generator. This * implementation returns secure-random key sizes as follows: * - *

Crypto Family
SignatureAlgorithm
+ *
Signature Algorithm Generated Key Size
* *
Key Sizes
Signature Algorithm Generated Key Size
HS256 256 bits (32 bytes)
HS384 384 bits (48 bytes)
HS512 512 bits (64 bytes)
* diff --git a/src/main/java/io/jsonwebtoken/impl/serialization/SerializationCodec.java b/src/main/java/io/jsonwebtoken/impl/serialization/SerializationCodec.java index a3c25357..bbd7d417 100644 --- a/src/main/java/io/jsonwebtoken/impl/serialization/SerializationCodec.java +++ b/src/main/java/io/jsonwebtoken/impl/serialization/SerializationCodec.java @@ -18,10 +18,11 @@ public interface SerializationCodec { /** * Deserialize a {@code byte[]} to an {@code object} of an specific {@code type} + * *

      * bytes[] serialized = ...
      * Map instance = serializationCodec.deserialize(serialized, Map.class);
-     * 
+     * 
* * @param bytes of the serialized object. * @param targetClass of the instance to return. diff --git a/src/main/java/io/jsonwebtoken/lang/Strings.java b/src/main/java/io/jsonwebtoken/lang/Strings.java index a93cf340..338803f9 100644 --- a/src/main/java/io/jsonwebtoken/lang/Strings.java +++ b/src/main/java/io/jsonwebtoken/lang/Strings.java @@ -438,7 +438,7 @@ public final class Strings { * Quote the given String with single quotes. * @param str the input String (e.g. "myString") * @return the quoted String (e.g. "'myString'"), - * or null if the input was null + * or null if the input was null */ public static String quote(String str) { return (str != null ? "'" + str + "'" : null); @@ -513,7 +513,7 @@ public final class Strings { /** * Extract the filename from the given path, - * e.g. "mypath/myfile.txt" -> "myfile.txt". + * e.g. "mypath/myfile.txt" -> "myfile.txt". * @param path the file path (may be null) * @return the extracted filename, or null if none */ @@ -527,7 +527,7 @@ public final class Strings { /** * Extract the filename extension from the given path, - * e.g. "mypath/myfile.txt" -> "txt". + * e.g. "mypath/myfile.txt" -> "txt". * @param path the file path (may be null) * @return the extracted filename extension, or null if none */ @@ -548,7 +548,7 @@ public final class Strings { /** * Strip the filename extension from the given path, - * e.g. "mypath/myfile.txt" -> "mypath/myfile". + * e.g. "mypath/myfile.txt" -> "mypath/myfile". * @param path the file path (may be null) * @return the path with stripped filename extension, * or null if none