id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
17517521_269 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSerializeCustomDateInSeconds() throws Exception {\n ClaimsHolder holder = holderFor(\"birthdate\", new Date(1478874000));\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_28 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldSplitTokenWithEmptySignature() throws Exception {\n String token = \"eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJpc3MiOiJhdXRoMCJ9.\";\n String[] parts = TokenUtils.splitToken(token);\n\n assertThat(parts, is(notNullValue()));\n assertThat(parts, is(array... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/TokenUtils.java",
"identifier": "TokenUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "TokenUtils.splitToken(String token)",
"constructor": false,
"full_signature": "static String[] splitToken(String token)",
... | {
"body": "static String[] splitToken(String token) throws JWTDecodeException {\n String[] parts = token.split(\"\\\\.\");\n if (parts.length == 2 && token.endsWith(\".\")) {\n //Tokens with alg='none' have empty String as Signature.\n parts = new String[]{parts[0], parts[1], \"\"}... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_286 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowWhenConvertingPayloadIfNullJson() throws Exception {\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(\"The string 'null' doesn't have a valid JSON format.\");\n parser.parsePayload(null);\n }",
"class_method_signature": "JW... | {
"fields": [
{
"declarator": "payloadReader",
"modifier": "private final",
"original_string": "private final ObjectReader payloadReader;",
"type": "ObjectReader",
"var_name": "payloadReader"
},
{
"declarator": "headerReader",
"modifier": "private final",
"o... | {
"body": "@Override\n public Payload parsePayload(String json) throws JWTDecodeException {\n if (json == null) {\n throw decodeException();\n }\n\n try {\n return payloadReader.readValue(json);\n } catch (IOException e) {\n throw decodeException(json);\... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_140 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA256VerificationWhenProvidedPublicKeyIsNull() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n ex... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_90 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldPassRSA512VerificationWithBothKeys() throws Exception {\n String jwt = \"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.mvL5LoMyIrWYjk5umEXZTmbyIrkbbcVPUkvdGZbu0qFBxGOf0nXP5PZBvPcOu084lvpwVox5n3VaD4iqzW-PsJyvKFgi5TnwmsbKchAp7JexQEsQOnTSGcfRqeUUiBZqRQdYsho71oAB... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_117 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldFailHMAC256VerificationWithInvalidSecretBytes() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: HmacSHA256\");\n String jwt = ... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_228 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetNotBefore() throws Exception {\n Date expectedDate = new Date(1477592 * 1000);\n Clock clock = mock(Clock.class);\n when(clock.getToday()).thenReturn(expectedDate);\n\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE0Nzc1OTJ9.mWYSOPoNXstjKbZkKrq... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_86 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailRSA384VerificationWhenProvidedPublicKeyIsNull() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withRSA\");\n except... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_69 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowECDSA384InstanceWithNullKeyProvider() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Key Provider cannot be null.\");\n ECDSAKeyProvider provider = null;\n Algorithm.ECDSA384(provider);\n ... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm ECDSA384(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new ECDSAAlgorithm(\"ES384\", \"SHA384withECDSA\", 48, keyProvider);\n }",
"class_method_signature": "Algorithm.ECDSA384(ECDSAKeyProvider keyProvider)",
"constructor": false,
"full_sign... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_101 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldDoRSA384SigningWithBothKeys() throws Exception {\n Algorithm algorithm = Algorithm.RSA384((RSAPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\"), (RSAPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\"));\n\n String jwt = asJWT(algorithm, RS384Hea... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_290 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldHaveTree() throws Exception {\n HashMap<String, JsonNode> map = new HashMap<>();\n JsonNode node = NullNode.getInstance();\n map.put(\"key\", node);\n BasicHeader header = new BasicHeader(null, null, null, null, map, objectReader);\n\n assertT... | {
"fields": [
{
"declarator": "serialVersionUID = -4659137688548605095L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4659137688548605095L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "alg... | {
"body": "Map<String, JsonNode> getTree() {\n return tree;\n }",
"class_method_signature": "BasicHeader.getTree()",
"constructor": false,
"full_signature": " Map<String, JsonNode> getTree()",
"identifier": "getTree",
"invocations": [],
"modifiers": "",
"parameters": "()",
"return": "Map<Str... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_156 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldPassECDSA384VerificationWithJOSESignature() throws Exception {\n String jwt = \"eyJhbGciOiJFUzM4NCJ9.eyJpc3MiOiJhdXRoMCJ9.50UU5VKNdF1wfykY8jQBKpvuHZoe6IZBJm5NvoB8bR-hnRg6ti-CHbmvoRtlLfnHfwITa_8cJMy6TenMC2g63GQHytc8rYoXqbwtS4R0Ko_AXbLFUmfxnGnMC6v4MS_z\";\n ECKey ke... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_45 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@Test\n public void shouldThrowOnNegativeIssuedAtLeeway() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Leeway value can't be negative.\");\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier.init(algorithm)\n ... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_204 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldDecodeECDSA512JOSE() throws Exception {\n ECDSAAlgorithm algorithm512 = (ECDSAAlgorithm) Algorithm.ECDSA512((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_512, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_512, \"EC\"));\n\n //Without paddin... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "byte[] JOSEToDER(byte[] joseSignature) throws SignatureException {\n if (joseSignature.length != ecNumberSize * 2) {\n throw new SignatureException(\"Invalid JOSE signature format.\");\n }\n\n // Retrieve R and S number's length and padding.\n int rPadding = countPadd... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_12 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetId() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxMjM0NTY3ODkwIn0.m3zgEfVUFOd-CvL3xG5BuOWLzb0zMQZCqiVNQQOPOvA\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getId(), is(\"1234567890\"));\n }",
"cla... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public String getId() {\n return payload.getId();\n }",
"class_method_signature": "JWTDecoder.getId()",
"constructor": false,
"full_signature": "@Override public String getId()",
"identifier": "getId",
"invocations": [
"getId"
],
"modifiers": "@Override public",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_316 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldNotRemoveKnownPublicClaimsFromTree() throws Exception {\n String payloadJSON = \"{\\n\" +\n \" \\\"iss\\\": \\\"auth0\\\",\\n\" +\n \" \\\"sub\\\": \\\"emails\\\",\\n\" +\n \" \\\"aud\\\": \\\"users\\\",\\n\" +\n ... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "@Override\n public Payload deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {\n Map<String, JsonNode> tree = p.getCodec().readValue(p, new TypeReference<Map<String, JsonNode>>() {\n });\n if (tree == null) {\n throw new JWTDecodeException(\"Parsin... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_253 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetIssuedAt() throws Exception {\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getIssuedAt(), is(issuedAt));\n }",
"class_method_signature": "PayloadImplTest.shouldGetIssuedAt()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public Date getIssuedAt() {\n return issuedAt;\n }",
"class_method_signature": "PayloadImpl.getIssuedAt()",
"constructor": false,
"full_signature": "@Override public Date getIssuedAt()",
"identifier": "getIssuedAt",
"invocations": [],
"modifiers": "@Override public",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_195 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldThrowOnDERSignatureConversionIfSNumberDoesNotHaveExpectedLength() throws Exception {\n ECDSAAlgorithm algorithm256 = (ECDSAAlgorithm) Algorithm.ECDSA256((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FI... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "byte[] DERToJOSE(byte[] derSignature) throws SignatureException {\n // DER Structure: http://crypto.stackexchange.com/a/1797\n boolean derEncoded = derSignature[0] == 0x30 && derSignature.length != ecNumberSize * 2;\n if (!derEncoded) {\n throw new SignatureException(\"Inval... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_300 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNotNullExtraClaimIfMissing() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n BasicHeader header = new BasicHeader(null, null, null, null, tree, objectReader);\n\n assertThat(header, is(notNullValue()));\n assertThat(header.get... | {
"fields": [
{
"declarator": "serialVersionUID = -4659137688548605095L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4659137688548605095L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "alg... | {
"body": "@Override\n public Claim getHeaderClaim(String name) {\n return extractClaim(name, tree, objectReader);\n }",
"class_method_signature": "BasicHeader.getHeaderClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getHeaderClaim(String name)",
"identifier":... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_245 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetSubject() throws Exception {\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getSubject(), is(\"subject\"));\n }",
"class_method_signature": "PayloadImplTest.shouldGetSubject()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public String getSubject() {\n return subject;\n }",
"class_method_signature": "PayloadImpl.getSubject()",
"constructor": false,
"full_signature": "@Override public String getSubject()",
"identifier": "getSubject",
"invocations": [],
"modifiers": "@Override public",
"... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_183 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldDoECDSA384SigningWithBothKeys() throws Exception {\n Algorithm algorithm = Algorithm.ECDSA384((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_384, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_384, \"EC\"));\n String jwt = asJWT(algorithm, ES... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_53 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowHMAC384InstanceWithNullSecret() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Secret cannot be null\");\n String secret = null;\n Algorithm.HMAC384(secret);\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm HMAC384(String secret) throws IllegalArgumentException {\n return new HMACAlgorithm(\"HS384\", \"HmacSHA384\", secret);\n }",
"class_method_signature": "Algorithm.HMAC384(String secret)",
"constructor": false,
"full_signature": "public static Algorithm HMAC384(String... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_212 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldAcceptHMAC256Algorithm() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.mZ0m_N1J4PgeqWmi903JuUoDRZDBPB7HwkS4nVyWH1M\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_265 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSkipSerializationOnEmptyAudience() throws Exception {\n ClaimsHolder holder = holderFor(\"aud\", new String[0]);\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is(equalTo(... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_320 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullArrayWhenParsingNullNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n NullNode node = NullNode.getInstance();\n tree.put(\"key\", node);\n\n List<String> values = deserializer.getStringOrArray(tree, \"key\");\n ... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "List<String> getStringOrArray(Map<String, JsonNode> tree, String claimName) throws JWTDecodeException {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull() || !(node.isArray() || node.isTextual())) {\n return null;\n }\n if (node.isTextual() && ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_24 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetCustomArrayClaimOfTypeInteger() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjpbMSwyLDNdfQ.UEuMKRQYrzKAiPpPLhIVawWkKWA1zj0_GderrWUIyFE\";\n DecodedJWT jwt = JWT.decode(token);\n Assert.assertThat(jwt, is(notNullValue()));\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public Claim getClaim(String name) {\n return payload.getClaim(name);\n }",
"class_method_signature": "JWTDecoder.getClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getClaim(String name)",
"identifier": "getClaim",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_232 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetType() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.e30.WdFmrzx8b9v_a-r6EHC2PTAaWywgm_8LiP8RBRhYwkI\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n .verify(token);\n\n ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_73 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldForwardHeaderPayloadSignatureToSiblingSignMethodForBackwardsCompatibility() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n\n ArgumentCaptor<byte[]> contentCaptor = ArgumentCaptor.forClass(byte[].class);\n\n byte[] header = new byte[]{0x... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n // default implementation; keep around until sign(byte[]) method is removed\n byte[] contentBytes = new byte[headerBytes.length + 1 + payloadBytes.length];\n\n System.arraycopy(headerByt... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_224 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetSubject() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUb2szbnMifQ.RudAxkslimoOY3BLl2Ghny3BrUKu9I1ZrXzCZGDJtNs\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n .verify(token);\n... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_65 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowECDSA256InstanceWithNullKeys() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n Algorithm.ECDSA256(null, null);\n }",
"class_method_signature": "AlgorithmTe... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm ECDSA256(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new ECDSAAlgorithm(\"ES256\", \"SHA256withECDSA\", 32, keyProvider);\n }",
"class_method_signature": "Algorithm.ECDSA256(ECDSAKeyProvider keyProvider)",
"constructor": false,
"full_sign... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_273 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSerializeDoubles() throws Exception {\n ClaimsHolder holder = holderFor(\"fraction\", 23.45);\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is(equalTo(\"{\\\"fraction\\\"... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_32 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@Test\n public void shouldThrowWhenInitializedWithoutAlgorithm() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Algorithm cannot be null\");\n JWTVerifier.init(null);\n }",
"class_method_signature": "JWTVerifierTest.should... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_121 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldPassHMAC512Verification() throws Exception {\n String jwt = \"eyJhbGciOiJIUzUxMiIsImN0eSI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.VUo2Z9SWDV-XcOc_Hr6Lff3vl7L9e5Vb8ThXpmGDFjHxe3Dr1ZBmUChYF-xVA7cAdX1P_D4ZCUcsv3IefpVaJw\";\n Algorithm algorithmString = Algorithm.HMAC512(\"secr... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_49 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowHMAC256InstanceWithNullSecretBytes() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Secret cannot be null\");\n byte[] secret = null;\n Algorithm.HMAC256(secret);\n }",
"class_method_s... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm HMAC256(String secret) throws IllegalArgumentException {\n return new HMACAlgorithm(\"HS256\", \"HmacSHA256\", secret);\n }",
"class_method_signature": "Algorithm.HMAC256(String secret)",
"constructor": false,
"full_signature": "public static Algorithm HMAC256(String... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_208 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldDecodeAStringTokenUsingInstance() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.mZ0m_N1J4PgeqWmi903JuUoDRZDBPB7HwkS4nVyWH1M\";\n JWT jwt = new JWT();\n DecodedJWT decodedJWT = jwt.decodeJwt(token);\n\n ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public DecodedJWT decodeJwt(String token) throws JWTDecodeException {\n return new JWTDecoder(parser, token);\n }",
"class_method_signature": "JWT.decodeJwt(String token)",
"constructor": false,
"full_signature": "public DecodedJWT decodeJwt(String token)",
"identifier": "decodeJwt",
"i... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_176 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA512VerificationOnInvalidJOSESignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA512withECDSA\");\n\n byte[... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_199 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldSignAndVerifyWithECDSA512() throws Exception {\n ECDSAAlgorithm algorithm512 = (ECDSAAlgorithm) Algorithm.ECDSA512((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_512, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_512, \"EC\"));\n String head... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_160 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldPassECDSA384VerificationWithProvidedPublicKey() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE_384, \"EC\");\n when(provider.getPublicKeyById(\"my-key-id\")).thenR... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_0 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void getSubject() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\");\n assertThat(jwt.getSubject(), is(notNullValue()));\... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public String getSubject() {\n return payload.getSubject();\n }",
"class_method_signature": "JWTDecoder.getSubject()",
"constructor": false,
"full_signature": "@Override public String getSubject()",
"identifier": "getSubject",
"invocations": [
"getSubject"
],
"mod... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_249 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetExpiresAt() throws Exception {\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getExpiresAt(), is(expiresAt));\n }",
"class_method_signature": "PayloadImplTest.shouldGetExpiresAt()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public Date getExpiresAt() {\n return expiresAt;\n }",
"class_method_signature": "PayloadImpl.getExpiresAt()",
"constructor": false,
"full_signature": "@Override public Date getExpiresAt()",
"identifier": "getExpiresAt",
"invocations": [],
"modifiers": "@Override public... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_137 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldPassECDSA256VerificationWithJOSESignatureWithBothKeys() throws Exception {\n String jwt = \"eyJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJhdXRoMCJ9.4iVk3-Y0v4RT4_9IaQlp-8dZ_4fsTzIylgrPTDLrEvTHBTyVS3tgPbr2_IZfLETtiKRqCg0aQ5sh9eIsTTwB1g\";\n Algorithm algorithm = Algorithm.ECDSA2... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_136 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldThrowOnECDSA256VerificationWithDERSignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n exception.... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_248 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullAudienceIfMissing() throws Exception {\n PayloadImpl payload = new PayloadImpl(null, null, null, null, null, null, null, null, objectReader);\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getAudience(), is(nullValue()));\n }",
... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public List<String> getAudience() {\n return audience;\n }",
"class_method_signature": "PayloadImpl.getAudience()",
"constructor": false,
"full_signature": "@Override public List<String> getAudience()",
"identifier": "getAudience",
"invocations": [],
"modifiers": "@Over... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_161 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA384VerificationWhenProvidedPublicKeyIsNull() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withECDSA\");\n ex... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_1 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetStringToken() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.e30.XmNK3GpH3Ys_7wsYBfq4C3M6goz71I7dTgUkuIa5lyQ\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getToken(), is(notNullValue()));\n assertThat(jwt.get... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public String getToken() {\n return String.format(\"%s.%s.%s\", parts[0], parts[1], parts[2]);\n }",
"class_method_signature": "JWTDecoder.getToken()",
"constructor": false,
"full_signature": "@Override public String getToken()",
"identifier": "getToken",
"invocations": [... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_177 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA512VerificationOnInvalidDERSignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA512withECDSA\");\n\n byte[]... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_198 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldSignAndVerifyWithECDSA384() throws Exception {\n ECDSAAlgorithm algorithm384 = (ECDSAAlgorithm) Algorithm.ECDSA384((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_384, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_384, \"EC\"));\n String head... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_48 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@Test\n public void shouldThrowWhenVerifyingClaimPresenceWhenClaimNameIsNull() {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Custom Claim's name can't be null.\");\n\n String jwt = JWTCreator.init()\n .withClaim(\"custom\", \"va... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_209 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetStringToken() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.e30.XmNK3GpH3Ys_7wsYBfq4C3M6goz71I7dTgUkuIa5lyQ\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getToken(), is(notNullValue()));\n assertThat(jwt.get... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static DecodedJWT decode(String token) throws JWTDecodeException {\n return new JWTDecoder(token);\n }",
"class_method_signature": "JWT.decode(String token)",
"constructor": false,
"full_signature": "public static DecodedJWT decode(String token)",
"identifier": "decode",
"invocat... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_120 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldFailHMAC384VerificationWithInvalidSecretBytes() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: HmacSHA384\");\n String jwt = ... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_272 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSerializeIntegers() throws Exception {\n ClaimsHolder holder = holderFor(\"number\", 12345);\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is(equalTo(\"{\\\"number\\\":12... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_33 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@Test\n public void shouldRemoveAudienceWhenPassingNullReference() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .withAudience((String) null)\n .build();\n\n assertThat(verifier.... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_225 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetArrayAudience() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOlsiSG9wZSIsIlRyYXZpcyIsIlNvbG9tb24iXX0.Tm4W8WnfPjlmHSmKFakdij0on2rWPETpoM7Sh0u6-S4\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_64 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowECDSA256InstanceWithNullKey() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n ECKey key = null;\n Algorithm.ECDSA256(key);\n }",
"class_method_signa... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm ECDSA256(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new ECDSAAlgorithm(\"ES256\", \"SHA256withECDSA\", 32, keyProvider);\n }",
"class_method_signature": "Algorithm.ECDSA256(ECDSAKeyProvider keyProvider)",
"constructor": false,
"full_sign... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_233 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetKeyId() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsImtpZCI6ImtleSJ9.e30.von1Vt9tq9cn5ZYdX1f4cf2EE7fUvb5BCBlKOTm9YWs\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n .verify(token);\n\n ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_72 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowECDSA512InstanceWithNullKeyProvider() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Key Provider cannot be null.\");\n ECDSAKeyProvider provider = null;\n Algorithm.ECDSA512(provider);\n ... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm ECDSA512(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new ECDSAAlgorithm(\"ES512\", \"SHA512withECDSA\", 66, keyProvider);\n }",
"class_method_signature": "Algorithm.ECDSA512(ECDSAKeyProvider keyProvider)",
"constructor": false,
"full_sign... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_264 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSerializeMultipleItemsAudienceAsArray() throws Exception {\n ClaimsHolder holder = holderFor(\"aud\", new String[]{\"auth0\", \"auth10\"});\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(wri... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_321 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullArrayWhenParsingNullNodeValue() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n tree.put(\"key\", null);\n\n List<String> values = deserializer.getStringOrArray(tree, \"key\");\n assertThat(values, is(nullValue()));\n }... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "List<String> getStringOrArray(Map<String, JsonNode> tree, String claimName) throws JWTDecodeException {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull() || !(node.isArray() || node.isTextual())) {\n return null;\n }\n if (node.isTextual() && ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_25 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetCustomMapClaim() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjp7InN0cmluZyI6InZhbHVlIiwibnVtYmVyIjoxLCJib29sZWFuIjp0cnVlfX0.-8aIaXd2-rp1lLuDEQmCeisCBX9X_zbqdPn2llGxNoc\";\n DecodedJWT jwt = JWT.decode(token);\n Assert.assertThat(j... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public Claim getClaim(String name) {\n return payload.getClaim(name);\n }",
"class_method_signature": "JWTDecoder.getClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getClaim(String name)",
"identifier": "getClaim",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_52 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowHMAC256InstanceWithNullSecret() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Secret cannot be null\");\n String secret = null;\n Algorithm.HMAC256(secret);\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm HMAC256(String secret) throws IllegalArgumentException {\n return new HMACAlgorithm(\"HS256\", \"HmacSHA256\", secret);\n }",
"class_method_signature": "Algorithm.HMAC256(String secret)",
"constructor": false,
"full_signature": "public static Algorithm HMAC256(String... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_213 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldAcceptHMAC384Algorithm() throws Exception {\n String token = \"eyJhbGciOiJIUzM4NCIsImN0eSI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.uztpK_wUMYJhrRv8SV-1LU4aPnwl-EM1q-wJnqgyb5DHoDteP6lN_gE1xnZJH5vw\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC384(\"secret\"))\n ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_182 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldDoECDSA384Signing() throws Exception {\n Algorithm algorithmSign = Algorithm.ECDSA384((ECKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_384, \"EC\"));\n Algorithm algorithmVerify = Algorithm.ECDSA384((ECKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_384, \"EC\"));\n ... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_301 | {
"fields": [],
"file": "lib/src/test/java/com/auth0/jwt/impl/ClaimsHolderTest.java",
"identifier": "ClaimsHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressWarnings(\"RedundantCast\")\n @Test\n public void shouldGetClaims() throws Exception {\n HashMap<String, Object> claims = new HashMap<>();\n claims.put(\"iss\", \"auth0\");\n ClaimsHolder holder = new ClaimsHolder(claims);\n assertThat(holder, is(notNullValue()));... | {
"fields": [
{
"declarator": "claims",
"modifier": "private",
"original_string": "private Map<String, Object> claims;",
"type": "Map<String, Object>",
"var_name": "claims"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/ClaimsHolder.java",
"identifier": "ClaimsHolder",
... | {
"body": "Map<String, Object> getClaims() {\n return claims;\n }",
"class_method_signature": "ClaimsHolder.getClaims()",
"constructor": false,
"full_signature": " Map<String, Object> getClaims()",
"identifier": "getClaims",
"invocations": [],
"modifiers": "",
"parameters": "()",
"return": "... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_244 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullIssuerIfMissing() throws Exception {\n PayloadImpl payload = new PayloadImpl(null, null, null, null, null, null, null, null, objectReader);\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getIssuer(), is(nullValue()));\n }",
"cla... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public String getIssuer() {\n return issuer;\n }",
"class_method_signature": "PayloadImpl.getIssuer()",
"constructor": false,
"full_signature": "@Override public String getIssuer()",
"identifier": "getIssuer",
"invocations": [],
"modifiers": "@Override public",
"param... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_194 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldThrowOnDERSignatureConversionIfRNumberDoesNotHaveExpectedLength() throws Exception {\n ECDSAAlgorithm algorithm256 = (ECDSAAlgorithm) Algorithm.ECDSA256((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FI... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "byte[] DERToJOSE(byte[] derSignature) throws SignatureException {\n // DER Structure: http://crypto.stackexchange.com/a/1797\n boolean derEncoded = derSignature[0] == 0x30 && derSignature.length != ecNumberSize * 2;\n if (!derEncoded) {\n throw new SignatureException(\"Inval... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_13 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetContentType() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiIsImN0eSI6ImF3ZXNvbWUifQ.e30.AIm-pJDOaAyct9qKMlN-lQieqNDqc3d4erqUZc5SHAs\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getContentType(), is(\"awesome\"));\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public String getContentType() {\n return header.getContentType();\n }",
"class_method_signature": "JWTDecoder.getContentType()",
"constructor": false,
"full_signature": "@Override public String getContentType()",
"identifier": "getContentType",
"invocations": [
"getC... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_317 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetStringArrayWhenParsingArrayNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n List<JsonNode> subNodes = new ArrayList<>();\n TextNode textNode1 = new TextNode(\"one\");\n TextNode textNode2 = new TextNode(\"two\");\n ... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "List<String> getStringOrArray(Map<String, JsonNode> tree, String claimName) throws JWTDecodeException {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull() || !(node.isArray() || node.isTextual())) {\n return null;\n }\n if (node.isTextual() && ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_252 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullNotBeforeIfMissing() throws Exception {\n PayloadImpl payload = new PayloadImpl(null, null, null, null, null, null, null, null, objectReader);\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getNotBefore(), is(nullValue()));\n }",
... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public Date getNotBefore() {\n return notBefore;\n }",
"class_method_signature": "PayloadImpl.getNotBefore()",
"constructor": false,
"full_signature": "@Override public Date getNotBefore()",
"identifier": "getNotBefore",
"invocations": [],
"modifiers": "@Override public... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_44 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@Test\n public void shouldThrowOnNegativeNotBeforeLeeway() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Leeway value can't be negative.\");\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier.init(algorithm)\n ... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_205 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldDecodeECDSA512DER() throws Exception {\n ECDSAAlgorithm algorithm512 = (ECDSAAlgorithm) Algorithm.ECDSA512((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_512, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_512, \"EC\"));\n\n //Without padding... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "byte[] DERToJOSE(byte[] derSignature) throws SignatureException {\n // DER Structure: http://crypto.stackexchange.com/a/1797\n boolean derEncoded = derSignature[0] == 0x30 && derSignature.length != ecNumberSize * 2;\n if (!derEncoded) {\n throw new SignatureException(\"Inval... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_157 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldThrowOnECDSA384VerificationWithDERSignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withECDSA\");\n exception.... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_291 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetAlgorithm() throws Exception {\n BasicHeader header = new BasicHeader(\"HS256\", null, null, null, null, objectReader);\n\n assertThat(header, is(notNullValue()));\n assertThat(header.getAlgorithm(), is(notNullValue()));\n assertThat(header.getAlg... | {
"fields": [
{
"declarator": "serialVersionUID = -4659137688548605095L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4659137688548605095L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "alg... | {
"body": "@Override\n public String getAlgorithm() {\n return algorithm;\n }",
"class_method_signature": "BasicHeader.getAlgorithm()",
"constructor": false,
"full_signature": "@Override public String getAlgorithm()",
"identifier": "getAlgorithm",
"invocations": [],
"modifiers": "@Override pu... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_100 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldDoRSA384Signing() throws Exception {\n Algorithm algorithmSign = Algorithm.RSA384((RSAKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\"));\n Algorithm algorithmVerify = Algorithm.RSA384((RSAKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\"));\n\n Stri... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_229 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetIssuedAt() throws Exception {\n Date expectedDate = new Date(1477592 * 1000);\n Clock clock = mock(Clock.class);\n when(clock.getToday()).thenReturn(expectedDate);\n\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0Nzc1OTJ9.5o1CKlLFjKKcddZzoarQ... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public static Verification require(Algorithm algorithm) {\n return JWTVerifier.init(algorithm);\n }",
"class_method_signature": "JWT.require(Algorithm algorithm)",
"constructor": false,
"full_signature": "public static Verification require(Algorithm algorithm)",
"identifier": "require",
... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_87 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailRSA384VerificationWithInvalidPublicKey() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withRSA\");\n String jwt = ... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_68 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowECDSA384InstanceWithNullKeys() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n Algorithm.ECDSA384(null, null);\n }",
"class_method_signature": "AlgorithmTe... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm ECDSA384(ECDSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new ECDSAAlgorithm(\"ES384\", \"SHA384withECDSA\", 48, keyProvider);\n }",
"class_method_signature": "Algorithm.ECDSA384(ECDSAKeyProvider keyProvider)",
"constructor": false,
"full_sign... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_116 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldFailHMAC256VerificationWithInvalidSecretString() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: HmacSHA256\");\n String jwt =... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_91 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldPassRSA512VerificationWithProvidedPublicKey() throws Exception {\n RSAKeyProvider provider = mock(RSAKeyProvider.class);\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\");\n when(provider.getPublicKeyById(\"my-key-id\")).thenReturn((RS... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_141 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA256VerificationWithInvalidPublicKey() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n String jw... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_268 | {
"fields": [
{
"declarator": "writer",
"modifier": "private",
"original_string": "private StringWriter writer;",
"type": "StringWriter",
"var_name": "writer"
},
{
"declarator": "serializer",
"modifier": "private",
"original_string": "private PayloadSerializ... | {
"body": "@Test\n public void shouldSerializeExpiresAtDateInSeconds() throws Exception {\n ClaimsHolder holder = holderFor(\"exp\", new Date(1478874000));\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is(eq... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadSerializer.java",
"identifier": "PayloadSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "PayloadSerializer.PayloadSerializer()",
"constructor": true,
"full_signature": "public PayloadSerializer(... | {
"body": "@Override\n public void serialize(ClaimsHolder holder, JsonGenerator gen, SerializerProvider provider) throws IOException {\n\n gen.writeStartObject();\n for (Map.Entry<String, Object> e : holder.getClaims().entrySet()) {\n switch (e.getKey()) {\n case PublicClaim... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_29 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowOnSplitTokenWithMoreThan3Parts() throws Exception {\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(\"The token was expected to have 3 parts, but got 4.\");\n String token = \"this.has.four.parts\";\n TokenUtils.splitToke... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/TokenUtils.java",
"identifier": "TokenUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "TokenUtils.splitToken(String token)",
"constructor": false,
"full_signature": "static String[] splitToken(String token)",
... | {
"body": "static String[] splitToken(String token) throws JWTDecodeException {\n String[] parts = token.split(\"\\\\.\");\n if (parts.length == 2 && token.endsWith(\".\")) {\n //Tokens with alg='none' have empty String as Signature.\n parts = new String[]{parts[0], parts[1], \"\"}... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_287 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowWhenConvertingPayloadFromInvalidJson() throws Exception {\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(\"The string '}{' doesn't have a valid JSON format.\");\n parser.parsePayload(\"}{\");\n }",
"class_method_signature"... | {
"fields": [
{
"declarator": "payloadReader",
"modifier": "private final",
"original_string": "private final ObjectReader payloadReader;",
"type": "ObjectReader",
"var_name": "payloadReader"
},
{
"declarator": "headerReader",
"modifier": "private final",
"o... | {
"body": "@Override\n public Payload parsePayload(String json) throws JWTDecodeException {\n if (json == null) {\n throw decodeException();\n }\n\n try {\n return payloadReader.readValue(json);\n } catch (IOException e) {\n throw decodeException(json);\... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_139 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldPassECDSA256VerificationWithProvidedPublicKey() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\");\n when(provider.getPublicKeyById(\"my-key-id\")).thenR... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_210 | {
"fields": [
{
"declarator": "PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\"",
"modifier": "private static final",
"original_string": "private static final String PUBLIC_KEY_FILE_RSA = \"src/test/resources/rsa-public.pem\";",
"type": "String",
"var_name": "PUBLIC_KEY_FI... | {
"body": "@Test\n public void shouldGetStringTokenUsingInstance() throws Exception {\n JWT jwt = new JWT();\n DecodedJWT decodedJWT = jwt.decodeJwt(\"eyJhbGciOiJIUzI1NiJ9.e30.XmNK3GpH3Ys_7wsYBfq4C3M6goz71I7dTgUkuIa5lyQ\");\n assertThat(decodedJWT, is(notNullValue()));\n assertThat(deco... | {
"fields": [
{
"declarator": "parser",
"modifier": "private final",
"original_string": "private final JWTParser parser;",
"type": "JWTParser",
"var_name": "parser"
}
],
"file": "lib/src/main/java/com/auth0/jwt/JWT.java",
"identifier": "JWT",
"interfaces": "",
"methods"... | {
"body": "public DecodedJWT decodeJwt(String token) throws JWTDecodeException {\n return new JWTDecoder(parser, token);\n }",
"class_method_signature": "JWT.decodeJwt(String token)",
"constructor": false,
"full_signature": "public DecodedJWT decodeJwt(String token)",
"identifier": "decodeJwt",
"i... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_51 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldThrowHMAC512InstanceWithNullSecretBytes() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Secret cannot be null\");\n byte[] secret = null;\n Algorithm.HMAC512(secret);\n }",
"class_method_s... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "description",
"modifier": "private final",
"original_string": "private final String d... | {
"body": "public static Algorithm HMAC512(String secret) throws IllegalArgumentException {\n return new HMACAlgorithm(\"HS512\", \"HmacSHA512\", secret);\n }",
"class_method_signature": "Algorithm.HMAC512(String secret)",
"constructor": false,
"full_signature": "public static Algorithm HMAC512(String... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_181 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailOnECDSA256SigningWhenUsingPublicKey() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA256withECDSA\");\n exception.ex... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n ECPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The given Private Key... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_247 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetAudience() throws Exception {\n assertThat(payload, is(notNullValue()));\n\n assertThat(payload.getAudience(), is(IsCollectionWithSize.hasSize(1)));\n assertThat(payload.getAudience(), is(IsCollectionContaining.hasItems(\"audience\")));\n }",
"class... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public List<String> getAudience() {\n return audience;\n }",
"class_method_signature": "PayloadImpl.getAudience()",
"constructor": false,
"full_signature": "@Override public List<String> getAudience()",
"identifier": "getAudience",
"invocations": [],
"modifiers": "@Over... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_302 | {
"fields": [],
"file": "lib/src/test/java/com/auth0/jwt/impl/ClaimsHolderTest.java",
"identifier": "ClaimsHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetNotNullClaims() throws Exception {\n ClaimsHolder holder = new ClaimsHolder(null);\n assertThat(holder, is(notNullValue()));\n assertThat(holder.getClaims(), is(notNullValue()));\n assertThat(holder.getClaims(), is(instanceOf(Map.class)));\n }"... | {
"fields": [
{
"declarator": "claims",
"modifier": "private",
"original_string": "private Map<String, Object> claims;",
"type": "Map<String, Object>",
"var_name": "claims"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/ClaimsHolder.java",
"identifier": "ClaimsHolder",
... | {
"body": "Map<String, Object> getClaims() {\n return claims;\n }",
"class_method_signature": "ClaimsHolder.getClaims()",
"constructor": false,
"full_signature": " Map<String, Object> getClaims()",
"identifier": "getClaims",
"invocations": [],
"modifiers": "",
"parameters": "()",
"return": "... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_197 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldSignAndVerifyWithECDSA256() throws Exception {\n ECDSAAlgorithm algorithm256 = (ECDSAAlgorithm) Algorithm.ECDSA256((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_256, \"EC\"));\n String head... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_178 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldDoECDSA256Signing() throws Exception {\n Algorithm algorithm = Algorithm.ECDSA256((ECKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_256, \"EC\"));\n Algorithm algorithmVerify = Algorithm.ECDSA256((ECKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\"));\n ... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_251 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNotBefore() throws Exception {\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getNotBefore(), is(notBefore));\n }",
"class_method_signature": "PayloadImplTest.shouldGetNotBefore()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [
{
"declarator": "serialVersionUID = 1659021498824562311L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1659021498824562311L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "issue... | {
"body": "@Override\n public Date getNotBefore() {\n return notBefore;\n }",
"class_method_signature": "PayloadImpl.getNotBefore()",
"constructor": false,
"full_signature": "@Override public Date getNotBefore()",
"identifier": "getNotBefore",
"invocations": [],
"modifiers": "@Override public... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_10 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "lib/src/te... | {
"body": "@Test\n public void shouldGetNotBefore() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE0NzY3MjcwODZ9.tkpD3iCPQPVqjnjpDVp2bJMBAgpVCG9ZjlBuMitass0\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getNotBefore(), is(instanceOf(Date.class)... | {
"fields": [
{
"declarator": "serialVersionUID = 1873362438023312895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1873362438023312895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "parts... | {
"body": "@Override\n public Date getNotBefore() {\n return payload.getNotBefore();\n }",
"class_method_signature": "JWTDecoder.getNotBefore()",
"constructor": false,
"full_signature": "@Override public Date getNotBefore()",
"identifier": "getNotBefore",
"invocations": [
"getNotBefore"
]... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_314 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowOnNullTree() throws Exception {\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(\"Parsing the Payload's JSON resulted on a Null map\");\n\n JsonParser parser = mock(JsonParser.class);\n ObjectCodec codec = mock(ObjectCode... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "private final",
"original_string": "private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "lib/src/main/java/com/auth0/jwt/impl/PayloadDeserializer.java",
"identi... | {
"body": "@Override\n public Payload deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {\n Map<String, JsonNode> tree = p.getCodec().readValue(p, new TypeReference<Map<String, JsonNode>>() {\n });\n if (tree == null) {\n throw new JWTDecodeException(\"Parsin... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_206 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailOnECDSA256SigningWithDeprecatedMethodWhenProvidedPrivateKeyIsNull() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA256withE... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n ECPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The given Private Key... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_47 | {
"fields": [
{
"declarator": "DATE_TOKEN_MS_VALUE = 1477592 * 1000",
"modifier": "private static final",
"original_string": "private static final long DATE_TOKEN_MS_VALUE = 1477592 * 1000;",
"type": "long",
"var_name": "DATE_TOKEN_MS_VALUE"
},
{
"declarator": "exceptio... | {
"body": "@Test\n public void shouldRemoveIssuerWhenPassingNullReference() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .withIssuer((String) null)\n .build();\n\n assertThat(verifier.clai... | {
"fields": [
{
"declarator": "algorithm",
"modifier": "private final",
"original_string": "private final Algorithm algorithm;",
"type": "Algorithm",
"var_name": "algorithm"
},
{
"declarator": "claims",
"modifier": "final",
"original_string": "final Map<Stri... | {
"body": "static Verification init(Algorithm algorithm) throws IllegalArgumentException {\n return new BaseVerification(algorithm);\n }",
"class_method_signature": "JWTVerifier.init(Algorithm algorithm)",
"constructor": false,
"full_signature": "static Verification init(Algorithm algorithm)",
"iden... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_154 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE_256 = \"src/test/resources/ec256-key-private.pem\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void shouldFailECDSA256KVerificationOnInvalidJOSESignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n \n ... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final ECDSAKeyProvider keyProvider;",
"type": "ECDSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"origi... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_292 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldGetNullAlgorithmIfMissing() throws Exception {\n BasicHeader header = new BasicHeader(null, null, null, null, null, objectReader);\n\n assertThat(header, is(notNullValue()));\n assertThat(header.getAlgorithm(), is(nullValue()));\n }",
"class_method_sig... | {
"fields": [
{
"declarator": "serialVersionUID = -4659137688548605095L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -4659137688548605095L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "alg... | {
"body": "@Override\n public String getAlgorithm() {\n return algorithm;\n }",
"class_method_signature": "BasicHeader.getAlgorithm()",
"constructor": false,
"full_signature": "@Override public String getAlgorithm()",
"identifier": "getAlgorithm",
"invocations": [],
"modifiers": "@Override pu... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_103 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldFailOnRSA384SigningWhenProvidedPrivateKeyIsNull() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing using the Algorithm: SHA384withRSA\");\n except... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n @Deprecated\n public byte[] sign(byte[] headerBytes, byte[] payloadBytes) throws SignatureGenerationException {\n try {\n RSAPrivateKey privateKey = keyProvider.getPrivateKey();\n if (privateKey == null) {\n throw new IllegalStateException(\"The... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_84 | {
"fields": [
{
"declarator": "PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\"",
"modifier": "private static final",
"original_string": "private static final String PRIVATE_KEY_FILE = \"src/test/resources/rsa-private.pem\";",
"type": "String",
"var_name": "PRIVATE_KEY_FILE"... | {
"body": "@Test\n public void shouldPassRSA384VerificationWithBothKeys() throws Exception {\n String jwt = \"eyJhbGciOiJSUzM4NCIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.TZlWjXObwGSQOiu2oMq8kiKz0_BR7bbBddNL6G8eZ_GoR82BXOZDqNrQr7lb_M-78XGBguWLWNIdYhzgxOUL9EoCJlrqVm9s9vo6G8T1sj1op-4TbjXZ61TwIvrJee9BvPLdKUJ9_fp1... | {
"fields": [
{
"declarator": "keyProvider",
"modifier": "private final",
"original_string": "private final RSAKeyProvider keyProvider;",
"type": "RSAKeyProvider",
"var_name": "keyProvider"
},
{
"declarator": "crypto",
"modifier": "private final",
"original_... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n RSAPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId());\n if (publicKey == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
17517521_115 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldPassHMAC256Verification() throws Exception {\n String jwt = \"eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.mZ0m_N1J4PgeqWmi903JuUoDRZDBPB7HwkS4nVyWH1M\";\n Algorithm algorithmString = Algorithm.HMAC256(\"secret\");\n Algorithm algorithmBytes = ... | {
"fields": [
{
"declarator": "crypto",
"modifier": "private final",
"original_string": "private final CryptoHelper crypto;",
"type": "CryptoHelper",
"var_name": "crypto"
},
{
"declarator": "secret",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n\n try {\n boolean valid = crypto.verifySignatureFor(getDescription(), secret, jwt.getHeader(), jwt.getPayload(), signatureB... | {
"created": null,
"fork": null,
"fork_count": 691,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 17517521,
"size": 936,
"stargazer_count": 3678,
"stars": null,
"updates": null,
"url": "https://github.com/auth0/java-jwt"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.