-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry pick from c62d012: javadoc cleanup, compression backwards comp…
…atibility change cherry pick from c62d012: javadoc cleanup, compression backwards compatibility change 113: increased code coverage threshold for DefaultJwtParser and DefaultJwtBuilder
- Loading branch information
1 parent
3dfae9a
commit e392524
Showing
17 changed files
with
178 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.jsonwebtoken; | ||
|
||
import io.jsonwebtoken.impl.compression.DeflateCompressionCodec; | ||
import io.jsonwebtoken.impl.compression.GzipCompressionCodec; | ||
|
||
/** | ||
* Provides default implementations of the {@link CompressionCodec} interface. | ||
* | ||
* @see #DEFLATE | ||
* @see #GZIP | ||
* @since 0.7.0 | ||
*/ | ||
public final class CompressionCodecs { | ||
|
||
private static final CompressionCodecs INSTANCE = new CompressionCodecs(); | ||
|
||
private CompressionCodecs() {} //prevent external instantiation | ||
|
||
/** | ||
* Codec implementing the <a href="https://tools.ietf.org/html/rfc7518">JWA</a> standard | ||
* <a href="https://en.wikipedia.org/wiki/DEFLATE">deflate</a> compression algorithm | ||
*/ | ||
public static final CompressionCodec DEFLATE = new DeflateCompressionCodec(); | ||
|
||
/** | ||
* Codec implementing the <a href="https://en.wikipedia.org/wiki/Gzip">gzip</a> compression algorithm. | ||
* <h5>Compatibility Warning</h5> | ||
* <p><b>This is not a standard JWA compression algorithm</b>. Be sure to use this only when you are confident | ||
* that all parties accessing the token support the gzip algorithm.</p> | ||
* <p>If you're concerned about compatibility, the {@link #DEFLATE DEFLATE} code is JWA standards-compliant.</p> | ||
*/ | ||
public static final CompressionCodec GZIP = new GzipCompressionCodec(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.jsonwebtoken.lang; | ||
|
||
/** | ||
* @since 0.6 | ||
*/ | ||
public final class Arrays { | ||
|
||
//for code coverage | ||
private static final Arrays INSTANCE = new Arrays(); | ||
|
||
private Arrays(){} | ||
|
||
public static int length(byte[] bytes) { | ||
return bytes != null ? bytes.length : 0; | ||
} | ||
|
||
public static byte[] clean(byte[] bytes) { | ||
return length(bytes) > 0 ? bytes : null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.