• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jwtk / jjwt / #1685

23 Apr 2025 08:08PM CUT coverage: 100.0%. Remained the same
#1685

push

github

web-flow
Updated test case to verify PR #974. (#992)

6858 of 6858 relevant lines covered (100.0%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/api/src/main/java/io/jsonwebtoken/CompressionCodecResolver.java
1
/*
2
 * Copyright (C) 2015 jsonwebtoken.io
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package io.jsonwebtoken;
17

18
/**
19
 * Looks for a JWT {@code zip} header, and if found, returns the corresponding {@link CompressionCodec} the parser
20
 * can use to decompress the JWT body.
21
 *
22
 * <p>JJWT's default {@link JwtParser} implementation supports both the
23
 * {@link Jwts.ZIP#DEF DEFLATE} and {@link Jwts.ZIP#GZIP GZIP} algorithms by default - you do not need to
24
 * specify a {@code CompressionCodecResolver} in these cases.</p>
25
 *
26
 * <p>However, if you want to use a compression algorithm other than {@code DEF} or {@code GZIP}, you can implement
27
 * your own {@link CompressionCodecResolver} and specify that when
28
 * {@link io.jsonwebtoken.JwtBuilder#compressWith(io.jsonwebtoken.io.CompressionAlgorithm) building} and
29
 * {@link io.jsonwebtoken.JwtParserBuilder#setCompressionCodecResolver(CompressionCodecResolver) parsing} JWTs.</p>
30
 *
31
 * @see JwtParserBuilder#setCompressionCodecResolver(CompressionCodecResolver)
32
 * @see JwtParserBuilder#zip()
33
 * @since 0.6.0
34
 * @deprecated in favor of {@link JwtParserBuilder#zip()}
35
 */
36
@SuppressWarnings("DeprecatedIsStillUsed")
37
@Deprecated
38
public interface CompressionCodecResolver {
39

40
    /**
41
     * Looks for a JWT {@code zip} header, and if found, returns the corresponding {@link CompressionCodec} the parser
42
     * can use to decompress the JWT body.
43
     *
44
     * @param header of the JWT
45
     * @return CompressionCodec matching the {@code zip} header, or null if there is no {@code zip} header.
46
     * @throws CompressionException if a {@code zip} header value is found and not supported.
47
     */
48
    CompressionCodec resolveCompressionCodec(Header header) throws CompressionException;
49

50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc