Skip to content

Commit a8865e2

Browse files
committed
Java: Cleanup jwt stubs.
1 parent b1a3633 commit a8865e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+6
-7813
lines changed

java/ql/test/experimental/stubs/jwtk-jjwt-0.11.2/io/jsonwebtoken/ClaimJwtException.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,19 @@
2222
*/
2323
public abstract class ClaimJwtException extends JwtException {
2424

25-
public static final String INCORRECT_EXPECTED_CLAIM_MESSAGE_TEMPLATE = "Expected %s claim to be: %s, but was: %s.";
26-
public static final String MISSING_EXPECTED_CLAIM_MESSAGE_TEMPLATE = "Expected %s claim to be: %s, but was not present in the JWT claims.";
27-
28-
private final Header header;
29-
30-
private final Claims claims;
31-
3225
protected ClaimJwtException(Header header, Claims claims, String message) {
3326
super(message);
34-
this.header = header;
35-
this.claims = claims;
3627
}
3728

3829
protected ClaimJwtException(Header header, Claims claims, String message, Throwable cause) {
3930
super(message, cause);
40-
this.header = header;
41-
this.claims = claims;
4231
}
4332

4433
public Claims getClaims() {
45-
return claims;
34+
return null;
4635
}
4736

4837
public Header getHeader() {
49-
return header;
38+
return null;
5039
}
5140
}

java/ql/test/experimental/stubs/jwtk-jjwt-0.11.2/io/jsonwebtoken/Claims.java

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -40,152 +40,4 @@
4040
*/
4141
public interface Claims extends Map<String, Object>, ClaimsMutator<Claims> {
4242

43-
/** JWT {@code Issuer} claims parameter name: <code>"iss"</code> */
44-
public static final String ISSUER = "iss";
45-
46-
/** JWT {@code Subject} claims parameter name: <code>"sub"</code> */
47-
public static final String SUBJECT = "sub";
48-
49-
/** JWT {@code Audience} claims parameter name: <code>"aud"</code> */
50-
public static final String AUDIENCE = "aud";
51-
52-
/** JWT {@code Expiration} claims parameter name: <code>"exp"</code> */
53-
public static final String EXPIRATION = "exp";
54-
55-
/** JWT {@code Not Before} claims parameter name: <code>"nbf"</code> */
56-
public static final String NOT_BEFORE = "nbf";
57-
58-
/** JWT {@code Issued At} claims parameter name: <code>"iat"</code> */
59-
public static final String ISSUED_AT = "iat";
60-
61-
/** JWT {@code JWT ID} claims parameter name: <code>"jti"</code> */
62-
public static final String ID = "jti";
63-
64-
/**
65-
* Returns the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.1">
66-
* <code>iss</code></a> (issuer) value or {@code null} if not present.
67-
*
68-
* @return the JWT {@code iss} value or {@code null} if not present.
69-
*/
70-
String getIssuer();
71-
72-
/**
73-
* {@inheritDoc}
74-
*/
75-
@Override //only for better/targeted JavaDoc
76-
Claims setIssuer(String iss);
77-
78-
/**
79-
* Returns the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.2">
80-
* <code>sub</code></a> (subject) value or {@code null} if not present.
81-
*
82-
* @return the JWT {@code sub} value or {@code null} if not present.
83-
*/
84-
String getSubject();
85-
86-
/**
87-
* {@inheritDoc}
88-
*/
89-
@Override //only for better/targeted JavaDoc
90-
Claims setSubject(String sub);
91-
92-
/**
93-
* Returns the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.3">
94-
* <code>aud</code></a> (audience) value or {@code null} if not present.
95-
*
96-
* @return the JWT {@code aud} value or {@code null} if not present.
97-
*/
98-
String getAudience();
99-
100-
/**
101-
* {@inheritDoc}
102-
*/
103-
@Override //only for better/targeted JavaDoc
104-
Claims setAudience(String aud);
105-
106-
/**
107-
* Returns the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.4">
108-
* <code>exp</code></a> (expiration) timestamp or {@code null} if not present.
109-
*
110-
* <p>A JWT obtained after this timestamp should not be used.</p>
111-
*
112-
* @return the JWT {@code exp} value or {@code null} if not present.
113-
*/
114-
Date getExpiration();
115-
116-
/**
117-
* {@inheritDoc}
118-
*/
119-
@Override //only for better/targeted JavaDoc
120-
Claims setExpiration(Date exp);
121-
122-
/**
123-
* Returns the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.5">
124-
* <code>nbf</code></a> (not before) timestamp or {@code null} if not present.
125-
*
126-
* <p>A JWT obtained before this timestamp should not be used.</p>
127-
*
128-
* @return the JWT {@code nbf} value or {@code null} if not present.
129-
*/
130-
Date getNotBefore();
131-
132-
/**
133-
* {@inheritDoc}
134-
*/
135-
@Override //only for better/targeted JavaDoc
136-
Claims setNotBefore(Date nbf);
137-
138-
/**
139-
* Returns the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.6">
140-
* <code>iat</code></a> (issued at) timestamp or {@code null} if not present.
141-
*
142-
* <p>If present, this value is the timestamp when the JWT was created.</p>
143-
*
144-
* @return the JWT {@code iat} value or {@code null} if not present.
145-
*/
146-
Date getIssuedAt();
147-
148-
/**
149-
* {@inheritDoc}
150-
*/
151-
@Override //only for better/targeted JavaDoc
152-
Claims setIssuedAt(Date iat);
153-
154-
/**
155-
* Returns the JWTs <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.7">
156-
* <code>jti</code></a> (JWT ID) value or {@code null} if not present.
157-
*
158-
* <p>This value is a CaSe-SenSiTiVe unique identifier for the JWT. If available, this value is expected to be
159-
* assigned in a manner that ensures that there is a negligible probability that the same value will be
160-
* accidentally
161-
* assigned to a different data object. The ID can be used to prevent the JWT from being replayed.</p>
162-
*
163-
* @return the JWT {@code jti} value or {@code null} if not present.
164-
*/
165-
String getId();
166-
167-
/**
168-
* {@inheritDoc}
169-
*/
170-
@Override //only for better/targeted JavaDoc
171-
Claims setId(String jti);
172-
173-
/**
174-
* Returns the JWTs claim ({@code claimName}) value as a type {@code requiredType}, or {@code null} if not present.
175-
*
176-
* <p>JJWT only converts simple String, Date, Long, Integer, Short and Byte types automatically. Anything more
177-
* complex is expected to be already converted to your desired type by the JSON
178-
* {@link io.jsonwebtoken.io.Deserializer Deserializer} implementation. You may specify a custom Deserializer for a
179-
* JwtParser with the desired conversion configuration via the {@link JwtParserBuilder#deserializeJsonWith} method.
180-
* See <a href="https://github.com/jwtk/jjwt#custom-json-processor">custom JSON processor</a></a> for more
181-
* information. If using Jackson, you can specify custom claim POJO types as described in
182-
* <a href="https://github.com/jwtk/jjwt#json-jackson-custom-types">custom claim types</a>.
183-
*
184-
* @param claimName name of claim
185-
* @param requiredType the type of the value expected to be returned
186-
* @param <T> the type of the value expected to be returned
187-
* @return the JWT {@code claimName} value or {@code null} if not present.
188-
* @throws RequiredTypeException throw if the claim value is not null and not of type {@code requiredType}
189-
*/
190-
<T> T get(String claimName, Class<T> requiredType);
19143
}

