id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
96331237_20 | {
"fields": [
{
"declarator": "fileCreator",
"modifier": "private",
"original_string": "private CloudFormationFileCreator fileCreator;",
"type": "CloudFormationFileCreator",
"var_name": "fileCreator"
},
{
"declarator": "cfnModule",
"modifier": "private",
"or... | {
"body": "@Test\n public void testWriteScripts() throws Exception {\n cfnModule.addFileUpload(new FileUpload(FILENAME_TEST_FILE, FROM_CSAR));\n fileCreator.writeScripts();\n\n File deployScript = new File(targetDir,\n SCRIPTS_DIR_PATH + FILENAME_DEPLOY + BASH_FILE_ENDING);\n ... | {
"fields": [
{
"declarator": "CLI_COMMAND_CREATESTACK = \"aws cloudformation deploy \"",
"modifier": "public static final",
"original_string": "public static final String CLI_COMMAND_CREATESTACK = \"aws cloudformation deploy \";",
"type": "String",
"var_name": "CLI_COMMAND_CREATESTA... | {
"body": "public void writeScripts() throws IOException {\n writeFileUploadScript();\n writeStackCreationScript();\n writeDeployScript();\n writeCleanUpScript();\n }",
"class_method_signature": "CloudFormationFileCreator.writeScripts()",
"constructor": false,
"full_signature": "p... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_61 | {
"fields": [
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarFilesystemDao csarDao;",
"type": "CsarFilesystemDao",
"var_name": "csarDao"
},
{
"declarator": "transformationDao",
"modifier": "@Mock\n private",
"original_st... | {
"body": "@Test\n public void findAll() {\n int numberOfCsars = 10;\n createFakeCsarDirectories(numberOfCsars);\n\n csarDao = new CsarFilesystemDao(preferences, transformationDao);\n csarDao.init();\n List<Csar> csarList = csarDao.findAll();\n assertEquals(\"Correct amoun... | {
"fields": [
{
"declarator": "CSARS_DIR = \"csars\"",
"modifier": "public final static",
"original_string": "public final static String CSARS_DIR = \"csars\";",
"type": "String",
"var_name": "CSARS_DIR"
},
{
"declarator": "TRANSFORMATION_DIR = \"transformations\"",
... | {
"body": "@Override\n public List<Csar> findAll() {\n List<Csar> csarList = new ArrayList<>();\n csarList.addAll(csarMap.values());\n return csarList;\n }",
"class_method_signature": "CsarFilesystemDao.findAll()",
"constructor": false,
"full_signature": "@Override public List<Csar> f... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_36 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n ... | {
"body": "@Test(expected = FileNotFoundException.class)\n public void getAbsolutePathNoSuchFile() throws FileNotFoundException {\n String filename = \"nonexistent-file\";\n access.getAbsolutePath(filename);\n fail(\"getAbsolutePath() should have raised FileNotFoundException.\");\n }",
"c... | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File... | {
"body": "public String getAbsolutePath(String relativePath) throws FileNotFoundException {\n File targetFile = new File(targetDir, relativePath);\n if (targetFile.exists()) {\n return targetFile.getAbsolutePath();\n } else {\n throw new FileNotFoundException(String.format(... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_37 | {
"fields": [
{
"declarator": "access",
"modifier": "private",
"original_string": "private PluginFileAccess access;",
"type": "PluginFileAccess",
"var_name": "access"
},
{
"declarator": "log",
"modifier": "@Mock\n private",
"original_string": "@Mock\n ... | {
"body": "@Test\n public void delete() throws IOException {\n String filename = \"some-file\";\n File file = new File(targetDir, filename);\n file.createNewFile();\n assertTrue(file.exists());\n\n access.delete(filename);\n assertFalse(file.exists());\n }",
"class_me... | {
"fields": [
{
"declarator": "logger",
"modifier": "private final",
"original_string": "private final Logger logger;",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "sourceDir",
"modifier": "private final",
"original_string": "private final File... | {
"body": "public void delete(String relativePath) {\n File file = new File(targetDir, relativePath);\n FileUtils.deleteQuietly(file);\n }",
"class_method_signature": "PluginFileAccess.delete(String relativePath)",
"constructor": false,
"full_signature": "public void delete(String relativePath)... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_60 | {
"fields": [
{
"declarator": "csarDao",
"modifier": "private",
"original_string": "private CsarFilesystemDao csarDao;",
"type": "CsarFilesystemDao",
"var_name": "csarDao"
},
{
"declarator": "transformationDao",
"modifier": "@Mock\n private",
"original_st... | {
"body": "@Test\n public void find() {\n String identifier = createFakeCsarDirectories(1)[0];\n // create new CsarDao -- disk is initialized only on startup\n csarDao = new CsarFilesystemDao(preferences, transformationDao);\n csarDao.init();\n Optional<Csar> csar = csarDao.find(... | {
"fields": [
{
"declarator": "CSARS_DIR = \"csars\"",
"modifier": "public final static",
"original_string": "public final static String CSARS_DIR = \"csars\";",
"type": "String",
"var_name": "CSARS_DIR"
},
{
"declarator": "TRANSFORMATION_DIR = \"transformations\"",
... | {
"body": "@Override\n public Optional<Csar> find(String identifier) {\n Csar csar = csarMap.get(identifier);\n return Optional.ofNullable(csar);\n }",
"class_method_signature": "CsarFilesystemDao.find(String identifier)",
"constructor": false,
"full_signature": "@Override public Optional<Cs... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_21 | {
"fields": [
{
"declarator": "fileCreator",
"modifier": "private",
"original_string": "private CloudFormationFileCreator fileCreator;",
"type": "CloudFormationFileCreator",
"var_name": "fileCreator"
},
{
"declarator": "cfnModule",
"modifier": "private",
"or... | {
"body": "@Test\n public void copyUtilScripts() throws Exception {\n fileCreator.copyUtilScripts();\n\n File createBucketUtilScript = new File(targetDir,\n UTIL_DIR_PATH + FILENAME_CREATE_BUCKET + BASH_FILE_ENDING);\n File uploadFileUtilScript = new File(targetDir,\n UTI... | {
"fields": [
{
"declarator": "CLI_COMMAND_CREATESTACK = \"aws cloudformation deploy \"",
"modifier": "public static final",
"original_string": "public static final String CLI_COMMAND_CREATESTACK = \"aws cloudformation deploy \";",
"type": "String",
"var_name": "CLI_COMMAND_CREATESTA... | {
"body": "public void copyUtilScripts() throws IOException {\n //Iterate over all files in the script list\n List<String> utilScripts = IOUtils.readLines(\n getClass().getResourceAsStream(FILEPATH_SCRIPTS_UTIL + \"scripts-list\"),\n Charsets.UTF_8\n );\n\n logger.deb... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_0 | {
"fields": [
{
"declarator": "LIST_CSARS_URL = \"/api/csars\"",
"modifier": "private static final",
"original_string": "private static final String LIST_CSARS_URL = \"/api/csars\";",
"type": "String",
"var_name": "LIST_CSARS_URL"
},
{
"declarator": "MOCK_CSAR_NAMES = {... | {
"body": "@Test\n public void listCsars() throws Exception {\n ResultActions resultActions = mvc.perform(\n get(LIST_CSARS_URL).accept(ACCEPTED_MIME_TYPE)\n ).andDo(print()).andExpect(status().is2xxSuccessful());\n resultActions.andExpect(jsonPath(\"$.links[0].rel\").value(\"self\"... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CsarController.class)",
"modifier": "private final static",
"original_string": "private final static Logger log = LoggerFactory.getLogger(CsarController.class);",
"type": "Logger",
"var_name": "log"
},
{
"decl... | {
"body": "@ApiOperation(\n value = \"List all CSARs stored on the server\",\n notes = \"Returns a Hypermedia Resource containing all CSARs\" +\n \" that have been uploaded to the server and did not get removed\",\n response = CsarResources.class,\n produces = \"application/hal+... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_56 | {
"fields": [
{
"declarator": "transformationDao",
"modifier": "private",
"original_string": "private TransformationDao transformationDao;",
"type": "TransformationDao",
"var_name": "transformationDao"
},
{
"declarator": "csarDao",
"modifier": "@Mock\n private"... | {
"body": "@Test\n public void findSpecificTransformation() {\n when(csarDao.getTransformationsDir(csar)).thenReturn(tmpdir);\n when(platformService.findPlatformById(PLATFORM1.id)).thenReturn(Optional.of(PLATFORM1));\n when(platformService.findPlatformById(PLATFORM2.id)).thenReturn(Optional.of... | {
"fields": [
{
"declarator": "ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\"",
"modifier": "public final static",
"original_string": "public final static String ARTIFACT_FAILED_REGEX = \".+-.+_.+_failed\\\\.zip\";",
"type": "String",
"var_name": "ARTIFACT_FAILED_REGEX"
},
... | {
"body": "@Override\n public Optional<Transformation> find(Csar csar, Platform platform) {\n Set<Transformation> transformations = readFromDisk(csar);\n return Optional.ofNullable(transformations.stream()\n .filter(transformation -> transformation.getCsar().equals(csar) && transformation.... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_17 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(CapabilityMapperTest.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(CapabilityMapperTest.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@Test\n public void testMapComputeCapabilityToInstanceTypeEC2() {\n String instanceType = capabilityMapper.mapComputeCapabilityToInstanceType(containerCapability, EC2_DISTINCTION);\n Assert.assertEquals(instanceType, expectedEC2);\n }",
"class_method_signature": "CapabilityMapperTest.... | {
"fields": [
{
"declarator": "EC2_DISTINCTION = \"EC2\"",
"modifier": "public static final",
"original_string": "public static final String EC2_DISTINCTION = \"EC2\";",
"type": "String",
"var_name": "EC2_DISTINCTION"
},
{
"declarator": "RDS_DISTINCTION = \"RDS\"",
... | {
"body": "public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws\n IllegalArgumentException {\n Integer numCpus = computeCapability.getNumCpus().orElse(0);\n Integer memSize = computeCapability.getMemSizeInMb().orElse(0);\n //defau... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
96331237_40 | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(LogImplTest.class)",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(LogImplTest.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "l... | {
"body": "@Test\n public void getPartialLogEntries() throws Exception {\n logger.info(\"Trying to log from index 50\");\n List<LogEntry> logs = log.getLogEntries(50);\n logger.info(\"Checking length\");\n assertTrue(logs.size() == 50);\n logger.info(\"Checking data\");\n ... | {
"fields": [
{
"declarator": "exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class)",
"modifier": "private final static",
"original_string": "private final static org.slf4j.Logger exceptionHandlingLogger = LoggerFactory.getLogger(LogImpl.class);",
"type": "org.slf4j.Logger",
... | {
"body": "@Override\n public List<LogEntry> getLogEntries(int first, int last) {\n return getLogEntries(first, last, true);\n }",
"class_method_signature": "LogImpl.getLogEntries(int first, int last)",
"constructor": false,
"full_signature": "@Override public List<LogEntry> getLogEntries(int first... | {
"created": null,
"fork": null,
"fork_count": 4,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96331237,
"size": 97630,
"stargazer_count": 10,
"stars": null,
"updates": null,
"url": "https://github.com/StuPro-TOSCAna/TOSCAna"
} |
9818626_0 | {
"fields": [],
"file": "src/extension/wps/wps-core/src/test/java/org/geoserver/wps/gs/ImportProcessTest.java",
"identifier": "ImportProcessTest",
"interfaces": "",
"superclass": "extends WPSTestSupport"
} | {
"body": "@Test\n public void testImportBuildings() throws Exception {\n FeatureTypeInfo ti = getCatalog().getFeatureTypeByName(getLayerId(SystemTestData.BUILDINGS));\n SimpleFeatureCollection rawSource = (SimpleFeatureCollection) ti.getFeatureSource(null,\n null).getFeatures();\n ... | {
"fields": [
{
"declarator": "LOGGER = Logging.getLogger(ImportProcess.class)",
"modifier": "static final",
"original_string": "static final Logger LOGGER = Logging.getLogger(ImportProcess.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "DEFAULT_WRI... | {
"body": "@DescribeResult(name = \"layerName\", description = \"Name of the new featuretype, with workspace\")\n public String execute(\n @DescribeParameter(name = \"features\", min = 0, description = \"Input feature collection\") SimpleFeatureCollection features,\n @DescribeParameter(name =... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9818626,
"size": 64057,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/geosolutions-it/geoserver-enterprise"
} |
9818626_1 | {
"fields": [],
"file": "src/extension/wps/wps-core/src/test/java/org/geoserver/wps/gs/ImportProcessTest.java",
"identifier": "ImportProcessTest",
"interfaces": "",
"superclass": "extends WPSTestSupport"
} | {
"body": "@Test\n public void testImportBuildingsForceCRS() throws Exception {\n FeatureTypeInfo ti = getCatalog().getFeatureTypeByName(getLayerId(SystemTestData.BUILDINGS));\n SimpleFeatureCollection rawSource = (SimpleFeatureCollection) ti.getFeatureSource(null,\n null).getFeatures(... | {
"fields": [
{
"declarator": "LOGGER = Logging.getLogger(ImportProcess.class)",
"modifier": "static final",
"original_string": "static final Logger LOGGER = Logging.getLogger(ImportProcess.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "DEFAULT_WRI... | {
"body": "@DescribeResult(name = \"layerName\", description = \"Name of the new featuretype, with workspace\")\n public String execute(\n @DescribeParameter(name = \"features\", min = 0, description = \"Input feature collection\") SimpleFeatureCollection features,\n @DescribeParameter(name =... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9818626,
"size": 64057,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/geosolutions-it/geoserver-enterprise"
} |
9818626_2 | {
"fields": [
{
"declarator": "initer",
"modifier": "",
"original_string": "WPSInitializer initer;",
"type": "WPSInitializer",
"var_name": "initer"
}
],
"file": "src/extension/wps/wps-core/src/test/java/org/geoserver/wps/WPSInitializerTest.java",
"identifier": "WPSInitializ... | {
"body": "@Test\n public void testSingleSave() throws Exception {\n \n GeoServer gs = createMock(GeoServer.class);\n\n List<ConfigurationListener> listeners = new ArrayList();\n gs.addListener(capture(listeners));\n expectLastCall().atLeastOnce();\n\n //empty list should ... | {
"fields": [
{
"declarator": "executionManager",
"modifier": "",
"original_string": "WPSExecutionManager executionManager;",
"type": "WPSExecutionManager",
"var_name": "executionManager"
},
{
"declarator": "processManager",
"modifier": "",
"original_string"... | {
"body": "public void initialize(final GeoServer geoServer) throws Exception {\n initWPS(geoServer.getService(WPSInfo.class), geoServer);\n\n geoServer.addListener(new ConfigurationListenerAdapter() {\n @Override\n public void handlePostGlobalChange(GeoServerInfo global) {\n ... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9818626,
"size": 64057,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/geosolutions-it/geoserver-enterprise"
} |
9818626_3 | {
"fields": [],
"file": "src/extension/wps/wps-core/src/test/java/org/geoserver/wps/WPSXStreamLoaderTest.java",
"identifier": "WPSXStreamLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateFromScratch() throws Exception {\n WPSXStreamLoader loader = new WPSXStreamLoader(new GeoServerResourceLoader());\n WPSInfo wps = loader.createServiceFromScratch(null);\n assertNotNull(wps);\n assertEquals(\"WPS\", wps.getName());\n }",
"cla... | {
"fields": [],
"file": "src/extension/wps/wps-core/src/main/java/org/geoserver/wps/WPSXStreamLoader.java",
"identifier": "WPSXStreamLoader",
"interfaces": "",
"methods": [
{
"class_method_signature": "WPSXStreamLoader.WPSXStreamLoader(GeoServerResourceLoader resourceLoader)",
"constructor": t... | {
"body": "protected WPSInfo createServiceFromScratch(GeoServer gs) {\n WPSInfoImpl wps = new WPSInfoImpl();\n wps.setName(\"WPS\");\n wps.setGeoServer( gs );\n wps.getVersions().add( new Version( \"1.0.0\") );\n wps.setMaxAsynchronousProcesses(Runtime.getRuntime().availableProcesso... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9818626,
"size": 64057,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/geosolutions-it/geoserver-enterprise"
} |
9818626_4 | {
"fields": [
{
"declarator": "resourceMgr",
"modifier": "",
"original_string": "WPSResourceManager resourceMgr;",
"type": "WPSResourceManager",
"var_name": "resourceMgr"
}
],
"file": "src/extension/wps/wps-core/src/test/java/org/geoserver/wps/resource/WPSResourceManagerTest.... | {
"body": "@Test\n public void testAddResourceNoExecutionId() throws Exception {\n File f = File.createTempFile(\"dummy\", \"dummy\", new File(\"target\"));\n resourceMgr.addResource(new WPSFileResource(f));\n }",
"class_method_signature": "WPSResourceManagerTest.testAddResourceNoExecutionId()",... | {
"fields": [
{
"declarator": "LOGGER = Logging.getLogger(WPSResourceManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logging.getLogger(WPSResourceManager.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "public void addResource(WPSResource resource) {\n String processId = getExecutionId(null);\n ExecutionResources resources = resourceCache.get(processId);\n if (resources == null) {\n throw new IllegalStateException(\"The executionId was not set for the current thread!\");\n ... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9818626,
"size": 64057,
"stargazer_count": 11,
"stars": null,
"updates": null,
"url": "https://github.com/geosolutions-it/geoserver-enterprise"
} |
17517521_263 | {
"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 shouldSerializeSingleItemAudienceAsArray() throws Exception {\n ClaimsHolder holder = holderFor(\"aud\", new String[]{\"auth0\"});\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(),... | {
"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_22 | {
"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 shouldGetCustomClaimOfTypeDate() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoxNDc4ODkxNTIxfQ.mhioumeok8fghQEhTKF3QtQAksSvZ_9wIhJmgZLhJ6c\";\n Date date = new Date(1478891521000L);\n DecodedJWT jwt = JWT.decode(token);\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_326 | {
"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 shouldGetDateWhenParsingNumericNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n long seconds = 1478627949 / 1000;\n LongNode node = new LongNode(seconds);\n tree.put(\"key\", node);\n\n Date date = deserializer.getDateFrom... | {
"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": "Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n if (!node.canConvertToLong()) {\n throw new JWTDecodeException(String.format(\"The cla... | {
"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_234 | {
"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 shouldGetCustomClaims() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsImlzQWRtaW4iOnRydWV9.eyJpc0FkbWluIjoibm9wZSJ9.YDKBAgUDbh0PkhioDcLNzdQ8c2Gdf_yS6zdEtJQS3F0\";\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_75 | {
"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 shouldFailNoneVerificationWhenTokenHasTwoParts() throws Exception {\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(\"The token was expected to have 3 parts, but got 2.\");\n String jwt = \"eyJhbGciOiJub25lIiwiY3R5IjoiSldUIn0.eyJpc3MiOiJhd... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/algorithms/NoneAlgorithm.java",
"identifier": "NoneAlgorithm",
"interfaces": "",
"methods": [
{
"class_method_signature": "NoneAlgorithm.NoneAlgorithm()",
"constructor": true,
"full_signature": " NoneAlgorithm()",
"identifie... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n if (signatureBytes.length > 0) {\n throw new SignatureVerificationException(this);\n }\n }",
"class_method_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_222 | {
"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 shouldGetSignature() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.e30.XmNK3GpH3Ys_7wsYBfq4C3M6goz71I7dTgUkuIa5lyQ\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n .verify(token);\n\n assertT... | {
"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_63 | {
"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 shouldThrowRSA512InstanceWithNullKeyProvider() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Key Provider cannot be null.\");\n RSAKeyProvider provider = null;\n Algorithm.RSA512(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 RSA512(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS512\", \"SHA512withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA512(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "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_275 | {
"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 shouldSerializeNulls() throws Exception {\n ClaimsHolder holder = holderFor(\"id\", null);\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is(equalTo(\"{\\\"id\\\":null}\")));\n ... | {
"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_330 | {
"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 shouldGetStringWhenParsingTextNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n TextNode node = new TextNode(\"something here\");\n tree.put(\"key\", node);\n\n String text = deserializer.getString(tree, \"key\");\n assertT... | {
"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": "String getString(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n return node.asText(null);\n }",
"class_method_signature": "PayloadDeserializer.getString(Map<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_34 | {
"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 shouldRemoveAudienceWhenPassingNull() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .withAudience(\"John\")\n .withAudience((String) null)\n .build();... | {
"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_127 | {
"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 shouldDoHMAC384SigningWithBytes() throws Exception {\n Algorithm algorithm = Algorithm.HMAC384(\"secret\".getBytes(StandardCharsets.UTF_8));\n\n String jwt = asJWT(algorithm, HS384Header, auth0IssPayload);\n String expectedSignature = \"4-y2Gxz_foN0jAOFimmBPF7DWx... | {
"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_170 | {
"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 shouldThrowECDSA512VerificationWithDERSignatureWithBothKeys() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA512withECDSA\");\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_18 | {
"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 shouldNotGetNullClaimIfClaimIsEmptyObject() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJvYmplY3QiOnt9fQ.d3nUeeL_69QsrHL0ZWij612LHEQxD8EZg1rNoY3a4aI\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getClaim(\"object\"), is... | {
"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_259 | {
"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 shouldGetClaims() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n tree.put(\"extraClaim\", new TextNode(\"extraValue\"));\n tree.put(\"sub\", new TextNode(\"auth0\"));\n PayloadImpl payload = new PayloadImpl(null, null, null, null, nul... | {
"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 Map<String, Claim> getClaims() {\n Map<String, Claim> claims = new HashMap<>(tree.size() * 2);\n for (String name : tree.keySet()) {\n claims.put(name, extractClaim(name, tree, objectReader));\n }\n return Collections.unmodifiableMap(claims);\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_6 | {
"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 shouldGetSubject() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUb2szbnMifQ.RudAxkslimoOY3BLl2Ghny3BrUKu9I1ZrXzCZGDJtNs\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getSubject(), is(\"Tok3ns\"));\n }",
"cl... | {
"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_166 | {
"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 shouldFailECDSA384VerificationOnInvalidDERSignature() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withECDSA\");\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_189 | {
"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 shouldDoECDSA512SigningWithProvidedPrivateKey() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n PrivateKey privateKey = readPrivateKeyFromFile(PRIVATE_KEY_FILE_512, \"EC\");\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY... | {
"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_131 | {
"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 shouldDoHMAC512SigningWithString() throws Exception {\n Algorithm algorithm = Algorithm.HMAC512(\"secret\");\n\n String jwt = asJWT(algorithm ,HS512Header, auth0IssPayload);\n String expectedSignature = \"OXWyxmf-VcVo8viOiTFfLaEy6mrQqLEos5R82Xsx8mtFxQadJAQ1aVniIW... | {
"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_59 | {
"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 shouldThrowRSA384InstanceWithNullKeys() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n Algorithm.RSA384(null, null);\n }",
"class_method_signature": "AlgorithmTest.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 RSA384(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS384\", \"SHA384withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA384(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "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_218 | {
"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 shouldAcceptECDSA256Algorithm() throws Exception {\n String token = \"eyJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJhdXRoMCJ9.4iVk3-Y0v4RT4_9IaQlp-8dZ_4fsTzIylgrPTDLrEvTHBTyVS3tgPbr2_IZfLETtiKRqCg0aQ5sh9eIsTTwB1g\";\n ECKey key = (ECKey) PemUtils.readPublicKeyFromFile(PUBLIC_KEY_FILE... | {
"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_280 | {
"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 shouldParsePayload() throws Exception {\n ObjectMapper mapper = mock(ObjectMapper.class);\n ObjectReader reader = mock(ObjectReader.class);\n when(mapper.readerFor(Payload.class)).thenReturn(reader);\n JWTParser parser = new JWTParser(mapper);\n par... | {
"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_146 | {
"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 shouldPassECDSA256KVerificationWithJOSESignature() throws Exception {\n ECPublicKey key = (ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256K, \"EC\");\n Algorithm algorithm = Algorithm.ECDSA256K(key, null);\n algorithm.verify(JWT.decode(ES256K_JWT));\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_96 | {
"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 shouldDoRSA256SigningWithBothKeys() throws Exception {\n Algorithm algorithm = Algorithm.RSA256((RSAPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\"), (RSAPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\"));\n\n String jwt = asJWT(algorithm, RS256Hea... | {
"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_238 | {
"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 shouldGetNullStringWhenParsingNullNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n NullNode node = NullNode.getInstance();\n tree.put(\"key\", node);\n\n String text = deserializer.getString(tree, \"key\");\n assertThat(te... | {
"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/HeaderDeserializer.java",
"identif... | {
"body": "String getString(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n return node.asText(null);\n }",
"class_method_signature": "HeaderDeserializer.getString(Map<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_79 | {
"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 shouldPassRSA256VerificationWithProvidedPublicKey() 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_111 | {
"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 shouldBeEqualSignatureMethodResults() throws Exception {\n RSAPrivateKey privateKey = (RSAPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\");\n RSAPublicKey publicKey = (RSAPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\");\n\n Algorithm algor... | {
"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_80 | {
"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 shouldFailRSA256VerificationWhenProvidedPublicKeyIsNull() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withRSA\");\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_107 | {
"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 shouldDoRSA512SigningWithProvidedPrivateKey() throws Exception {\n RSAKeyProvider provider = mock(RSAKeyProvider.class);\n PrivateKey privateKey = readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\");\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE, \"... | {
"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_279 | {
"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 shouldGetDefaultObjectMapper() throws Exception {\n ObjectMapper mapper = getDefaultObjectMapper();\n assertThat(mapper, is(notNullValue()));\n assertThat(mapper, is(instanceOf(ObjectMapper.class)));\n assertThat(mapper.isEnabled(SerializationFeature.FAIL_... | {
"fields": [
{
"declarator": "payloadReader",
"modifier": "private final",
"original_string": "private final ObjectReader payloadReader;",
"type": "ObjectReader",
"var_name": "payloadReader"
},
{
"declarator": "headerReader",
"modifier": "private final",
"o... | {
"body": "static ObjectMapper getDefaultObjectMapper() {\n ObjectMapper mapper = new ObjectMapper();\n mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);\n mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);\n return mapper;\n }",
"class_method_signature": "JWTPar... | {
"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_296 | {
"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 shouldGetNullContentTypeIfMissing() throws Exception {\n BasicHeader header = new BasicHeader(null, null, null, null, null, objectReader);\n\n assertThat(header, is(notNullValue()));\n assertThat(header.getContentType(), is(nullValue()));\n }",
"class_method... | {
"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 getContentType() {\n return contentType;\n }",
"class_method_signature": "BasicHeader.getContentType()",
"constructor": false,
"full_signature": "@Override public String getContentType()",
"identifier": "getContentType",
"invocations": [],
"modifiers": "@O... | {
"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_38 | {
"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": "@SuppressWarnings(\"RedundantCast\")\n @Test\n public void shouldAddCustomLeewayToDateClaims() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .acceptLeeway(1234L)\n .build();\n\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_150 | {
"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 shouldFailECDSA256KVerificationWhenProvidedPublicKeyIsNull() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n e... | {
"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_43 | {
"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 shouldThrowOnNegativeExpiresAtLeeway() 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_202 | {
"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 shouldDecodeECDSA384JOSE() throws Exception {\n ECDSAAlgorithm algorithm384 = (ECDSAAlgorithm) Algorithm.ECDSA384((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_384, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_384, \"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_310 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsArray() throws Exception {\n assertThat(claim.asArray(Object.class), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsArray()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsArray()",
"identifier": "shoul... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public <T> T[] asArray(Class<T> tClazz) throws JWTDecodeException {\n return null;\n }",
"class_method_signature": "NullClaim.asArray(Class<T> tClazz)",
"constructor": false,
"full_signature": "@Override public T[] asArray(Class<T> tClazz)",
"identifier": "asArray",
"invo... | {
"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_14 | {
"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 shouldGetType() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.e30.WdFmrzx8b9v_a-r6EHC2PTAaWywgm_8LiP8RBRhYwkI\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getType(), is(\"JWS\"));\n }",
"class_method_s... | {
"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 getType() {\n return header.getType();\n }",
"class_method_signature": "JWTDecoder.getType()",
"constructor": false,
"full_signature": "@Override public String getType()",
"identifier": "getType",
"invocations": [
"getType"
],
"modifiers": "@Override... | {
"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_255 | {
"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 shouldGetJWTId() throws Exception {\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getId(), is(\"jwtId\"));\n }",
"class_method_signature": "PayloadImplTest.shouldGetJWTId()",
"constructor": false,
"full_signature": "@Test public void shouldGet... | {
"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 getId() {\n return jwtId;\n }",
"class_method_signature": "PayloadImpl.getId()",
"constructor": false,
"full_signature": "@Override public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"... | {
"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_193 | {
"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 shouldThrowOnDERSignatureConversionIfDoesNotHaveExpectedLength() throws Exception {\n ECDSAAlgorithm algorithm256 = (ECDSAAlgorithm) Algorithm.ECDSA256((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_256, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_256,... | {
"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_306 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsLong() throws Exception {\n assertThat(claim.asLong(), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsLong()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsLong()",
"identifier": "shouldGetAsLong",
"... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public Long asLong() {\n return null;\n }",
"class_method_signature": "NullClaim.asLong()",
"constructor": false,
"full_signature": "@Override public Long asLong()",
"identifier": "asLong",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"ret... | {
"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_243 | {
"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 shouldGetIssuer() throws Exception {\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getIssuer(), is(\"issuer\"));\n }",
"class_method_signature": "PayloadImplTest.shouldGetIssuer()",
"constructor": false,
"full_signature": "@Test public void sh... | {
"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_185 | {
"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 shouldFailOnECDSA384SigningWhenProvidedPrivateKeyIsNull() throws Exception {\n exception.expect(SignatureGenerationException.class);\n exception.expectMessage(\"The Token's Signature couldn't be generated when signing 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 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_55 | {
"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 shouldThrowRSA256InstanceWithNullKey() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n RSAKey key = null;\n Algorithm.RSA256(key);\n }",
"class_method_signatur... | {
"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 RSA256(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS256\", \"SHA256withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA256(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "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_214 | {
"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 shouldAcceptHMAC512Algorithm() throws Exception {\n String token = \"eyJhbGciOiJIUzUxMiIsImN0eSI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.VUo2Z9SWDV-XcOc_Hr6Lff3vl7L9e5Vb8ThXpmGDFjHxe3Dr1ZBmUChYF-xVA7cAdX1P_D4ZCUcsv3IefpVaJw\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC512(\"se... | {
"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_54 | {
"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 shouldThrowHMAC512InstanceWithNullSecret() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Secret cannot be null\");\n String secret = null;\n Algorithm.HMAC512(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 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_215 | {
"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 shouldAcceptRSA256Algorithm() throws Exception {\n String token = \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.dxXF3MdsyW-AuvwJpaQtrZ33fAde9xWxpLIg9cO2tMLH2GSRNuLAe61KsJusZhqZB9Iy7DvflcmRz-9OZndm6cj_ThGeJH2LLc90K83UEvvRPo8l85RrQb8PcanxCgIs2RcZOLygERizB3pr5icGkzR... | {
"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_184 | {
"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 shouldDoECDSA384SigningWithProvidedPrivateKey() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n PrivateKey privateKey = readPrivateKeyFromFile(PRIVATE_KEY_FILE_384, \"EC\");\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY... | {
"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_307 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsDouble() throws Exception {\n assertThat(claim.asDouble(), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsDouble()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsDouble()",
"identifier": "shouldGetAsDo... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public Double asDouble() {\n return null;\n }",
"class_method_signature": "NullClaim.asDouble()",
"constructor": false,
"full_signature": "@Override public Double asDouble()",
"identifier": "asDouble",
"invocations": [],
"modifiers": "@Override public",
"parameters": ... | {
"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_242 | {
"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 shouldHaveUnmodifiableAudience() throws Exception {\n exception.expect(UnsupportedOperationException.class);\n PayloadImpl payload = new PayloadImpl(null, null, new ArrayList<String>(), null, null, null, null, null, objectReader);\n payload.getAudience().add(\"so... | {
"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_192 | {
"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 shouldReturnSigningKeyIdFromProvider() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n when(provider.getPrivateKeyId()).thenReturn(\"keyId\");\n Algorithm algorithm = new ECDSAAlgorithm(\"some-alg\", \"some-algorithm\", 32, provid... | {
"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 String getSigningKeyId() {\n return keyProvider.getPrivateKeyId();\n }",
"class_method_signature": "ECDSAAlgorithm.getSigningKeyId()",
"constructor": false,
"full_signature": "@Override public String getSigningKeyId()",
"identifier": "getSigningKeyId",
"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_311 | {
"fields": [
{
"declarator": "claim",
"modifier": "private",
"original_string": "private NullClaim claim;",
"type": "NullClaim",
"var_name": "claim"
}
],
"file": "lib/src/test/java/com/auth0/jwt/impl/NullClaimTest.java",
"identifier": "NullClaimTest",
"interfaces": "",
... | {
"body": "@Test\n public void shouldGetAsList() throws Exception {\n assertThat(claim.asList(Object.class), is(nullValue()));\n }",
"class_method_signature": "NullClaimTest.shouldGetAsList()",
"constructor": false,
"full_signature": "@Test public void shouldGetAsList()",
"identifier": "shouldGet... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/impl/NullClaim.java",
"identifier": "NullClaim",
"interfaces": "implements Claim",
"methods": [
{
"class_method_signature": "NullClaim.isNull()",
"constructor": false,
"full_signature": "@Override public boolean isNull()",
"i... | {
"body": "@Override\n public <T> List<T> asList(Class<T> tClazz) throws JWTDecodeException {\n return null;\n }",
"class_method_signature": "NullClaim.asList(Class<T> tClazz)",
"constructor": false,
"full_signature": "@Override public List<T> asList(Class<T> tClazz)",
"identifier": "asList",
"... | {
"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_15 | {
"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 shouldGetAlgorithm() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.e30.XmNK3GpH3Ys_7wsYBfq4C3M6goz71I7dTgUkuIa5lyQ\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getAlgorithm(), is(\"HS256\"));\n }",
"class_method_signa... | {
"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 getAlgorithm() {\n return header.getAlgorithm();\n }",
"class_method_signature": "JWTDecoder.getAlgorithm()",
"constructor": false,
"full_signature": "@Override public String getAlgorithm()",
"identifier": "getAlgorithm",
"invocations": [
"getAlgorithm"
... | {
"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_254 | {
"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 shouldGetNullIssuedAtIfMissing() throws Exception {\n PayloadImpl payload = new PayloadImpl(null, null, null, null, null, null, null, null, objectReader);\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getIssuedAt(), 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 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_42 | {
"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 shouldThrowOnNegativeCustomLeeway() 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_203 | {
"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 shouldDecodeECDSA384DER() throws Exception {\n ECDSAAlgorithm algorithm384 = (ECDSAAlgorithm) Algorithm.ECDSA384((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_384, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_384, \"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_151 | {
"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 shouldFailECDSA256KVerificationWithInvalidPublicKey() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\");\n Algorith... | {
"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_278 | {
"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 shouldSerializeCustomObject() throws Exception {\n UserPojo user = new UserPojo(\"Michael\", 1);\n ClaimsHolder holder = holderFor(\"users\", user);\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n asse... | {
"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_297 | {
"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 shouldGetKeyId() throws Exception {\n BasicHeader header = new BasicHeader(null, null, null, \"key\", null, objectReader);\n\n assertThat(header, is(notNullValue()));\n assertThat(header.getKeyId(), is(notNullValue()));\n assertThat(header.getKeyId(), is(\... | {
"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 getKeyId() {\n return keyId;\n }",
"class_method_signature": "BasicHeader.getKeyId()",
"constructor": false,
"full_signature": "@Override public String getKeyId()",
"identifier": "getKeyId",
"invocations": [],
"modifiers": "@Override public",
"parameters... | {
"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_39 | {
"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": "@SuppressWarnings(\"RedundantCast\")\n @Test\n public void shouldOverrideDefaultIssuedAtLeeway() throws Exception {\n Algorithm algorithm = mock(Algorithm.class);\n JWTVerifier verifier = JWTVerifier.init(algorithm)\n .acceptLeeway(1234L)\n .acceptIssuedAt(... | {
"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_106 | {
"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 shouldDoRSA512SigningWithBothKeys() throws Exception {\n Algorithm algorithm = Algorithm.RSA512((RSAPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\"), (RSAPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\"));\n\n String jwt = asJWT(algorithm, RS512Hea... | {
"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_81 | {
"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 shouldFailRSA256VerificationWithInvalidPublicKey() throws Exception {\n exception.expect(SignatureVerificationException.class);\n exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withRSA\");\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_110 | {
"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 shouldReturnSigningKeyIdFromProvider() throws Exception {\n RSAKeyProvider provider = mock(RSAKeyProvider.class);\n when(provider.getPrivateKeyId()).thenReturn(\"keyId\");\n Algorithm algorithm = new RSAAlgorithm(\"some-alg\", \"some-algorithm\", provider);\n\n ... | {
"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 String getSigningKeyId() {\n return keyProvider.getPrivateKeyId();\n }",
"class_method_signature": "RSAAlgorithm.getSigningKeyId()",
"constructor": false,
"full_signature": "@Override public String getSigningKeyId()",
"identifier": "getSigningKeyId",
"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_97 | {
"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 shouldDoRSA256SigningWithProvidedPrivateKey() throws Exception {\n RSAKeyProvider provider = mock(RSAKeyProvider.class);\n PrivateKey privateKey = readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\");\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE, \"... | {
"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_239 | {
"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 shouldGetNullStringWhenParsingNull() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n tree.put(\"key\", null);\n\n String text = deserializer.getString(tree, \"key\");\n assertThat(text, is(nullValue()));\n }",
"class_method_signat... | {
"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/HeaderDeserializer.java",
"identif... | {
"body": "String getString(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n return node.asText(null);\n }",
"class_method_signature": "HeaderDeserializer.getString(Map<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_78 | {
"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 shouldPassRSA256VerificationWithBothKeys() throws Exception {\n String jwt = \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.dxXF3MdsyW-AuvwJpaQtrZ33fAde9xWxpLIg9cO2tMLH2GSRNuLAe61KsJusZhqZB9Iy7DvflcmRz-9OZndm6cj_ThGeJH2LLc90K83UEvvRPo8l85RrQb8PcanxCgIs2RcZOLygERiz... | {
"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_147 | {
"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 shouldThrowOnECDSA256KVerificationWithDERSignature() 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_281 | {
"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 shouldThrowOnInvalidPayload() throws Exception {\n String jsonPayload = \"{{\";\n exception.expect(JWTDecodeException.class);\n exception.expectMessage(String.format(\"The string '%s' doesn't have a valid JSON format.\", jsonPayload));\n Payload payload = ... | {
"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_58 | {
"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 shouldThrowRSA384InstanceWithNullKey() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n RSAKey key = null;\n Algorithm.RSA384(key);\n }",
"class_method_signatur... | {
"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 RSA384(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS384\", \"SHA384withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA384(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "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_219 | {
"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 shouldAcceptECDSA384Algorithm() throws Exception {\n String token = \"eyJhbGciOiJFUzM4NCJ9.eyJpc3MiOiJhdXRoMCJ9.50UU5VKNdF1wfykY8jQBKpvuHZoe6IZBJm5NvoB8bR-hnRg6ti-CHbmvoRtlLfnHfwITa_8cJMy6TenMC2g63GQHytc8rYoXqbwtS4R0Ko_AXbLFUmfxnGnMC6v4MS_z\";\n ECKey key = (ECKey) PemU... | {
"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_130 | {
"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 shouldDoHMAC384SigningWithString() throws Exception {\n Algorithm algorithm = Algorithm.HMAC384(\"secret\");\n\n String jwt = asJWT(algorithm, HS384Header, auth0IssPayload);\n String expectedSignature = \"4-y2Gxz_foN0jAOFimmBPF7DWxf4AsjM20zxNkHg8Zah5Q64G42P9GfjmU... | {
"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_7 | {
"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 shouldGetArrayAudience() throws Exception {\n DecodedJWT jwt = JWT.decode(\"eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOlsiSG9wZSIsIlRyYXZpcyIsIlNvbG9tb24iXX0.Tm4W8WnfPjlmHSmKFakdij0on2rWPETpoM7Sh0u6-S4\");\n assertThat(jwt, is(notNullValue()));\n assertThat(jwt.getAudience(),... | {
"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 List<String> getAudience() {\n return payload.getAudience();\n }",
"class_method_signature": "JWTDecoder.getAudience()",
"constructor": false,
"full_signature": "@Override public List<String> getAudience()",
"identifier": "getAudience",
"invocations": [
"getAud... | {
"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_167 | {
"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 shouldPassECDSA512VerificationWithJOSESignature() throws Exception {\n String jwt = \"eyJhbGciOiJFUzUxMiJ9.eyJpc3MiOiJhdXRoMCJ9.AeCJPDIsSHhwRSGZCY6rspi8zekOw0K9qYMNridP1Fu9uhrA1QrG-EUxXlE06yvmh2R7Rz0aE7kxBwrnq8L8aOBCAYAsqhzPeUvyp8fXjjgs0Eto5I0mndE2QHlgcMSFASyjHbU8wD2Rq7ZNzGQ5b... | {
"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_188 | {
"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 shouldDoECDSA512SigningWithBothKeys() throws Exception {\n Algorithm algorithm = Algorithm.ECDSA512((ECPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE_512, \"EC\"), (ECPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE_512, \"EC\"));\n\n String jwt = asJWT(algorithm, ... | {
"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_19 | {
"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 shouldGetCustomClaimOfTypeInteger() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoxMjN9.XZAudnA7h3_Al5kJydzLjw6RzZC3Q6OvnLEYlhNW7HA\";\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_258 | {
"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 PayloadImpl payload = new PayloadImpl(null, null, null, null, null, null, null, null, objectReader);\n assertThat(payload, is(notNullValue()));\n assertThat(payload.getClaim(\"missing\"), is(notNullValue(... | {
"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 Claim getClaim(String name) {\n return extractClaim(name, tree, objectReader);\n }",
"class_method_signature": "PayloadImpl.getClaim(String name)",
"constructor": false,
"full_signature": "@Override public Claim getClaim(String name)",
"identifier": "getClaim",
"in... | {
"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_171 | {
"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 shouldPassECDSA512VerificationWithProvidedPublicKey() throws Exception {\n ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class);\n PublicKey publicKey = readPublicKeyFromFile(PUBLIC_KEY_FILE_512, \"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_126 | {
"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 shouldDoHMAC256SigningWithBytes() throws Exception {\n Algorithm algorithm = Algorithm.HMAC256(\"secret\".getBytes(StandardCharsets.UTF_8));\n\n String jwt = asJWT(algorithm, HS256Header, auth0IssPayload);\n String expectedSignature = \"s69x7Mmu4JqwmdxiK6sesALO7t... | {
"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_274 | {
"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 shouldSerializeBooleans() throws Exception {\n ClaimsHolder holder = holderFor(\"pro\", true);\n serializer.serialize(holder, jsonGenerator, serializerProvider);\n jsonGenerator.flush();\n\n assertThat(writer.toString(), is(equalTo(\"{\\\"pro\\\":true}\"))... | {
"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_35 | {
"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 shouldThrowOnNullCustomClaimName() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"The Custom Claim's name can't be null.\");\n JWTVerifier.init(Algorithm.HMAC256(\"secret\"))\n .withClaim(null, \"... | {
"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_223 | {
"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 shouldGetIssuer() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJKb2huIERvZSJ9.SgXosfRR_IwCgHq5lF3tlM-JHtpucWCRSaVuoHTbWbQ\";\n DecodedJWT jwt = JWT.require(Algorithm.HMAC256(\"secret\"))\n .build()\n .verify(token);\... | {
"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_62 | {
"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 shouldThrowRSA512InstanceWithNullKeys() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Both provided Keys cannot be null.\");\n Algorithm.RSA512(null, null);\n }",
"class_method_signature": "AlgorithmTest.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 RSA512(RSAKeyProvider keyProvider) throws IllegalArgumentException {\n return new RSAAlgorithm(\"RS512\", \"SHA512withRSA\", keyProvider);\n }",
"class_method_signature": "Algorithm.RSA512(RSAKeyProvider keyProvider)",
"constructor": false,
"full_signature": "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_235 | {
"fields": [],
"file": "lib/src/test/java/com/auth0/jwt/ClockImplTest.java",
"identifier": "ClockImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldGetToday() throws Exception{\n Clock clock = new ClockImpl();\n Date clockToday = clock.getToday();\n assertThat(clockToday, is(notNullValue()));\n }",
"class_method_signature": "ClockImplTest.shouldGetToday()",
"constructor": false,
"full_signatur... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/ClockImpl.java",
"identifier": "ClockImpl",
"interfaces": "implements Clock",
"methods": [
{
"class_method_signature": "ClockImpl.ClockImpl()",
"constructor": true,
"full_signature": " ClockImpl()",
"identifier": "ClockImpl"... | {
"body": "@Override\n public Date getToday() {\n return new Date();\n }",
"class_method_signature": "ClockImpl.getToday()",
"constructor": false,
"full_signature": "@Override public Date getToday()",
"identifier": "getToday",
"invocations": [],
"modifiers": "@Override public",
"parameters"... | {
"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_74 | {
"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 shouldPassNoneVerification() throws Exception {\n Algorithm algorithm = Algorithm.none();\n String jwt = \"eyJhbGciOiJub25lIiwiY3R5IjoiSldUIn0.eyJpc3MiOiJhdXRoMCJ9.\";\n algorithm.verify(JWT.decode(jwt));\n }",
"class_method_signature": "NoneAlgorithmTest.sh... | {
"fields": [],
"file": "lib/src/main/java/com/auth0/jwt/algorithms/NoneAlgorithm.java",
"identifier": "NoneAlgorithm",
"interfaces": "",
"methods": [
{
"class_method_signature": "NoneAlgorithm.NoneAlgorithm()",
"constructor": true,
"full_signature": " NoneAlgorithm()",
"identifie... | {
"body": "@Override\n public void verify(DecodedJWT jwt) throws SignatureVerificationException {\n byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature());\n if (signatureBytes.length > 0) {\n throw new SignatureVerificationException(this);\n }\n }",
"class_method_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_262 | {
"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 shouldSerializeStringAudienceAsString() throws Exception {\n ClaimsHolder holder = holderFor(\"aud\", \"auth0\");\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_23 | {
"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 shouldGetCustomArrayClaimOfTypeString() throws Exception {\n String token = \"eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjpbInRleHQiLCIxMjMiLCJ0cnVlIl19.lxM8EcmK1uSZRAPd0HUhXGZJdauRmZmLjoeqz4J9yAA\";\n DecodedJWT jwt = JWT.decode(token);\n Assert.assertThat(jwt, is(notNullVal... | {
"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_327 | {
"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 shouldGetLargeDateWhenParsingNumericNode() throws Exception {\n Map<String, JsonNode> tree = new HashMap<>();\n long seconds = Integer.MAX_VALUE + 10000L;\n LongNode node = new LongNode(seconds);\n tree.put(\"key\", node);\n\n Date date = deserializ... | {
"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": "Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) {\n JsonNode node = tree.get(claimName);\n if (node == null || node.isNull()) {\n return null;\n }\n if (!node.canConvertToLong()) {\n throw new JWTDecodeException(String.format(\"The cla... | {
"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.