java/ql/test/experimental/stubs/jwtk-jjwt-0.11.2/io/jsonwebtoken/ClaimsMutator.java

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -27,76 +27,4 @@
2727
*/
2828
public interface ClaimsMutator<T extends ClaimsMutator> {
2929

30-
/**
31-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.1">
32-
* <code>iss</code></a> (issuer) value. A {@code null} value will remove the property from the JSON map.
33-
*
34-
* @param iss the JWT {@code iss} value or {@code null} to remove the property from the JSON map.
35-
* @return the {@code Claims} instance for method chaining.
36-
*/
37-
T setIssuer(String iss);
38-
39-
/**
40-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.2">
41-
* <code>sub</code></a> (subject) value. A {@code null} value will remove the property from the JSON map.
42-
*
43-
* @param sub the JWT {@code sub} value or {@code null} to remove the property from the JSON map.
44-
* @return the {@code Claims} instance for method chaining.
45-
*/
46-
T setSubject(String sub);
47-
48-
/**
49-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.3">
50-
* <code>aud</code></a> (audience) value. A {@code null} value will remove the property from the JSON map.
51-
*
52-
* @param aud the JWT {@code aud} value or {@code null} to remove the property from the JSON map.
53-
* @return the {@code Claims} instance for method chaining.
54-
*/
55-
T setAudience(String aud);
56-
57-
/**
58-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.4">
59-
* <code>exp</code></a> (expiration) timestamp. A {@code null} value will remove the property from the JSON map.
60-
*
61-
* <p>A JWT obtained after this timestamp should not be used.</p>
62-
*
63-
* @param exp the JWT {@code exp} value or {@code null} to remove the property from the JSON map.
64-
* @return the {@code Claims} instance for method chaining.
65-
*/
66-
T setExpiration(Date exp);
67-
68-
/**
69-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.5">
70-
* <code>nbf</code></a> (not before) timestamp. A {@code null} value will remove the property from the JSON map.
71-
*
72-
* <p>A JWT obtained before this timestamp should not be used.</p>
73-
*
74-
* @param nbf the JWT {@code nbf} value or {@code null} to remove the property from the JSON map.
75-
* @return the {@code Claims} instance for method chaining.
76-
*/
77-
T setNotBefore(Date nbf);
78-
79-
/**
80-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.6">
81-
* <code>iat</code></a> (issued at) timestamp. A {@code null} value will remove the property from the JSON map.
82-
*
83-
* <p>The value is the timestamp when the JWT was created.</p>
84-
*
85-
* @param iat the JWT {@code iat} value or {@code null} to remove the property from the JSON map.
86-
* @return the {@code Claims} instance for method chaining.
87-
*/
88-
T setIssuedAt(Date iat);
89-
90-
/**
91-
* Sets the JWT <a href="https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-25#section-4.1.7">
92-
* <code>jti</code></a> (JWT ID) value. A {@code null} value will remove the property from the JSON map.
93-
*
94-
* <p>This value is a CaSe-SenSiTiVe unique identifier for the JWT. If specified, this value MUST be assigned in a
95-
* manner that ensures that there is a negligible probability that the same value will be accidentally
96-
* assigned to a different data object. The ID can be used to prevent the JWT from being replayed.</p>
97-
*
98-
* @param jti the JWT {@code jti} value or {@code null} to remove the property from the JSON map.
99-
* @return the {@code Claims} instance for method chaining.
100-
*/
101-
T setId(String jti);
10230
}

java/ql/test/experimental/stubs/jwtk-jjwt-0.11.2/io/jsonwebtoken/Clock.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

java/ql/test/experimental/stubs/jwtk-jjwt-0.11.2/io/jsonwebtoken/CompressionCodec.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)