id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
3382195_210 | {
"fields": [
{
"declarator": "mockMvc",
"modifier": "private",
"original_string": "private MockMvc mockMvc;",
"type": "MockMvc",
"var_name": "mockMvc"
},
{
"declarator": "webApplicationContext",
"modifier": "@Autowired",
"original_string": "@Autowired\n ... | {
"body": "@Test\n public void testAcceptInvite_worksWithConsentProvided() throws Exception {\n IdentityZone defaultZone = IdentityZoneHolder.get();\n BrandingInformation branding = new BrandingInformation();\n branding.setConsent(new Consent(\"paying Jaskanwal Pawar & Jennifer Hamon each a mi... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(InvitationsController.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(InvitationsController.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@RequestMapping(value = \"/accept.do\", method = POST)\n public String acceptInvitation(@RequestParam(\"password\") String password,\n @RequestParam(\"password_confirmation\") String passwordConfirmation,\n @RequestParam(\"code\") Strin... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_355 | {
"fields": [
{
"declarator": "refreshTokenCreator",
"modifier": "private",
"original_string": "private RefreshTokenCreator refreshTokenCreator;",
"type": "RefreshTokenCreator",
"var_name": "refreshTokenCreator"
},
{
"declarator": "expectedEx = ExpectedException.none()"... | {
"body": "@Test\n public void refreshToken_includesClaimsNeededToBuildIdTokens() {\n UaaUser user = new UaaUser(new UaaUserPrototype()\n .withId(\"id\")\n .withEmail(\"spongebob@krustykrab.com\")\n .withUsername(\"spongebob\")\n .withOrigin(\"uaa\")\n );\n... | {
"fields": [
{
"declarator": "isRestrictRefreshGrant",
"modifier": "private",
"original_string": "private boolean isRestrictRefreshGrant;",
"type": "boolean",
"var_name": "isRestrictRefreshGrant"
},
{
"declarator": "refreshTokenValidityResolver",
"modifier": "pri... | {
"body": "public CompositeExpiringOAuth2RefreshToken createRefreshToken(UaaUser user,\n RefreshTokenRequestData tokenRequestData,\n String revocableHashSignature) {\n\n String grantType = tokenReque... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_206 | {
"fields": [
{
"declarator": "mockMvc",
"modifier": "private",
"original_string": "private MockMvc mockMvc;",
"type": "MockMvc",
"var_name": "mockMvc"
},
{
"declarator": "webApplicationContext",
"modifier": "@Autowired",
"original_string": "@Autowired\n ... | {
"body": "@Test\n public void acceptInviteWithValidClientRedirect() throws Exception {\n UaaPrincipal uaaPrincipal = new UaaPrincipal(\"user-id-001\", \"user@example.com\", \"user@example.com\", OriginKeys.UAA, null,IdentityZoneHolder.get().getId());\n ScimUser user = new ScimUser(uaaPrincipal.getId... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(InvitationsController.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(InvitationsController.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@RequestMapping(value = \"/accept.do\", method = POST)\n public String acceptInvitation(@RequestParam(\"password\") String password,\n @RequestParam(\"password_confirmation\") String passwordConfirmation,\n @RequestParam(\"code\") Strin... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_51 | {
"fields": [
{
"declarator": "alias = \"saml\"",
"modifier": "public static final",
"original_string": "public static final String alias = \"saml\";",
"type": "String",
"var_name": "alias"
},
{
"declarator": "idpMetaData = \"<?xml version=\\\"1.0\\\"?>\\n\" +\n ... | {
"body": "@Test\n public void test_uaa_is_not_catch_all_without_fallback() {\n ldapDef.setEmailDomain(EMPTY_LIST);\n samlDef1.setEmailDomain(EMPTY_LIST);\n samlDef2.setEmailDomain(EMPTY_LIST);\n configureTestData();\n assertThat(filter.filter(activeProviders, client, email, fals... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DomainFilter.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(DomainFilter.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": "server/sr... | {
"body": "public static List<IdentityProvider> filter(List<IdentityProvider> activeProviders, ClientDetails client, String email) {\n return filter(activeProviders, client, email, true);\n }",
"class_method_signature": "DomainFilter.filter(List<IdentityProvider> activeProviders, ClientDetails client, Str... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_343 | {
"fields": [
{
"declarator": "oAuth2RequestFactory",
"modifier": "private",
"original_string": "private OAuth2RequestFactory oAuth2RequestFactory;",
"type": "OAuth2RequestFactory",
"var_name": "oAuth2RequestFactory"
},
{
"declarator": "uaaAuthorizationEndpoint",
... | {
"body": "@Test\n public void testGetGrantType_token_as_response_is_implcit() {\n responseTypes.add(\"token\");\n assertEquals(GRANT_TYPE_IMPLICIT, uaaAuthorizationEndpoint.deriveGrantTypeFromResponseType(responseTypes));\n }",
"class_method_signature": "UaaAuthorizationEndpointTest.testGetGran... | {
"fields": [
{
"declarator": "AUTHORIZATION_REQUEST = \"authorizationRequest\"",
"modifier": "public static final",
"original_string": "public static final String AUTHORIZATION_REQUEST = \"authorizationRequest\";",
"type": "String",
"var_name": "AUTHORIZATION_REQUEST"
},
{
... | {
"body": "protected String deriveGrantTypeFromResponseType(Set<String> responseTypes) {\n if (responseTypes.contains(\"token\")) {\n return GRANT_TYPE_IMPLICIT;\n } else if (responseTypes.size() == 1 && responseTypes.contains(\"id_token\")) {\n return GRANT_TYPE_IMPLICIT;\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_197 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/scim/util/ScimUtilsTest.java",
"identifier": "ScimUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void userWithNonAsciiUsername() {\n ScimUser user = new ScimUser(null, \"joe$eph\", \"Jo\", \"User\");\n user.setOrigin(OriginKeys.UAA);\n user.addEmail(\"jo@blah.com\");\n\n assertThrows(InvalidScimResourceException.class, () -> ScimUtils.validate(user));\n }",
... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ScimUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ScimUtils.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": "ser... | {
"body": "public static void validate(final ScimUser user) throws InvalidScimResourceException {\n Pattern usernamePattern = Pattern.compile(\"[\\\\p{L}+0-9+\\\\-_.@'!]+\");\n if (!hasText(user.getUserName())) {\n throw new InvalidScimResourceException(\"A username must be provided.\");\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_178 | {
"fields": [
{
"declarator": "samlResponseLoggerBinding",
"modifier": "private",
"original_string": "private SamlResponseLoggerBinding samlResponseLoggerBinding;",
"type": "SamlResponseLoggerBinding",
"var_name": "samlResponseLoggerBinding"
},
{
"declarator": "original... | {
"body": "@Test\n void doesNotFailWithNullServletRequest() {\n HttpServletRequestAdapter httpServletRequestAdapter = new HttpServletRequestAdapter(null);\n\n Configurator.setRootLevel(DEBUG);\n\n assertDoesNotThrow(() -> samlResponseLoggerBinding.supports(httpServletRequestAdapter));\n }",... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SamlResponseLoggerBinding.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SamlResponseLoggerBinding.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Override\n public boolean supports(InTransport transport) {\n if (!(transport instanceof HttpServletRequestAdapter)) {\n return false;\n }\n\n HttpServletRequest httpServletRequest = ((HttpServletRequestAdapter) transport).getWrappedRequest();\n LOGGER.warn(\"Malf... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_482 | {
"fields": [
{
"declarator": "mfaProviderProvisioning",
"modifier": "private",
"original_string": "private JdbcMfaProviderProvisioning mfaProviderProvisioning;",
"type": "JdbcMfaProviderProvisioning",
"var_name": "mfaProviderProvisioning"
},
{
"declarator": "mfaProvide... | {
"body": "@Test\n void createDuplicateWorksAcrossZones() {\n MfaProvider mfaProvider = constructGoogleProvider();\n String zoneId = IdentityZoneHolder.get().getId();\n assertEquals(0, (int) jdbcTemplate.queryForObject(\"select count(*) from mfa_providers where identity_zone_id=? and name=?\",... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(JdbcMfaProviderProvisioning.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(JdbcMfaProviderProvisioning.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@Override\n public MfaProvider create(MfaProvider provider, String zoneId) {\n mfaProviderValidator.validate(provider);\n final String id = UUID.randomUUID().toString();\n try {\n jdbcTemplate.update(CREATE_PROVIDER_SQL, ps -> {\n int pos = 1;\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_251 | {
"fields": [
{
"declarator": "samlTestUtils = new SamlTestUtils()",
"modifier": "private final",
"original_string": "private final SamlTestUtils samlTestUtils = new SamlTestUtils();",
"type": "SamlTestUtils",
"var_name": "samlTestUtils"
},
{
"declarator": "conf = null"... | {
"body": "@Test(expected = MetadataProviderException.class)\n public void testValidateSamlServiceProviderWithConflictingEntityId() throws Exception {\n SamlServiceProvider sp = mockSamlServiceProviderForZone(\"uaa\");\n\n conf.validateSamlServiceProvider(sp);\n SamlServiceProviderDefinition d... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(SamlServiceProviderConfigurator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(SamlServiceProviderConfigurator.class);",
"type": "Logger",
"var_nam... | {
"body": "public void validateSamlServiceProvider(SamlServiceProvider provider) throws MetadataProviderException {\n validateSamlServiceProvider(provider, IdentityZoneHolder.get());\n }",
"class_method_signature": "SamlServiceProviderConfigurator.validateSamlServiceProvider(SamlServiceProvider provider)"... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_314 | {
"fields": [
{
"declarator": "userId",
"modifier": "private",
"original_string": "private String userId;",
"type": "String",
"var_name": "userId"
},
{
"declarator": "endpoint",
"modifier": "private",
"original_string": "private TotpMfaEndpoint endpoint;",
... | {
"body": "@Test\n public void testGenerateQrUrlForNewUserRegistration() throws Exception{\n when(uaaAuthentication.getPrincipal()).thenReturn(new UaaPrincipal(userId, \"Marissa\", null, null, null, null), null, null);\n\n when(userGoogleMfaCredentialsProvisioning.activeUserCredentialExists(userId, m... | {
"fields": [
{
"declarator": "mfaCredentialsProvisioning",
"modifier": "private final",
"original_string": "private final UserGoogleMfaCredentialsProvisioning mfaCredentialsProvisioning;",
"type": "UserGoogleMfaCredentialsProvisioning",
"var_name": "mfaCredentialsProvisioning"
}... | {
"body": "@RequestMapping(value = {\"/register\"}, method = RequestMethod.GET)\n public String generateQrUrl(Model model,\n @ModelAttribute(\"uaaMfaCredentials\") UserGoogleMfaCredentials credentials)\n throws WriterException, IOException, UaaPrincipalIsNotInSession {\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_466 | {
"fields": [
{
"declarator": "validator",
"modifier": "",
"original_string": "GeneralMfaProviderValidator validator;",
"type": "GeneralMfaProviderValidator",
"var_name": "validator"
},
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@... | {
"body": "@Test\n public void validateProviderTrimsName() {\n String name = \" This is also a valid name \";\n MfaProvider provider = createValidGoogleMfaProvider()\n .setName(name);\n provider.setName(\" \" + name + \" \");\n validator.validate(provider);\n ... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/mfa/GeneralMfaProviderValidator.java",
"identifier": "GeneralMfaProviderValidator",
"interfaces": "implements MfaProviderValidator",
"methods": [
{
"class_method_signature": "GeneralMfaProviderValidator.validate(MfaProvider ... | {
"body": "@Override\n public void validate(MfaProvider mfaProvider) {\n if(mfaProvider.getName() == null || StringUtils.isEmpty(mfaProvider.getName().trim())) {\n throw new InvalidMfaProviderException(\"Provider name is required\");\n }\n mfaProvider.setName(mfaProvider.getName().t... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_173 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/authentication/UaaAuthenticationDetailsTest.java",
"identifier": "UaaAuthenticationDetailsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testSavesRequestParameters() {\n MockHttpServletRequest request = new MockHttpServletRequest();\n request.addParameter(\"key\", \"value\");\n\n UaaAuthenticationDetails details = new UaaAuthenticationDetails(request, null);\n assertEquals(\"value\", details.getPa... | {
"fields": [
{
"declarator": "ADD_NEW = \"add_new\"",
"modifier": "public static final",
"original_string": "public static final String ADD_NEW = \"add_new\";",
"type": "String",
"var_name": "ADD_NEW"
},
{
"declarator": "UNKNOWN = new UaaAuthenticationDetails()",
... | {
"body": "public Map<String, String[]> getParameterMap() {\n return new HashMap<>(parameterMap);\n }",
"class_method_signature": "UaaAuthenticationDetails.getParameterMap()",
"constructor": false,
"full_signature": "public Map<String, String[]> getParameterMap()",
"identifier": "getParameterMap",
... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_489 | {
"fields": [
{
"declarator": "db",
"modifier": "private",
"original_string": "private JdbcUserGoogleMfaCredentialsProvisioning db;",
"type": "JdbcUserGoogleMfaCredentialsProvisioning",
"var_name": "db"
},
{
"declarator": "activeKeyLabel",
"modifier": "private",
... | {
"body": "@Test\n void updateUserGoogleMfaCredentials_noUser() {\n assertEquals(0, jdbcTemplate.queryForList(\"SELECT * FROM user_google_mfa_credentials\").size());\n UserGoogleMfaCredentials userGoogleMfaCredentials = new UserGoogleMfaCredentials(\"jabbahut\",\n \"very_sercret_key\",... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(JdbcUserGoogleMfaCredentialsProvisioning.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(JdbcUserGoogleMfaCredentialsProvisioning.class);",
"type": "Logger",
... | {
"body": "@Override\n public void update(UserGoogleMfaCredentials credentials, String zoneId) {\n jdbcTemplate.update(UPDATE_USER_MFA_CONFIG_SQL, ps -> {\n int pos = 1;\n try {\n ps.setString(pos++, encrypt(credentials.getSecretKey()));\n ps.setString(pos... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_431 | {
"fields": [
{
"declarator": "mockSamlKeyManagerFactory",
"modifier": "private",
"original_string": "private SamlKeyManagerFactory mockSamlKeyManagerFactory;",
"type": "SamlKeyManagerFactory",
"var_name": "mockSamlKeyManagerFactory"
}
],
"file": "server/src/test/java/org/clo... | {
"body": "@Test\n void set() {\n IdentityZone mockIdentityZone = mock(IdentityZone.class);\n getKeyManagerThreadLocal().set(mock(KeyManager.class));\n\n IdentityZoneHolder.set(mockIdentityZone);\n\n assertThat(IdentityZoneHolder.get(), is(mockIdentityZone));\n assertThat(getKeyM... | {
"fields": [
{
"declarator": "provisioning",
"modifier": "private static",
"original_string": "private static IdentityZoneProvisioning provisioning;",
"type": "IdentityZoneProvisioning",
"var_name": "provisioning"
},
{
"declarator": "samlKeyManagerFactory = new SamlKey... | {
"body": "public static void set(IdentityZone zone) {\n IDENTITY_ZONE_THREAD_LOCAL.set(zone);\n KEY_MANAGER_THREAD_LOCAL.set(null);\n }",
"class_method_signature": "IdentityZoneHolder.set(IdentityZone zone)",
"constructor": false,
"full_signature": "public static void set(IdentityZone zone)",
... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_124 | {
"fields": [
{
"declarator": "instance",
"modifier": "private",
"original_string": "private PasswordGrantAuthenticationManager instance;",
"type": "PasswordGrantAuthenticationManager",
"var_name": "instance"
},
{
"declarator": "zoneAwareAuthzAuthenticationManager",
... | {
"body": "@Test\n void testOIDCPasswordGrantProviderNoRelyingPartyCredentials() {\n IdentityProvider localIdp = mock(IdentityProvider.class);\n OIDCIdentityProviderDefinition idpConfig = mock(OIDCIdentityProviderDefinition.class);\n when(localIdp.getOriginKey()).thenReturn(\"oidcprovider\");\... | {
"fields": [
{
"declarator": "zoneAwareAuthzAuthenticationManager",
"modifier": "private",
"original_string": "private DynamicZoneAwareAuthenticationManager zoneAwareAuthzAuthenticationManager;",
"type": "DynamicZoneAwareAuthenticationManager",
"var_name": "zoneAwareAuthzAuthenticat... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n UaaLoginHint uaaLoginHint = zoneAwareAuthzAuthenticationManager.extractLoginHint(authentication);\n List<String> allowedProviders = getAllowedProviders();\n String defaul... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_348 | {
"fields": [
{
"declarator": "oAuth2RequestFactory",
"modifier": "private",
"original_string": "private OAuth2RequestFactory oAuth2RequestFactory;",
"type": "OAuth2RequestFactory",
"var_name": "oAuth2RequestFactory"
},
{
"declarator": "uaaAuthorizationEndpoint",
... | {
"body": "@Test\n public void testGetGrantType_code_id_token_and_token_is_implicit() {\n responseTypes.add(\"code\");\n responseTypes.add(\"id_token\");\n responseTypes.add(\"token\");\n assertEquals(GRANT_TYPE_IMPLICIT, uaaAuthorizationEndpoint.deriveGrantTypeFromResponseType(response... | {
"fields": [
{
"declarator": "AUTHORIZATION_REQUEST = \"authorizationRequest\"",
"modifier": "public static final",
"original_string": "public static final String AUTHORIZATION_REQUEST = \"authorizationRequest\";",
"type": "String",
"var_name": "AUTHORIZATION_REQUEST"
},
{
... | {
"body": "protected String deriveGrantTypeFromResponseType(Set<String> responseTypes) {\n if (responseTypes.contains(\"token\")) {\n return GRANT_TYPE_IMPLICIT;\n } else if (responseTypes.size() == 1 && responseTypes.contains(\"id_token\")) {\n return GRANT_TYPE_IMPLICIT;\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_427 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/zone/BannerValidatorTest.java",
"identifier": "BannerValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidateColor() throws InvalidIdentityZoneConfigurationException {\n String[] validColors = {\n \"#123456\",\n \"#000\",\n \"#DEDBEF\",\n \"#b0dc8a\"\n };\n\n String[] invalidColors = {\n \"#00\",\n ... | {
"fields": [
{
"declarator": "hexColorPattern = Pattern.compile(\"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$\")",
"modifier": "private static",
"original_string": "private static Pattern hexColorPattern = Pattern.compile(\"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$\");",
"type": "Pattern",
"var_nam... | {
"body": "public static void validate(Banner banner) throws InvalidIdentityZoneConfigurationException {\n if (banner != null){\n if (StringUtils.hasText(banner.getLink())) {\n if (!UaaUrlUtils.isUrl(banner.getLink())) {\n throw new InvalidIdentityZoneConfigurationE... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_132 | {
"fields": [
{
"declarator": "instance",
"modifier": "private",
"original_string": "private PasswordGrantAuthenticationManager instance;",
"type": "PasswordGrantAuthenticationManager",
"var_name": "instance"
},
{
"declarator": "zoneAwareAuthzAuthenticationManager",
... | {
"body": "@Test\n void testUaaPasswordGrant_defaultProviderUaa() {\n Authentication auth = mock(Authentication.class);\n when(zoneAwareAuthzAuthenticationManager.extractLoginHint(auth)).thenReturn(null);\n\n instance.authenticate(auth);\n\n verify(zoneAwareAuthzAuthenticationManager, t... | {
"fields": [
{
"declarator": "zoneAwareAuthzAuthenticationManager",
"modifier": "private",
"original_string": "private DynamicZoneAwareAuthenticationManager zoneAwareAuthzAuthenticationManager;",
"type": "DynamicZoneAwareAuthenticationManager",
"var_name": "zoneAwareAuthzAuthenticat... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n UaaLoginHint uaaLoginHint = zoneAwareAuthzAuthenticationManager.extractLoginHint(authentication);\n List<String> allowedProviders = getAllowedProviders();\n String defaul... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_470 | {
"fields": [
{
"declarator": "provisioner",
"modifier": "private",
"original_string": "private UserGoogleMfaCredentialsProvisioning provisioner;",
"type": "UserGoogleMfaCredentialsProvisioning",
"var_name": "provisioner"
},
{
"declarator": "jdbcProvisioner",
"mod... | {
"body": "@Test\n void testActiveUserCredentialExists() {\n UserGoogleMfaCredentials creds = creds();\n when(jdbcProvisioner.retrieve(anyString(), eq(mfaProvider.getId()))).thenReturn(creds);\n when(jdbcProvisioner.retrieve(anyString(), eq(otherMfaProvider.getId()))).thenThrow(UserMfaConfigDo... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(UserGoogleMfaCredentialsProvisioning.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(UserGoogleMfaCredentialsProvisioning.class);",
"type": "Logger",
"var... | {
"body": "public boolean activeUserCredentialExists(String userId, String providerId) {\n return getUserGoogleMfaCredentials(userId, providerId)!=null;\n }",
"class_method_signature": "UserGoogleMfaCredentialsProvisioning.activeUserCredentialExists(String userId, String providerId)",
"constructor": fal... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_165 | {
"fields": [
{
"declarator": "mockHttpServletRequest",
"modifier": "private",
"original_string": "private MockHttpServletRequest mockHttpServletRequest;",
"type": "MockHttpServletRequest",
"var_name": "mockHttpServletRequest"
},
{
"declarator": "mockRequestCache",
... | {
"body": "@Test\n void isIgnored() {\n for (String s : Arrays.asList(\"/login/mfa\", \"/login/mfa/register\", \"/login/mfa/verify.do\")) {\n mockHttpServletRequest.setPathInfo(s);\n assertThat(\"Is ignored:\" + s, passwordChangeUiRequiredFilter.isIgnored(mockHttpServletRequest), is(tr... | {
"fields": [
{
"declarator": "MATCH_PATH = \"/force_password_change\"",
"modifier": "private final static",
"original_string": "private final static String MATCH_PATH = \"/force_password_change\";",
"type": "String",
"var_name": "MATCH_PATH"
},
{
"declarator": "IGNORE_... | {
"body": "protected boolean isIgnored(HttpServletRequest request) {\n return ignorePath.matches(request);\n }",
"class_method_signature": "PasswordChangeUiRequiredFilter.isIgnored(HttpServletRequest request)",
"constructor": false,
"full_signature": "protected boolean isIgnored(HttpServletRequest req... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_309 | {
"fields": [
{
"declarator": "factory",
"modifier": "private",
"original_string": "private CurrentUserCookieFactory factory;",
"type": "CurrentUserCookieFactory",
"var_name": "factory"
},
{
"declarator": "sessionTimeout",
"modifier": "private",
"original_st... | {
"body": "@Test\n void getCookie_containsUrlEncodedJsonBody() throws Exception {\n Cookie cookie = factory.getCookie(uaaPrincipal);\n assertEquals(\"%7B%22userId%22%3A%22user-guid%22%7D\", cookie.getValue());\n String decoded = URLDecoder.decode(cookie.getValue(), StandardCharsets.UTF_8);\n ... | {
"fields": [
{
"declarator": "CURRENT_USER_COOKIE_NAME = \"Current-User\"",
"modifier": "public",
"original_string": "public String CURRENT_USER_COOKIE_NAME = \"Current-User\";",
"type": "String",
"var_name": "CURRENT_USER_COOKIE_NAME"
},
{
"declarator": "secure",
... | {
"body": "public Cookie getCookie(UaaPrincipal uaaPrincipal) throws CurrentUserCookieEncodingException {\n CurrentUserInformation currentUserInformation = new CurrentUserInformation();\n currentUserInformation.setUserId(uaaPrincipal.getId());\n Cookie cookie = new Cookie(CURRENT_USER_COOKIE_NAME... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_372 | {
"fields": [
{
"declarator": "TEST_USER_ID = \"test-user-id\"",
"modifier": "private static final",
"original_string": "private static final String TEST_USER_ID = \"test-user-id\";",
"type": "String",
"var_name": "TEST_USER_ID"
},
{
"declarator": "TEST_CLIENT_ID = \"te... | {
"body": "@Test\n void update() {\n jdbcRevocableTokenProvisioning.create(revocableToken, IdentityZoneHolder.get().getId());\n RevocableToken toUpdate = jdbcRevocableTokenProvisioning.retrieve(revocableToken.getTokenId(), IdentityZoneHolder.get().getId());\n toUpdate.setFormat(\"format\")\n ... | {
"fields": [
{
"declarator": "REFRESH_TOKEN_RESPONSE_TYPE = REFRESH_TOKEN.toString()",
"modifier": "private final static",
"original_string": "private final static String REFRESH_TOKEN_RESPONSE_TYPE = REFRESH_TOKEN.toString();",
"type": "String",
"var_name": "REFRESH_TOKEN_RESPONSE_... | {
"body": "@Override\n public RevocableToken update(String id, RevocableToken t, String zoneId) {\n template.update(UPDATE_QUERY,\n t.getClientId(),\n t.getUserId(),\n t.getFormat(),\n t.getResponseType().toString(),\n t.getIssuedAt(... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_60 | {
"fields": [
{
"declarator": "top",
"modifier": "private",
"original_string": "private Map<String, Object> top;",
"type": "Map<String, Object>",
"var_name": "top"
},
{
"declarator": "secondA",
"modifier": "private",
"original_string": "private Map<String, O... | {
"body": "@Test\n public void sort_nested_map() {\n List<String> expectedOrder = Arrays.asList(\n \"secondA\",\n \"thirdA\",\n \"keyA\",\n \"thirdB\",\n \"keyB\",\n \"secondB\",\n \"thirdB\",\n \"keyB\",\n \"... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/util/UaaMapUtils.java",
"identifier": "UaaMapUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "UaaMapUtils.flatten(Map<String, Object> map)",
"constructor": false,
"full_signature": "public stat... | {
"body": "public static <K extends Comparable<? super K>, V> Map<K, V> sortByKeys(Map<K,V> map) {\n List<Entry<K, V>> sortedEntries = map\n .entrySet()\n .stream()\n .sorted(comparingByKey())\n .collect(Collectors.toList());\n LinkedHashMap<K, V> result = new... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_237 | {
"fields": [
{
"declarator": "notUaaZoneId",
"modifier": "private",
"original_string": "private String notUaaZoneId;",
"type": "String",
"var_name": "notUaaZoneId"
},
{
"declarator": "zoneAwareIdpMetadataGenerator",
"modifier": "private",
"original_string":... | {
"body": "@Test\n void entityIDHonored() {\n IdentityZoneHolder.set(notUaaZone);\n //test default entityID generation within zones\n assertEquals(notUaaZoneId + \".\" + IdentityZoneHolder.getUaaZone().getConfig().getSamlConfig().getEntityID(), zoneAwareIdpMetadataGenerator.getEntityId());\n\n... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/idp/ZoneAwareIdpMetadataGenerator.java",
"identifier": "ZoneAwareIdpMetadataGenerator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ZoneAwareIdpMetadataGenerator.isAssertionsSigned()",
"co... | {
"body": "@Override\n public String getEntityId() {\n String entityId = super.getEntityId();\n if(StringUtils.hasText(IdentityZoneHolder.get().getConfig().getSamlConfig().getEntityID())) {\n return IdentityZoneHolder.get().getConfig().getSamlConfig().getEntityID();\n } else if (Uaa... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_149 | {
"fields": [
{
"declarator": "applicationEventPublisher",
"modifier": "private",
"original_string": "private ApplicationEventPublisher applicationEventPublisher;",
"type": "ApplicationEventPublisher",
"var_name": "applicationEventPublisher"
},
{
"declarator": "uaaUserD... | {
"body": "@Test\n public void testAuthenticateNullPrincipal() {\n Authentication auth = mock(Authentication.class);\n when(auth.getPrincipal()).thenReturn(null);\n Authentication result = manager.authenticate(auth);\n assertNull(result);\n }",
"class_method_signature": "ExternalLo... | {
"fields": [
{
"declarator": "USER_ATTRIBUTE_PREFIX = \"user.attribute.\"",
"modifier": "public static final",
"original_string": "public static final String USER_ATTRIBUTE_PREFIX = \"user.attribute.\";",
"type": "String",
"var_name": "USER_ATTRIBUTE_PREFIX"
},
{
"decl... | {
"body": "@Override\n public Authentication authenticate(Authentication request) throws AuthenticationException {\n logger.debug(\"Starting external authentication for:\"+request);\n ExternalAuthenticationDetails authenticationData = getExternalAuthenticationDetails(request);\n UaaUser userFr... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_325 | {
"fields": [
{
"declarator": "userId",
"modifier": "private",
"original_string": "private String userId;",
"type": "String",
"var_name": "userId"
},
{
"declarator": "endpoint",
"modifier": "private",
"original_string": "private TotpMfaEndpoint endpoint;",
... | {
"body": "@Test\n public void testManualRegistration() throws Exception {\n when(uaaAuthentication.getPrincipal()).thenReturn(new UaaPrincipal(userId, \"Marissa\", null, null, null, null), null, null);\n when(userGoogleMfaCredentialsProvisioning.activeUserCredentialExists(userId, mfaProvider.getId()... | {
"fields": [
{
"declarator": "mfaCredentialsProvisioning",
"modifier": "private final",
"original_string": "private final UserGoogleMfaCredentialsProvisioning mfaCredentialsProvisioning;",
"type": "UserGoogleMfaCredentialsProvisioning",
"var_name": "mfaCredentialsProvisioning"
}... | {
"body": "@RequestMapping(value = {\"/manual\"}, method = RequestMethod.GET)\n public String manualRegistration(\n Model model,\n @ModelAttribute(\"uaaMfaCredentials\") UserGoogleMfaCredentials credentials\n ) throws UaaPrincipalIsNotInSession {\n UaaPrincipal uaaPrincipal = getSessionAuthPrin... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_260 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/provider/saml/LoginSAMLAuthenticationFailureHandlerTest.java",
"identifier": "LoginSAMLAuthenticationFailureHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoSession() throws IOException, ServletException {\n LoginSAMLAuthenticationFailureHandler handler = new LoginSAMLAuthenticationFailureHandler();\n\n MockHttpServletRequest request = new MockHttpServletRequest();\n MockHttpServletResponse response = new MockH... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(LoginSAMLAuthenticationFailureHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(LoginSAMLAuthenticationFailureHandler.class);",
"type": "Logger",
... | {
"body": "@Override\n public void onAuthenticationFailure(final HttpServletRequest request, final HttpServletResponse response,\n final AuthenticationException exception) throws IOException, ServletException {\n\n String redirectTo = null;\n\n if (exception instanceof LoginSAMLException) ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_37 | {
"fields": [
{
"declarator": "TIMEOUT = 50",
"modifier": "public static final",
"original_string": "public static final int TIMEOUT = 50;",
"type": "int",
"var_name": "TIMEOUT"
},
{
"declarator": "timeService = new MockTimeService()",
"modifier": "private",
... | {
"body": "@Test\n public void clear() {\n map.put(key1, value1);\n assertNotNull(map.get(key1));\n assertEquals(1, map.size());\n map.clear();\n assertNull(map.get(key1));\n assertEquals(0, map.size());\n }",
"class_method_signature": "TimeBasedExpiringValueMapTest.c... | {
"fields": [
{
"declarator": "DEFALT_TIMEOUT = 2 * 1000 * 60",
"modifier": "public static final",
"original_string": "public static final long DEFALT_TIMEOUT = 2 * 1000 * 60;",
"type": "long",
"var_name": "DEFALT_TIMEOUT"
},
{
"declarator": "timeService",
"modifi... | {
"body": "public void clear() {\n map.clear();\n }",
"class_method_signature": "TimeBasedExpiringValueMap.clear()",
"constructor": false,
"full_signature": "public void clear()",
"identifier": "clear",
"invocations": [
"clear"
],
"modifiers": "public",
"parameters": "()",
"return": "v... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_299 | {
"fields": [
{
"declarator": "handler = new CsrfAwareEntryPointAndDeniedHandler(\"/csrf\", \"/login\")",
"modifier": "protected",
"original_string": "protected CsrfAwareEntryPointAndDeniedHandler handler = new CsrfAwareEntryPointAndDeniedHandler(\"/csrf\", \"/login\");",
"type": "CsrfAwar... | {
"body": "@Test\n public void testHandleWhenCsrfMissingForJson() throws Exception {\n request.addHeader(\"Accept\", MediaType.APPLICATION_JSON_VALUE);\n AccessDeniedException ex = new MissingCsrfTokenException(\"something\");\n handler.handle(request, response, ex);\n assertEquals(Http... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(CsrfAwareEntryPointAndDeniedHandler.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(CsrfAwareEntryPointAndDeniedHandler.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public void handle(HttpServletRequest request,\n HttpServletResponse response,\n AccessDeniedException accessDeniedException) throws IOException,\n ServletException {\n request.setAttribute(WebAttributes.ACCESS_DENIED_403, accessDenie... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_333 | {
"fields": [
{
"declarator": "expectedException = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "expectedException"
},
... | {
"body": "@Test\n public void validation_happyPath() {\n String accessToken = UaaTokenUtils.constructToken(header, content, signer);\n\n tokenValidationService.validateToken(accessToken, true);\n }",
"class_method_signature": "TokenValidationServiceTest.validation_happyPath()",
"constructor":... | {
"fields": [
{
"declarator": "revocableTokenProvisioning",
"modifier": "private",
"original_string": "private RevocableTokenProvisioning revocableTokenProvisioning;",
"type": "RevocableTokenProvisioning",
"var_name": "revocableTokenProvisioning"
},
{
"declarator": "tok... | {
"body": "public TokenValidation validateToken(String token, boolean isAccessToken) {\n if (!UaaTokenUtils.isJwtToken(token)) {\n RevocableToken revocableToken;\n try {\n revocableToken = revocableTokenProvisioning.retrieve(token, IdentityZoneHolder.get().getId());\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_21 | {
"fields": [
{
"declarator": "server",
"modifier": "private",
"original_string": "private MBeanServerConnection server;",
"type": "MBeanServerConnection",
"var_name": "server"
},
{
"declarator": "statsDClient",
"modifier": "private",
"original_string": "pri... | {
"body": "@Test\n void requestCount_metrics_emitted() throws Exception {\n Mockito.when(metricsUtils.getUaaMetrics(any())).thenReturn(uaaMetrics1, uaaMetrics2);\n uaaMetricsEmitter.emitGlobalRequestMetrics();\n Mockito.verify(statsDClient).count(\"requests.global.completed.count\", 3087L);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(UaaMetricsEmitter.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(UaaMetricsEmitter.class);",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@Scheduled(fixedRate = 5000, initialDelay = 1000)\n public void emitGlobalRequestMetrics() throws Exception {\n try {\n UaaMetrics metrics = metricsUtils.getUaaMetrics(server);\n emitGlobalRequestMetrics(metrics);\n emitGlobalServerStats(metrics);\n } catch... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_276 | {
"fields": [
{
"declarator": "definition",
"modifier": "private",
"original_string": "private AbstractExternalOAuthIdentityProviderDefinition definition;",
"type": "AbstractExternalOAuthIdentityProviderDefinition",
"var_name": "definition"
},
{
"declarator": "validator... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void configCannotBeNull() {\n validator.validate((AbstractExternalOAuthIdentityProviderDefinition)null);\n }",
"class_method_signature": "ExternalOAuthIdentityProviderConfigValidatorTest.configCannotBeNull()",
"constructor": false,
... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/provider/oauth/ExternalOAuthIdentityProviderConfigValidator.java",
"identifier": "ExternalOAuthIdentityProviderConfigValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExternalOAuthIdentityProviderConfig... | {
"body": "@Override\n public void validate(AbstractIdentityProviderDefinition definition) {\n if (definition == null) {\n throw new IllegalArgumentException(\"Config cannot be null OAUTH2.0/OIDC1.0 provider\");\n }\n if (!(definition instanceof AbstractExternalOAuthIdentityProvider... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_108 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/util/UaaTokenUtilsTest.java",
"identifier": "UaaTokenUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = InvalidTokenException.class)\n public void getClaims_throwsExceptionWhenJwtIsMalformed() {\n UaaTokenUtils.getClaims(\"not.a.jwt\");\n }",
"class_method_signature": "UaaTokenUtilsTest.getClaims_throwsExceptionWhenJwtIsMalformed()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\")",
"modifier": "public static final",
"original_string": "public static final Pattern jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\... | {
"body": "public static Map<String, Object> getClaims(String jwtToken) {\n Jwt jwt;\n try {\n jwt = JwtHelper.decode(jwtToken);\n } catch (Exception ex) {\n throw new InvalidTokenException(\"Invalid token (could not decode): \" + jwtToken, ex);\n }\n\n Map<Str... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_364 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator": "gr... | {
"body": "@Test\n public void test_no_user_authentication() {\n SecurityContextHolder.getContext().setAuthentication(authentication);\n exception.expect(InvalidGrantException.class);\n exception.expectMessage(\"User authentication not found\");\n when(mockSecurityAccessor.isUser()).thenReturn(false);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(Saml2TokenGranter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(Saml2TokenGranter.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "protected Authentication validateRequest(TokenRequest request) {\n // things to validate\n if(request == null || request.getRequestParameters() == null) {\n throw new InvalidGrantException(\"Missing token request object\");\n }\n if(request.getRequestParameters().get(... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_99 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/util/UaaTokenUtilsTest.java",
"identifier": "UaaTokenUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRevocationHash() {\n List<String> salts = new LinkedList<>();\n for (int i=0; i<3; i++) {\n salts.add(new RandomValueStringGenerator().generate());\n }\n String hash1 = UaaTokenUtils.getRevocationHash(salts);\n String hash2 = UaaToken... | {
"fields": [
{
"declarator": "jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\")",
"modifier": "public static final",
"original_string": "public static final Pattern jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\... | {
"body": "public static String getRevocationHash(List<String> salts) {\n String result = \"\";\n for (String s : salts) {\n byte[] hashable = (result+ \"###\" + s).getBytes();\n result = Integer.toHexString(murmurhash3x8632(hashable, 0, hashable.length, 0xF0F0));\n }\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_221 | {
"fields": [
{
"declarator": "uaaIdentityProviderDef",
"modifier": "",
"original_string": "UaaIdentityProviderDefinition uaaIdentityProviderDef;",
"type": "UaaIdentityProviderDefinition",
"var_name": "uaaIdentityProviderDef"
},
{
"declarator": "configValidator",
... | {
"body": "@Test\n public void nullConfigIsAllowed() {\n configValidator.validate((AbstractIdentityProviderDefinition) null);\n }",
"class_method_signature": "UaaIdentityProviderConfigValidatorTest.nullConfigIsAllowed()",
"constructor": false,
"full_signature": "@Test public void nullConfigIsAllowe... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/provider/uaa/UaaIdentityProviderConfigValidator.java",
"identifier": "UaaIdentityProviderConfigValidator",
"interfaces": "",
"methods": [
{
"class_method_signature": "UaaIdentityProviderConfigValidator.validate(AbstractIdent... | {
"body": "@Override\n public void validate(AbstractIdentityProviderDefinition definition) {\n if (definition == null) {\n return;\n }\n UaaIdentityProviderDefinition def = (UaaIdentityProviderDefinition) definition;\n\n PasswordPolicy passwordPolicy = def.getPasswordPolicy()... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_76 | {
"fields": [
{
"declarator": "invalidWildCardUrls = Arrays.asList(\n \"*\",\n \"**\",\n \"*/**\",\n \"**/*\",\n \"*/*\",\n \"**/**\")",
"modifier": "private",
"original_string": "private List<String> invalidWildCardUrls = Arrays.... | {
"body": "@Test\n void getHostWithZone() {\n IdentityZone zone = MultitenancyFixture.identityZone(\"zone1\", \"zone1\");\n\n MockHttpServletRequest request = new MockHttpServletRequest();\n request.setScheme(\"http\");\n request.setServerName(\"zone1.localhost\");\n\n ServletReq... | {
"fields": [
{
"declarator": "VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\")",
"modifier": "private static final",
"original_string": "private static final Pattern VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-... | {
"body": "public static String getUaaHost(IdentityZone currentIdentityZone) {\n return getURIBuilder(\"\", false, currentIdentityZone).build().getHost();\n }",
"class_method_signature": "UaaUrlUtils.getUaaHost(IdentityZone currentIdentityZone)",
"constructor": false,
"full_signature": "public static ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_256 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRedirectUtilsTest.java",
"identifier": "SamlRedirectUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetIdpRedirectUrl() {\n SamlIdentityProviderDefinition definition =\n new SamlIdentityProviderDefinition()\n .setMetaDataLocation(\"http://some.meta.data\")\n .setIdpEntityAlias(\"simplesamlphp-url\")\n .setNameID(\"n... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/SamlRedirectUtils.java",
"identifier": "SamlRedirectUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SamlRedirectUtils.getIdpRedirectUrl(SamlIdentityProviderDefinition definition, String enti... | {
"body": "public static String getIdpRedirectUrl(SamlIdentityProviderDefinition definition, String entityId, IdentityZone identityZone) {\n UriComponentsBuilder builder = UriComponentsBuilder.fromPath(\"saml/discovery\");\n builder.queryParam(\"returnIDParam\", \"idp\");\n builder.queryParam(\"e... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_313 | {
"fields": [
{
"declarator": "userId",
"modifier": "private",
"original_string": "private String userId;",
"type": "String",
"var_name": "userId"
},
{
"declarator": "endpoint",
"modifier": "private",
"original_string": "private TotpMfaEndpoint endpoint;",
... | {
"body": "@Test\n public void testGenerateQrUrl() throws Exception{\n when(uaaAuthentication.getPrincipal()).thenReturn(new UaaPrincipal(userId, \"Marissa\", null, null, null, null), null, null);\n when(userGoogleMfaCredentialsProvisioning.activeUserCredentialExists(userId, mfaProvider.getId())).the... | {
"fields": [
{
"declarator": "mfaCredentialsProvisioning",
"modifier": "private final",
"original_string": "private final UserGoogleMfaCredentialsProvisioning mfaCredentialsProvisioning;",
"type": "UserGoogleMfaCredentialsProvisioning",
"var_name": "mfaCredentialsProvisioning"
}... | {
"body": "@RequestMapping(value = {\"/register\"}, method = RequestMethod.GET)\n public String generateQrUrl(Model model,\n @ModelAttribute(\"uaaMfaCredentials\") UserGoogleMfaCredentials credentials)\n throws WriterException, IOException, UaaPrincipalIsNotInSession {\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_190 | {
"fields": [
{
"declarator": "emailChangeEmailService",
"modifier": "private",
"original_string": "private EmailChangeEmailService emailChangeEmailService;",
"type": "EmailChangeEmailService",
"var_name": "emailChangeEmailService"
},
{
"declarator": "mockScimUserProvis... | {
"body": "@Test\n void completeVerificationWithInvalidCode() {\n when(mockExpiringCodeStore.retrieveCode(\"invalid_code\", zoneId)).thenReturn(null);\n\n Assertions.assertThrows(UaaException.class,\n () -> emailChangeEmailService.completeVerification(\"invalid_code\"));\n }",
"cl... | {
"fields": [
{
"declarator": "CHANGE_EMAIL_REDIRECT_URL = \"change_email_redirect_url\"",
"modifier": "static final",
"original_string": "static final String CHANGE_EMAIL_REDIRECT_URL = \"change_email_redirect_url\";",
"type": "String",
"var_name": "CHANGE_EMAIL_REDIRECT_URL"
},... | {
"body": "@Override\n public Map<String, String> completeVerification(String code) {\n ExpiringCode expiringCode = codeStore.retrieveCode(code, identityZoneManager.getCurrentIdentityZoneId());\n if ((null == expiringCode) || ((null != expiringCode.getIntent()) && !EMAIL.name().equals(expiringCode.ge... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_485 | {
"fields": [
{
"declarator": "mfaProviderProvisioning",
"modifier": "private",
"original_string": "private JdbcMfaProviderProvisioning mfaProviderProvisioning;",
"type": "JdbcMfaProviderProvisioning",
"var_name": "mfaProviderProvisioning"
},
{
"declarator": "mfaProvide... | {
"body": "@Test\n void retrieveByName() {\n MfaProvider createdProvider = mfaProviderProvisioning.create(constructGoogleProvider(), IdentityZoneHolder.get().getId());\n assertEquals(\n createdProvider.getId(),\n mfaProviderProvisioning.retrieveByName(createdProvider.get... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(JdbcMfaProviderProvisioning.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(JdbcMfaProviderProvisioning.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@Override\n public MfaProvider retrieveByName(String name, String zoneId) {\n return jdbcTemplate.queryForObject(MFA_PROVIDER_BY_NAME_QUERY, mapper, name, zoneId);\n }",
"class_method_signature": "JdbcMfaProviderProvisioning.retrieveByName(String name, String zoneId)",
"constructor": false... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_201 | {
"fields": [
{
"declarator": "mockMvc",
"modifier": "private",
"original_string": "private MockMvc mockMvc;",
"type": "MockMvc",
"var_name": "mockMvc"
},
{
"declarator": "webApplicationContext",
"modifier": "@Autowired",
"original_string": "@Autowired\n ... | {
"body": "@Test\n public void incorrectGeneratedCodeIntent_for_verifiedUser() throws Exception {\n UaaUser user = new UaaUser(\"user@example.com\", \"\", \"user@example.com\", \"Given\", \"family\");\n user.modifyId(\"verified-user\");\n user.setVerified(true);\n when(userDatabase.retr... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(InvitationsController.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(InvitationsController.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@RequestMapping(value = \"/accept.do\", method = POST)\n public String acceptInvitation(@RequestParam(\"password\") String password,\n @RequestParam(\"password_confirmation\") String passwordConfirmation,\n @RequestParam(\"code\") Strin... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_56 | {
"fields": [
{
"declarator": "alias = \"saml\"",
"modifier": "public static final",
"original_string": "public static final String alias = \"saml\";",
"type": "String",
"var_name": "alias"
},
{
"declarator": "idpMetaData = \"<?xml version=\\\"1.0\\\"?>\\n\" +\n ... | {
"body": "@Test\n public void test_idp_with_no_matching_email_domain() {\n samlDef1.setEmailDomain(Collections.singletonList(\"example.org\"));\n List<IdentityProvider> idpsForEmailDomain = filter.getIdpsForEmailDomain(activeProviders, \"abc@test.org\");\n\n assertEquals(0, idpsForEmailDomain... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DomainFilter.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(DomainFilter.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": "server/sr... | {
"body": "public static List<IdentityProvider> getIdpsForEmailDomain(List<IdentityProvider> activeProviders, String email) {\n if (!StringUtils.hasText(email) || !email.contains(\"@\")) {\n return EMPTY_LIST;\n }\n final String domain = email.substring(email.indexOf('@') + 1);\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_344 | {
"fields": [
{
"declarator": "oAuth2RequestFactory",
"modifier": "private",
"original_string": "private OAuth2RequestFactory oAuth2RequestFactory;",
"type": "OAuth2RequestFactory",
"var_name": "oAuth2RequestFactory"
},
{
"declarator": "uaaAuthorizationEndpoint",
... | {
"body": "@Test\n public void testGetGrantType_code_is_auth_code() {\n responseTypes.add(\"code\");\n assertEquals(GRANT_TYPE_AUTHORIZATION_CODE, uaaAuthorizationEndpoint.deriveGrantTypeFromResponseType(responseTypes));\n }",
"class_method_signature": "UaaAuthorizationEndpointTest.testGetGrantT... | {
"fields": [
{
"declarator": "AUTHORIZATION_REQUEST = \"authorizationRequest\"",
"modifier": "public static final",
"original_string": "public static final String AUTHORIZATION_REQUEST = \"authorizationRequest\";",
"type": "String",
"var_name": "AUTHORIZATION_REQUEST"
},
{
... | {
"body": "protected String deriveGrantTypeFromResponseType(Set<String> responseTypes) {\n if (responseTypes.contains(\"token\")) {\n return GRANT_TYPE_IMPLICIT;\n } else if (responseTypes.size() == 1 && responseTypes.contains(\"id_token\")) {\n return GRANT_TYPE_IMPLICIT;\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_128 | {
"fields": [
{
"declarator": "instance",
"modifier": "private",
"original_string": "private PasswordGrantAuthenticationManager instance;",
"type": "PasswordGrantAuthenticationManager",
"var_name": "instance"
},
{
"declarator": "zoneAwareAuthzAuthenticationManager",
... | {
"body": "@Test\n void testOIDCPasswordGrantWithPrompts() {\n UaaLoginHint loginHint = mock(UaaLoginHint.class);\n when(loginHint.getOrigin()).thenReturn(\"oidcprovider\");\n Authentication auth = mock(Authentication.class);\n when(auth.getPrincipal()).thenReturn(\"marissa\");\n ... | {
"fields": [
{
"declarator": "zoneAwareAuthzAuthenticationManager",
"modifier": "private",
"original_string": "private DynamicZoneAwareAuthenticationManager zoneAwareAuthzAuthenticationManager;",
"type": "DynamicZoneAwareAuthenticationManager",
"var_name": "zoneAwareAuthzAuthenticat... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n UaaLoginHint uaaLoginHint = zoneAwareAuthzAuthenticationManager.extractLoginHint(authentication);\n List<String> allowedProviders = getAllowedProviders();\n String defaul... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_40 | {
"fields": [
{
"declarator": "alias = \"saml\"",
"modifier": "public static final",
"original_string": "public static final String alias = \"saml\";",
"type": "String",
"var_name": "alias"
},
{
"declarator": "idpMetaData = \"<?xml version=\\\"1.0\\\"?>\\n\" +\n ... | {
"body": "@Test\n public void test_null_arguments() {\n assertThat(filter.filter(null,null,null), Matchers.containsInAnyOrder());\n assertThat(filter.filter(null,null,email), Matchers.containsInAnyOrder());\n assertThat(filter.filter(null,client,null), Matchers.containsInAnyOrder());\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DomainFilter.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(DomainFilter.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": "server/sr... | {
"body": "public static List<IdentityProvider> filter(List<IdentityProvider> activeProviders, ClientDetails client, String email) {\n return filter(activeProviders, client, email, true);\n }",
"class_method_signature": "DomainFilter.filter(List<IdentityProvider> activeProviders, ClientDetails client, Str... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_217 | {
"fields": [
{
"declarator": "attrs",
"modifier": "private",
"original_string": "private Attributes attrs;",
"type": "Attributes",
"var_name": "attrs"
},
{
"declarator": "adapter",
"modifier": "private",
"original_string": "private DirContextAdapter adapter... | {
"body": "@Test\n public void testPhoneNumberAttributeNameMapping() throws Exception {\n attrs.put(\"phoneNumber\", \"8675309\");\n adapter = new DirContextAdapter(attrs, new LdapName(\"cn=marissa,ou=Users,dc=test,dc=com\"));\n mapper.setPhoneNumberAttributeName(\"phoneNumber\");\n\n E... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ExtendedLdapUserMapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ExtendedLdapUserMapper.class);",
"type": "Logger",
"var_name": "logger"... | {
"body": "public void setPhoneNumberAttributeName(String phoneNumberAttributeName) {\n this.phoneNumberAttributeName = phoneNumberAttributeName;\n }",
"class_method_signature": "ExtendedLdapUserMapper.setPhoneNumberAttributeName(String phoneNumberAttributeName)",
"constructor": false,
"full_signature... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_352 | {
"fields": [
{
"declarator": "filter",
"modifier": "",
"original_string": "DisableIdTokenResponseTypeFilter filter;",
"type": "DisableIdTokenResponseTypeFilter",
"var_name": "filter"
},
{
"declarator": "disabledFilter",
"modifier": "",
"original_string": "D... | {
"body": "@Test\n public void testApplyPath() {\n shouldApplyPath(\"/oauth/token\", false);\n shouldApplyPath(\"/someotherpath/uaa/oauth/authorize\", true);\n shouldApplyPath(\"/uaa/oauth/authorize\", true);\n shouldApplyPath(\"/oauth/authorize\", true);\n shouldApplyPath(null, ... | {
"fields": [
{
"declarator": "ID_TOKEN = \"id_token\"",
"modifier": "public static final",
"original_string": "public static final String ID_TOKEN = \"id_token\";",
"type": "String",
"var_name": "ID_TOKEN"
},
{
"declarator": "logger = LoggerFactory.getLogger(DisableIdT... | {
"body": "protected boolean applyPath(String path) {\n if (paths==null || paths.size()==0 || path == null) {\n return false;\n }\n AntPathMatcher matcher = new AntPathMatcher();\n for (String pattern : paths) {\n if (matcher.isPattern(pattern)) {\n if ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_240 | {
"fields": [
{
"declarator": "db",
"modifier": "private",
"original_string": "private JdbcSamlServiceProviderProvisioning db;",
"type": "JdbcSamlServiceProviderProvisioning",
"var_name": "db"
},
{
"declarator": "jdbcTemplate",
"modifier": "@Autowired\n private... | {
"body": "@Test\n void retrieveActive() {\n assertEquals(0, db.retrieveActive(IdentityZone.getUaaZoneId()).size());\n String zoneId = IdentityZone.getUaaZoneId();\n SamlServiceProvider sp = createSamlServiceProvider(zoneId);\n SamlServiceProvider createdSp = db.create(sp, sp.getIdentit... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JdbcIdentityProviderProvisioning.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JdbcIdentityProviderProvisioning.class);",
"type": "Logger",
... | {
"body": "@Override\n public List<SamlServiceProvider> retrieveActive(String zoneId) {\n return jdbcTemplate.query(ACTIVE_SERVICE_PROVIDERS_QUERY, mapper, zoneId, true);\n }",
"class_method_signature": "JdbcSamlServiceProviderProvisioning.retrieveActive(String zoneId)",
"constructor": false,
"full... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_17 | {
"fields": [
{
"declarator": "exceptionOccured = null",
"modifier": "",
"original_string": "Exception exceptionOccured = null;",
"type": "Exception",
"var_name": "exceptionOccured"
}
],
"file": "model/src/test/java/org/cloudfoundry/identity/uaa/impl/JsonDateSerializerTest.ja... | {
"body": "@Test\n public void testFormatting() throws IOException {\n Date now = new Date();\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n JsonGenerator gen = new JsonFactory().createGenerator(bos);\n new JsonDateSerializer().serialize(now, gen, null);\n gen.close... | {
"fields": [],
"file": "model/src/main/java/org/cloudfoundry/identity/uaa/impl/JsonDateSerializer.java",
"identifier": "JsonDateSerializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "JsonDateSerializer.serialize(Date date, JsonGenerator generator, SerializerProvider provider)",
... | {
"body": "@Override\n public void serialize(Date date, JsonGenerator generator, SerializerProvider provider) throws IOException {\n String formatted = new SimpleDateFormat(DATE_FORMATTER).format(date);\n generator.writeString(formatted);\n }",
"class_method_signature": "JsonDateSerializer.seria... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_305 | {
"fields": [
{
"declarator": "mockMvc",
"modifier": "private",
"original_string": "private MockMvc mockMvc;",
"type": "MockMvc",
"var_name": "mockMvc"
},
{
"declarator": "mockResourcePropertySource",
"modifier": "private",
"original_string": "private Resour... | {
"body": "@Test\n void handleForcePasswordChange() throws Exception {\n mockMvc.perform(\n post(\"/uaa/force_password_change\")\n .param(\"password\", \"pwd\")\n .param(\"password_confirmation\", \"pwd\")\n .contextPath(\"/... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ForcePasswordChangeController.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ForcePasswordChangeController.class);",
"type": "Logger",
"var_n... | {
"body": "@RequestMapping(value = \"/force_password_change\", method = POST)\n public String handleForcePasswordChange(Model model,\n @RequestParam(\"password\") String password,\n @RequestParam(\"password_confirmation\") String... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_186 | {
"fields": [
{
"declarator": "emailChangeEmailService",
"modifier": "private",
"original_string": "private EmailChangeEmailService emailChangeEmailService;",
"type": "EmailChangeEmailService",
"var_name": "emailChangeEmailService"
},
{
"declarator": "mockScimUserProvis... | {
"body": "@Test\n void beginEmailChange() {\n ScimUser user = new ScimUser(\"user-001\", \"user-name\", \"test-name\", \"test-name\");\n user.setPrimaryEmail(\"user@example.com\");\n Map<String, String> codeData = new HashMap<>();\n codeData.put(\"user_id\", \"user-001\");\n cod... | {
"fields": [
{
"declarator": "CHANGE_EMAIL_REDIRECT_URL = \"change_email_redirect_url\"",
"modifier": "static final",
"original_string": "static final String CHANGE_EMAIL_REDIRECT_URL = \"change_email_redirect_url\";",
"type": "String",
"var_name": "CHANGE_EMAIL_REDIRECT_URL"
},... | {
"body": "@Override\n public void beginEmailChange(String userId, String email, String newEmail, String clientId, String redirectUri) {\n ScimUser user = scimUserProvisioning.retrieve(userId, identityZoneManager.getCurrentIdentityZoneId());\n List<ScimUser> results = scimUserProvisioning.retrieveByU... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_169 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/authentication/UaaAuthenticationDetailsTest.java",
"identifier": "UaaAuthenticationDetailsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testToStringDoesNotContainSessionId() {\n UaaAuthenticationDetails details = new UaaAuthenticationDetails(false, \"clientid\", \"origin\", \"1234\");\n String toString = details.toString();\n assertTrue(toString.contains(\"sessionId=<SESSION>\"));\n }",
"class_meth... | {
"fields": [
{
"declarator": "ADD_NEW = \"add_new\"",
"modifier": "public static final",
"original_string": "public static final String ADD_NEW = \"add_new\";",
"type": "String",
"var_name": "ADD_NEW"
},
{
"declarator": "UNKNOWN = new UaaAuthenticationDetails()",
... | {
"body": "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n if (origin != null) {\n sb.append(\"remoteAddress=\").append(origin);\n }\n if (clientId != null) {\n if (sb.length() > 0) {\n sb.append(\", \");\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_493 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/mfa/MfaRegisterQRGeneratorTest.java",
"identifier": "MfaRegisterQRGeneratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testQrWithSpecialChars() throws Exception {\n GoogleAuthenticator authenticator = new GoogleAuthenticator();\n GoogleAuthenticatorKey key = authenticator.createCredentials();\n String encodedQrCode = MfaRegisterQRGenerator.getQRCode(\"test=Issuer\",\"account?&#Na... | {
"fields": [
{
"declarator": "OTPAUTH_TOTP_URI = \"otpauth://totp/%s:%s?secret=%s&issuer=%s\"",
"modifier": "private static final",
"original_string": "private static final String OTPAUTH_TOTP_URI = \"otpauth://totp/%s:%s?secret=%s&issuer=%s\";",
"type": "String",
"var_name": "OTPAU... | {
"body": "public static String getQRCode(String issuer,\n String accountName,\n String secretKey) throws WriterException, IOException {\n if(!StringUtils.hasText(issuer) || issuer.contains(\":\")) {\n throw new IllegalArgumentExcep... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_83 | {
"fields": [
{
"declarator": "invalidWildCardUrls = Arrays.asList(\n \"*\",\n \"**\",\n \"*/**\",\n \"**/*\",\n \"*/*\",\n \"**/**\")",
"modifier": "private",
"original_string": "private List<String> invalidWildCardUrls = Arrays.... | {
"body": "@Test\n void addQueryParameter() {\n String url = \"http://sub.domain.com\";\n String name = \"name\";\n String value = \"value\";\n assertEquals(\"http://sub.domain.com?name=value\", UaaUrlUtils.addQueryParameter(url, name, value));\n assertEquals(\"http://sub.domain.... | {
"fields": [
{
"declarator": "VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\")",
"modifier": "private static final",
"original_string": "private static final Pattern VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-... | {
"body": "public static String addQueryParameter(String url, String name, String value) {\n UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(url);\n builder.queryParam(name, value);\n return builder.build().toUriString();\n }",
"class_method_signature": "UaaUrlUtils.addQuer... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_391 | {
"fields": [
{
"declarator": "issuerUrl",
"modifier": "private",
"original_string": "private String issuerUrl;",
"type": "String",
"var_name": "issuerUrl"
},
{
"declarator": "uaaUrl",
"modifier": "private",
"original_string": "private String uaaUrl;",
... | {
"body": "@Test\n void create_includesStandardClaims() throws IdTokenCreationException {\n IdToken idToken = tokenCreator.create(clientDetails, user, userAuthenticationData);\n\n assertThat(idToken, is(notNullValue()));\n assertThat(idToken.sub, is(\"id1234\"));\n assertThat(idToken.au... | {
"fields": [
{
"declarator": "ROLES_SCOPE = \"roles\"",
"modifier": "private final",
"original_string": "private final String ROLES_SCOPE = \"roles\";",
"type": "String",
"var_name": "ROLES_SCOPE"
},
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
... | {
"body": "public IdToken create(ClientDetails clientDetails,\n UaaUser uaaUser,\n UserAuthenticationData userAuthenticationData) throws IdTokenCreationException {\n Date expiryDate = tokenValidityResolver.resolve(clientDetails.getClientId());\n Date iss... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_112 | {
"fields": [
{
"declarator": "CLIENT_ID = \"app\"",
"modifier": "public static final",
"original_string": "public static final String CLIENT_ID = \"app\";",
"type": "String",
"var_name": "CLIENT_ID"
},
{
"declarator": "USER_ID = \"a7f07bf6-e720-4652-8999-e980189cef54\"... | {
"body": "@Test\n public void buildIdTokenValidator_performsSignatureValidation() {\n ChainedSignatureVerifier signatureVerifier = mock(ChainedSignatureVerifier.class);\n buildIdTokenValidator(getToken(), signatureVerifier, new KeyInfoService(\"https://localhost\"));\n\n verify(signatureVerif... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(TokenValidation.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TokenValidation.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static TokenValidation buildIdTokenValidator(String tokenJwtValue, SignatureVerifier verifier, KeyInfoService keyInfoService) {\n IdTokenValidation idTokenValidation = new IdTokenValidation(tokenJwtValue, keyInfoService);\n idTokenValidation.checkSignature(verifier);\n return id... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_407 | {
"fields": [
{
"declarator": "requestedScopesWithoutOpenId",
"modifier": "private",
"original_string": "private HashSet<String> requestedScopesWithoutOpenId;",
"type": "HashSet<String>",
"var_name": "requestedScopesWithoutOpenId"
},
{
"declarator": "requestedScopesWith... | {
"body": "@Test\n public void shouldSend_isFalse_whenClientCredentialsGrantType() {\n // Can't build an id_token without an associated user account which client_credentials does not have.\n assertFalse(idTokenGranter.shouldSendIdToken(null, clientWithOpenId, requestedScopesWithOpenId, GRANT_TYPE_CLI... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(IdTokenGranter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(IdTokenGranter.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean shouldSendIdToken(UaaUser user,\n BaseClientDetails clientDetails,\n Set<String> requestedScopes,\n String requestedGrantType\n ) {\n if (null == user || !GRANT_TYPES_THAT_MA... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_283 | {
"fields": [
{
"declarator": "mockIdentityProviderProvisioning",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IdentityProviderProvisioning mockIdentityProviderProvisioning;",
"type": "IdentityProviderProvisioning",
"var_name": "mockIdentityProviderProvisi... | {
"body": "@Test\n void retrieve_all_providers_redacts_data() {\n when(mockIdentityProviderProvisioning.retrieveAll(anyBoolean(), anyString()))\n .thenReturn(Arrays.asList(getLdapDefinition(), getExternalOAuthProvider()));\n ResponseEntity<List<IdentityProvider>> ldapList = identityPro... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(IdentityProviderEndpoints.class)",
"modifier": "protected static",
"original_string": "protected static Logger logger = LoggerFactory.getLogger(IdentityProviderEndpoints.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "@RequestMapping(method = GET)\n public ResponseEntity<List<IdentityProvider>> retrieveIdentityProviders(@RequestParam(value = \"active_only\", required = false) String activeOnly, @RequestParam(required = false, defaultValue = \"false\") boolean rawConfig) {\n boolean retrieveActiveOnly = Boolean... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_329 | {
"fields": [
{
"declarator": "base64EncodedImg = getResourceAsString(\n JdbcClientMetadataProvisioningTest.class,\n \"base64EncodedImg\")",
"modifier": "private static final",
"original_string": "private static final String base64EncodedImg = getResourceAsString(\n ... | {
"body": "@Test\n void retrieve() throws Exception {\n jdbcTemplate.execute(insertIntoOauthClientDetails(clientId, identityZoneId, createdBy));\n ClientMetadata clientMetadata = createTestClientMetadata(\n clientId,\n true,\n new URL(\"http://app.launch/u... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(JdbcClientMetadataProvisioning.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(JdbcClientMetadataProvisioning.class);",
"type": "Logger",
"var... | {
"body": "@Override\n public ClientMetadata retrieve(String clientId, String zoneId) {\n logger.debug(\"Retrieving UI details for client: \" + clientId);\n return jdbcTemplate.queryForObject(CLIENT_METADATA_QUERY, mapper, clientId, zoneId);\n }",
"class_method_signature": "JdbcClientMetadataPro... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_145 | {
"fields": [
{
"declarator": "commonLoginPolicy",
"modifier": "private",
"original_string": "private CommonLoginPolicy commonLoginPolicy;",
"type": "CommonLoginPolicy",
"var_name": "commonLoginPolicy"
},
{
"declarator": "lockoutPolicyRetriever",
"modifier": "priv... | {
"body": "@Test\n public void test_is_disabled() {\n commonLoginPolicy = spy(new CommonLoginPolicy(auditService, lockoutPolicyRetriever, successEventType, failureEventType, timeService, false));\n LoginPolicy.Result result = commonLoginPolicy.isAllowed(\"principal\");\n assertTrue(result.isAl... | {
"fields": [
{
"declarator": "auditService",
"modifier": "private final",
"original_string": "private final UaaAuditService auditService;",
"type": "UaaAuditService",
"var_name": "auditService"
},
{
"declarator": "lockoutPolicyRetriever",
"modifier": "private fin... | {
"body": "@Override\n public Result isAllowed(String principalId) {\n int failureCount = 0;\n if (enabled) {\n LockoutPolicy lockoutPolicy = lockoutPolicyRetriever.getLockoutPolicy();\n\n long eventsAfter = timeService.getCurrentTimeMillis() - lockoutPolicy.getCountFailuresWith... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_450 | {
"fields": [
{
"declarator": "BAD_HEADERS = Arrays.asList(\"X-Forwarded-For\", \"X-Forwarded-Host\", \"X-Forwarded-Proto\", \"X-Forwarded-Prefix\", \"Forwarded\")",
"modifier": "public static",
"original_string": "public static List<String> BAD_HEADERS = Arrays.asList(\"X-Forwarded-For\", \"X-F... | {
"body": "@Test\n public void filter_is_case_insensitive() {\n request = new HttpHeadersFilterRequestWrapper(Collections.singletonList(\"x-forwarded-host\"), mock);\n assertNull(request.getHeader(\"X-Forwarded-Host\"));\n assertNotNull(request.getHeader(\"X-Forwarded-For\"));\n }",
"clas... | {
"fields": [
{
"declarator": "filteredHeaders",
"modifier": "private final",
"original_string": "private final List<String> filteredHeaders;",
"type": "List<String>",
"var_name": "filteredHeaders"
}
],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/web/HttpHeade... | {
"body": "@Override\n public String getHeader(String name) {\n if (shouldFilter(name)) {\n return null;\n }\n return super.getHeader(name);\n }",
"class_method_signature": "HttpHeadersFilterRequestWrapper.getHeader(String name)",
"constructor": false,
"full_signature": "@O... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_295 | {
"fields": [
{
"declarator": "mockUaaIdentityProviderConfigValidator",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private UaaIdentityProviderConfigValidator mockUaaIdentityProviderConfigValidator;",
"type": "UaaIdentityProviderConfigValidator",
"var_name": "moc... | {
"body": "@Test\n void ldap_validator_with_definition_is_invoked() {\n identityProvider.setType(LDAP);\n\n identityProviderConfigValidationDelegator.validate(identityProvider);\n\n verifyNoInteractions(mockUaaIdentityProviderConfigValidator);\n verify(mockLdapIdentityProviderConfigVali... | {
"fields": [
{
"declarator": "externalOAuthIdentityProviderConfigValidator",
"modifier": "private final",
"original_string": "private final IdentityProviderConfigValidator externalOAuthIdentityProviderConfigValidator;",
"type": "IdentityProviderConfigValidator",
"var_name": "externa... | {
"body": "@Override\n public void validate(IdentityProvider<? extends AbstractIdentityProviderDefinition> provider) {\n if (provider == null) {\n throw new IllegalArgumentException(\"Provider cannot be null\");\n }\n String type = provider.getType();\n switch (type) {\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_503 | {
"fields": [
{
"declarator": "metric",
"modifier": "private",
"original_string": "private QueryMetric metric;",
"type": "QueryMetric",
"var_name": "metric"
}
],
"file": "metrics-data/src/test/java/org/cloudfoundry/identity/uaa/metrics/QueryMetricTest.java",
"identifier": "... | {
"body": "@Test\n void getRequestCompleteTime() {\n assertEquals(6, metric.getRequestCompleteTime());\n }",
"class_method_signature": "QueryMetricTest.getRequestCompleteTime()",
"constructor": false,
"full_signature": "@Test void getRequestCompleteTime()",
"identifier": "getRequestCompleteTime",... | {
"fields": [
{
"declarator": "query",
"modifier": "private",
"original_string": "private String query;",
"type": "String",
"var_name": "query"
},
{
"declarator": "intolerable",
"modifier": "private",
"original_string": "private boolean intolerable;",
... | {
"body": "public long getRequestCompleteTime() {\n return requestCompleteTime;\n }",
"class_method_signature": "QueryMetric.getRequestCompleteTime()",
"constructor": false,
"full_signature": "public long getRequestCompleteTime()",
"identifier": "getRequestCompleteTime",
"invocations": [],
"modi... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_153 | {
"fields": [
{
"declarator": "failure",
"modifier": "private",
"original_string": "private Authentication failure;",
"type": "Authentication",
"var_name": "failure"
},
{
"declarator": "authenticateTrue",
"modifier": "private",
"original_string": "private Au... | {
"body": "@Test\n public void testUaaAuthFalseLdapTrue() {\n managers[0].setAuthenticationManager(authenticateFalse);\n managers[1].setAuthenticationManager(authenticateTrue);\n Authentication result = authMgr.authenticate(failure);\n assertNotNull(result);\n assertTrue(result.i... | {
"fields": [
{
"declarator": "IF_PREVIOUS_FALSE = \"ifPreviousFalse\"",
"modifier": "public static final",
"original_string": "public static final String IF_PREVIOUS_FALSE = \"ifPreviousFalse\";",
"type": "String",
"var_name": "IF_PREVIOUS_FALSE"
},
{
"declarator": "IF... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n if (authentication == null) {\n return authentication;\n }\n UsernamePasswordAuthenticationToken output = null;\n if (authentication instanceof Username... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_446 | {
"fields": [
{
"declarator": "SESSION_ID = \"id\"",
"modifier": "private static final",
"original_string": "private static final String SESSION_ID = \"id\";",
"type": "String",
"var_name": "SESSION_ID"
},
{
"declarator": "sessions",
"modifier": "private",
"... | {
"body": "@Test\n void doesNotDeleteActiveSessions() {\n sessions.put(SESSION_ID, createSession(SESSION_ID, false));\n\n sessions.purge();\n assertThat(sessions).hasSize(1);\n assertThat(sessions).containsKey(SESSION_ID);\n }",
"class_method_signature": "PurgeableSessionMapTest.do... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PurgeableSessionMap.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(PurgeableSessionMap.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Scheduled(fixedDelayString = \"${servlet-session-purge-delay:900000}\")\n public void purge() {\n List<Session> expired = expired();\n expired.forEach(s -> remove(s.getId()));\n logger.debug(String.format(\"Purged %s sessions\", expired.size()));\n }",
"class_method_signature"... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_95 | {
"fields": [
{
"declarator": "invalidWildCardUrls = Arrays.asList(\n \"*\",\n \"**\",\n \"*/**\",\n \"**/*\",\n \"*/*\",\n \"**/**\")",
"modifier": "private",
"original_string": "private List<String> invalidWildCardUrls = Arrays.... | {
"body": "@Test\n void getHostForURI() {\n assertThat(UaaUrlUtils.getHostForURI(\"http://google.com\"), is(\"google.com\"));\n assertThat(UaaUrlUtils.getHostForURI(\"http://subdomain.uaa.com/nowhere\"), is(\"subdomain.uaa.com\"));\n assertThrows(IllegalArgumentException.class, () -> UaaUrlUti... | {
"fields": [
{
"declarator": "VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\")",
"modifier": "private static final",
"original_string": "private static final Pattern VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-... | {
"body": "public static String getHostForURI(String uri) {\n return UriComponentsBuilder.fromHttpUrl(uri).build().getHost();\n }",
"class_method_signature": "UaaUrlUtils.getHostForURI(String uri)",
"constructor": false,
"full_signature": "public static String getHostForURI(String uri)",
"identifier... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_368 | {
"fields": [
{
"declarator": "TEST_USER_ID = \"test-user-id\"",
"modifier": "private static final",
"original_string": "private static final String TEST_USER_ID = \"test-user-id\";",
"type": "String",
"var_name": "TEST_USER_ID"
},
{
"declarator": "TEST_CLIENT_ID = \"te... | {
"body": "@Test\n void addDuplicateFails() {\n jdbcRevocableTokenProvisioning.create(revocableToken, IdentityZoneHolder.get().getId());\n assertThrows(DuplicateKeyException.class,\n () -> jdbcRevocableTokenProvisioning.create(revocableToken, IdentityZoneHolder.get().getId()));\n }"... | {
"fields": [
{
"declarator": "REFRESH_TOKEN_RESPONSE_TYPE = REFRESH_TOKEN.toString()",
"modifier": "private final static",
"original_string": "private final static String REFRESH_TOKEN_RESPONSE_TYPE = REFRESH_TOKEN.toString();",
"type": "String",
"var_name": "REFRESH_TOKEN_RESPONSE_... | {
"body": "@Override\n public RevocableToken create(RevocableToken t, String zoneId) {\n checkExpired();\n template.update(INSERT_QUERY,\n t.getTokenId(),\n t.getClientId(),\n t.getUserId(),\n t.getFormat(),\n t.getResponseTyp... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_3 | {
"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 testIsRequestSigned() {\n assertTrue(config.isRequestSigned());\n }",
"class_method_signature": "SamlConfigTest.testIsRequestSigned()",
"constructor": false,
"full_signature": "@Test public void testIsRequestSigned()",
"identifier": "testIsRequestSigned",
"invocat... | {
"fields": [
{
"declarator": "LEGACY_KEY_ID = \"legacy-saml-key\"",
"modifier": "public static final",
"original_string": "public static final String LEGACY_KEY_ID = \"legacy-saml-key\";",
"type": "String",
"var_name": "LEGACY_KEY_ID"
},
{
"declarator": "assertionSigne... | {
"body": "public boolean isRequestSigned() {\n return requestSigned;\n }",
"class_method_signature": "SamlConfig.isRequestSigned()",
"constructor": false,
"full_signature": "public boolean isRequestSigned()",
"identifier": "isRequestSigned",
"invocations": [],
"modifiers": "public",
"paramete... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_387 | {
"fields": [
{
"declarator": "introspectEndpoint",
"modifier": "private",
"original_string": "private IntrospectEndpoint introspectEndpoint;",
"type": "IntrospectEndpoint",
"var_name": "introspectEndpoint"
},
{
"declarator": "resourceServerTokenServices",
"modifi... | {
"body": "@Test\n void invalidJSONInClaims() {\n String invalidToken = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e3RoaXMgaXMgbm90IHZhbGlkIEpTT059.LFFpQ0Gc28vd1YIF4OlgVSi2PjCXtImDC6HlJn75sbQ\";\n\n OAuth2AccessToken token = mock(OAuth2AccessToken.class);\n when(resourceServerTokenServices.readAcc... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "resourceSer... | {
"body": "@RequestMapping(value = \"/introspect\", method = POST)\n @ResponseBody\n public IntrospectionClaims introspect(@RequestParam(\"token\") String token) {\n IntrospectionClaims introspectionClaims = new IntrospectionClaims();\n\n try {\n OAuth2AccessToken oAuth2AccessToken = re... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_104 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/util/UaaTokenUtilsTest.java",
"identifier": "UaaTokenUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_required_user_authorities_valid() {\n List<String> requiredGroups = Arrays.asList(\"scope1\",\"scope2\",\"scope3\");\n List<GrantedAuthority> userGroups = Arrays.asList(\n new SimpleGrantedAuthority(\"scope1\"),\n new SimpleGrantedAuthority(\"... | {
"fields": [
{
"declarator": "jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\")",
"modifier": "public static final",
"original_string": "public static final Pattern jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\... | {
"body": "public static boolean hasRequiredUserAuthorities(Collection<String> requiredGroups, Collection<? extends GrantedAuthority> userGroups) {\n return hasRequiredUserGroups(requiredGroups,\n ofNullable(userGroups).orElse(emptySet())\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_411 | {
"fields": [
{
"declarator": "requestedScopesWithoutOpenId",
"modifier": "private",
"original_string": "private HashSet<String> requestedScopesWithoutOpenId;",
"type": "HashSet<String>",
"var_name": "requestedScopesWithoutOpenId"
},
{
"declarator": "requestedScopesWith... | {
"body": "@Test\n public void shouldSend_isTrue_whenAuthorizationCodeGrantIsUsed_withCodeResponseType() {\n assertTrue(idTokenGranter.shouldSendIdToken(user, clientWithOpenId, requestedScopesWithOpenId, GRANT_TYPE_AUTHORIZATION_CODE));\n }",
"class_method_signature": "IdTokenGranterTest.shouldSend_isT... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(IdTokenGranter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(IdTokenGranter.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean shouldSendIdToken(UaaUser user,\n BaseClientDetails clientDetails,\n Set<String> requestedScopes,\n String requestedGrantType\n ) {\n if (null == user || !GRANT_TYPES_THAT_MA... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_105 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/util/UaaTokenUtilsTest.java",
"identifier": "UaaTokenUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_required_user_groups_invalid() {\n List<String> requiredGroups = Arrays.asList(\"scope1\",\"scope2\",\"scope3\", \"scope5\");\n List<String> userGroups = Arrays.asList(\"scope1\",\"scope2\",\"scope3\",\"scope4\");\n assertFalse(UaaTokenUtils.hasRequiredUserG... | {
"fields": [
{
"declarator": "jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\\\\.[a-zA-Z0-9_\\\\-\\\\\\\\=]*\")",
"modifier": "public static final",
"original_string": "public static final Pattern jwtPattern = Pattern.compile(\"[a-zA-Z0-9_\\\\-\\\\\\\... | {
"body": "public static boolean hasRequiredUserGroups(Collection<String> requiredGroups, Collection<String> userGroups) {\n return ofNullable(userGroups).orElse(emptySet())\n .containsAll(ofNullable(requiredGroups).orElse(emptySet()));\n }",
"class_method_signature": "UaaTokenUtils.hasRequired... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_410 | {
"fields": [
{
"declarator": "requestedScopesWithoutOpenId",
"modifier": "private",
"original_string": "private HashSet<String> requestedScopesWithoutOpenId;",
"type": "HashSet<String>",
"var_name": "requestedScopesWithoutOpenId"
},
{
"declarator": "requestedScopesWith... | {
"body": "@Test\n public void shouldSend_isTrue_whenClientHasOpenIdScope_andOpenIdScopeIsRequested_andIdTokenResponseType_GrantTypeIsRefresh() {\n assertTrue(idTokenGranter.shouldSendIdToken(user, clientWithOpenId, requestedScopesWithOpenId, GRANT_TYPE_REFRESH_TOKEN));\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(IdTokenGranter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(IdTokenGranter.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean shouldSendIdToken(UaaUser user,\n BaseClientDetails clientDetails,\n Set<String> requestedScopes,\n String requestedGrantType\n ) {\n if (null == user || !GRANT_TYPES_THAT_MA... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_369 | {
"fields": [
{
"declarator": "TEST_USER_ID = \"test-user-id\"",
"modifier": "private static final",
"original_string": "private static final String TEST_USER_ID = \"test-user-id\";",
"type": "String",
"var_name": "TEST_USER_ID"
},
{
"declarator": "TEST_CLIENT_ID = \"te... | {
"body": "@Test\n void create() {\n RevocableToken createdToken = jdbcRevocableTokenProvisioning.create(revocableToken, IdentityZoneHolder.get().getId());\n assertTokensAreEqual(revocableToken, createdToken);\n }",
"class_method_signature": "JdbcRevocableTokenProvisioningTest.create()",
"cons... | {
"fields": [
{
"declarator": "REFRESH_TOKEN_RESPONSE_TYPE = REFRESH_TOKEN.toString()",
"modifier": "private final static",
"original_string": "private final static String REFRESH_TOKEN_RESPONSE_TYPE = REFRESH_TOKEN.toString();",
"type": "String",
"var_name": "REFRESH_TOKEN_RESPONSE_... | {
"body": "@Override\n public RevocableToken create(RevocableToken t, String zoneId) {\n checkExpired();\n template.update(INSERT_QUERY,\n t.getTokenId(),\n t.getClientId(),\n t.getUserId(),\n t.getFormat(),\n t.getResponseTyp... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_94 | {
"fields": [
{
"declarator": "invalidWildCardUrls = Arrays.asList(\n \"*\",\n \"**\",\n \"*/**\",\n \"**/*\",\n \"*/*\",\n \"**/**\")",
"modifier": "private",
"original_string": "private List<String> invalidWildCardUrls = Arrays.... | {
"body": "@Test\n void uriHasMatchingHost() {\n assertTrue(UaaUrlUtils.uriHasMatchingHost(\"http://test.com/test\", \"test.com\"));\n assertTrue(UaaUrlUtils.uriHasMatchingHost(\"http://subdomain.test.com/test\", \"subdomain.test.com\"));\n assertTrue(UaaUrlUtils.uriHasMatchingHost(\"http://1.... | {
"fields": [
{
"declarator": "VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\")",
"modifier": "private static final",
"original_string": "private static final Pattern VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-... | {
"body": "public static boolean uriHasMatchingHost(String uri, String hostname) {\n if (uri == null) {\n return false;\n }\n\n try {\n URL url = new URL(uri);\n return hostname.equals(url.getHost());\n } catch (MalformedURLException e) {\n retur... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_2 | {
"fields": [
{
"declarator": "definition",
"modifier": "",
"original_string": "ExternalIdentityProviderDefinition definition;",
"type": "ExternalIdentityProviderDefinition",
"var_name": "definition"
}
],
"file": "model/src/test/java/org/cloudfoundry/identity/uaa/provider/Ext... | {
"body": "@Test\n public void testEquals2() {\n ExternalIdentityProviderDefinition def = new ExternalIdentityProviderDefinition();\n def.setStoreCustomAttributes(false);\n assertNotEquals(definition, def);\n }",
"class_method_signature": "ExternalIdentityProviderDefinitionTest.testEquals... | {
"fields": [
{
"declarator": "GROUP_ATTRIBUTE_NAME = \"external_groups\"",
"modifier": "public static final",
"original_string": "public static final String GROUP_ATTRIBUTE_NAME = \"external_groups\";",
"type": "String",
"var_name": "GROUP_ATTRIBUTE_NAME"
},
{
"declara... | {
"body": "public void setStoreCustomAttributes(boolean storeCustomAttributes) {\n this.storeCustomAttributes = storeCustomAttributes;\n }",
"class_method_signature": "ExternalIdentityProviderDefinition.setStoreCustomAttributes(boolean storeCustomAttributes)",
"constructor": false,
"full_signature": "... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_386 | {
"fields": [
{
"declarator": "introspectEndpoint",
"modifier": "private",
"original_string": "private IntrospectEndpoint introspectEndpoint;",
"type": "IntrospectEndpoint",
"var_name": "introspectEndpoint"
},
{
"declarator": "resourceServerTokenServices",
"modifi... | {
"body": "@Test\n void claimsForValidToken() {\n OAuth2AccessToken token = mock(OAuth2AccessToken.class);\n when(resourceServerTokenServices.readAccessToken(validToken)).thenReturn(token);\n when(token.isExpired()).thenReturn(false);\n when(token.getValue()).thenReturn(validToken);\n\n... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "resourceSer... | {
"body": "@RequestMapping(value = \"/introspect\", method = POST)\n @ResponseBody\n public IntrospectionClaims introspect(@RequestParam(\"token\") String token) {\n IntrospectionClaims introspectionClaims = new IntrospectionClaims();\n\n try {\n OAuth2AccessToken oAuth2AccessToken = re... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_502 | {
"fields": [
{
"declarator": "metric",
"modifier": "private",
"original_string": "private QueryMetric metric;",
"type": "QueryMetric",
"var_name": "metric"
}
],
"file": "metrics-data/src/test/java/org/cloudfoundry/identity/uaa/metrics/QueryMetricTest.java",
"identifier": "... | {
"body": "@Test\n void getRequestStartTime() {\n assertEquals(1, metric.getRequestStartTime());\n }",
"class_method_signature": "QueryMetricTest.getRequestStartTime()",
"constructor": false,
"full_signature": "@Test void getRequestStartTime()",
"identifier": "getRequestStartTime",
"invocations... | {
"fields": [
{
"declarator": "query",
"modifier": "private",
"original_string": "private String query;",
"type": "String",
"var_name": "query"
},
{
"declarator": "intolerable",
"modifier": "private",
"original_string": "private boolean intolerable;",
... | {
"body": "public long getRequestStartTime() {\n return requestStartTime;\n }",
"class_method_signature": "QueryMetric.getRequestStartTime()",
"constructor": false,
"full_signature": "public long getRequestStartTime()",
"identifier": "getRequestStartTime",
"invocations": [],
"modifiers": "public... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_152 | {
"fields": [
{
"declarator": "failure",
"modifier": "private",
"original_string": "private Authentication failure;",
"type": "Authentication",
"var_name": "failure"
},
{
"declarator": "authenticateTrue",
"modifier": "private",
"original_string": "private Au... | {
"body": "@Test\n public void testUaaAuthTrue() {\n managers[0].setAuthenticationManager(authenticateTrue);\n managers[1].setAuthenticationManager(authenticateFalse);\n Authentication result = authMgr.authenticate(failure);\n assertNotNull(result);\n assertTrue(result.isAuthenti... | {
"fields": [
{
"declarator": "IF_PREVIOUS_FALSE = \"ifPreviousFalse\"",
"modifier": "public static final",
"original_string": "public static final String IF_PREVIOUS_FALSE = \"ifPreviousFalse\";",
"type": "String",
"var_name": "IF_PREVIOUS_FALSE"
},
{
"declarator": "IF... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n if (authentication == null) {\n return authentication;\n }\n UsernamePasswordAuthenticationToken output = null;\n if (authentication instanceof Username... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_447 | {
"fields": [
{
"declarator": "SESSION_ID = \"id\"",
"modifier": "private static final",
"original_string": "private static final String SESSION_ID = \"id\";",
"type": "String",
"var_name": "SESSION_ID"
},
{
"declarator": "sessions",
"modifier": "private",
"... | {
"body": "@Test\n void deletesActiveSessions() {\n sessions.put(SESSION_ID, createSession(SESSION_ID, true));\n\n sessions.purge();\n assertThat(sessions).hasSize(0);\n }",
"class_method_signature": "PurgeableSessionMapTest.deletesActiveSessions()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(PurgeableSessionMap.class)",
"modifier": "private final static",
"original_string": "private final static Logger logger = LoggerFactory.getLogger(PurgeableSessionMap.class);",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Scheduled(fixedDelayString = \"${servlet-session-purge-delay:900000}\")\n public void purge() {\n List<Session> expired = expired();\n expired.forEach(s -> remove(s.getId()));\n logger.debug(String.format(\"Purged %s sessions\", expired.size()));\n }",
"class_method_signature"... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_294 | {
"fields": [
{
"declarator": "mockUaaIdentityProviderConfigValidator",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private UaaIdentityProviderConfigValidator mockUaaIdentityProviderConfigValidator;",
"type": "UaaIdentityProviderConfigValidator",
"var_name": "moc... | {
"body": "@Test\n void uaa_validator_with_nodefinition_is_invoked() {\n identityProvider.setType(UAA);\n\n identityProviderConfigValidationDelegator.validate(identityProvider);\n\n verify(mockUaaIdentityProviderConfigValidator).validate(identityProvider);\n verifyNoInteractions(mockLda... | {
"fields": [
{
"declarator": "externalOAuthIdentityProviderConfigValidator",
"modifier": "private final",
"original_string": "private final IdentityProviderConfigValidator externalOAuthIdentityProviderConfigValidator;",
"type": "IdentityProviderConfigValidator",
"var_name": "externa... | {
"body": "@Override\n public void validate(IdentityProvider<? extends AbstractIdentityProviderDefinition> provider) {\n if (provider == null) {\n throw new IllegalArgumentException(\"Provider cannot be null\");\n }\n String type = provider.getType();\n switch (type) {\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_144 | {
"fields": [
{
"declarator": "instance",
"modifier": "private",
"original_string": "private PasswordGrantAuthenticationManager instance;",
"type": "PasswordGrantAuthenticationManager",
"var_name": "instance"
},
{
"declarator": "zoneAwareAuthzAuthenticationManager",
... | {
"body": "@Test\n void testOIDCPasswordGrant_LoginHintProviderNotAllowed() {\n UaaLoginHint loginHint = mock(UaaLoginHint.class);\n when(loginHint.getOrigin()).thenReturn(\"oidcprovider2\");\n Authentication auth = mock(Authentication.class);\n when(zoneAwareAuthzAuthenticationManager.... | {
"fields": [
{
"declarator": "zoneAwareAuthzAuthenticationManager",
"modifier": "private",
"original_string": "private DynamicZoneAwareAuthenticationManager zoneAwareAuthzAuthenticationManager;",
"type": "DynamicZoneAwareAuthenticationManager",
"var_name": "zoneAwareAuthzAuthenticat... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n UaaLoginHint uaaLoginHint = zoneAwareAuthzAuthenticationManager.extractLoginHint(authentication);\n List<String> allowedProviders = getAllowedProviders();\n String defaul... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_451 | {
"fields": [
{
"declarator": "BAD_HEADERS = Arrays.asList(\"X-Forwarded-For\", \"X-Forwarded-Host\", \"X-Forwarded-Proto\", \"X-Forwarded-Prefix\", \"Forwarded\")",
"modifier": "public static",
"original_string": "public static List<String> BAD_HEADERS = Arrays.asList(\"X-Forwarded-For\", \"X-F... | {
"body": "@Test\n public void null_filter_list() {\n request = new HttpHeadersFilterRequestWrapper(null, mock);\n List<String> actual = Collections.list(request.getHeaderNames());\n List<String> wanted = new ArrayList<>(BAD_HEADERS);\n wanted.add(\"Other-header\");\n assertThat(... | {
"fields": [
{
"declarator": "filteredHeaders",
"modifier": "private final",
"original_string": "private final List<String> filteredHeaders;",
"type": "List<String>",
"var_name": "filteredHeaders"
}
],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/web/HttpHeade... | {
"body": "@Override\n public Enumeration<String> getHeaderNames() {\n List<String> headerNames = Collections.list(super.getHeaderNames());\n headerNames.removeIf(header -> shouldFilter(header));\n return Collections.enumeration(headerNames);\n }",
"class_method_signature": "HttpHeadersFi... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_282 | {
"fields": [
{
"declarator": "mockIdentityProviderProvisioning",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IdentityProviderProvisioning mockIdentityProviderProvisioning;",
"type": "IdentityProviderProvisioning",
"var_name": "mockIdentityProviderProvisi... | {
"body": "@Test\n void patch_bind_password_non_ldap() {\n IdentityProvider provider = getLdapDefinition();\n LdapIdentityProviderDefinition spy = Mockito.spy((LdapIdentityProviderDefinition) provider.getConfig());\n provider.setConfig(spy);\n provider.setType(OriginKeys.UNKNOWN);\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(IdentityProviderEndpoints.class)",
"modifier": "protected static",
"original_string": "protected static Logger logger = LoggerFactory.getLogger(IdentityProviderEndpoints.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "protected void redactSensitiveData(IdentityProvider provider) {\n if (provider.getConfig() == null) {\n return;\n }\n switch (provider.getType()) {\n case LDAP: {\n if (provider.getConfig() instanceof LdapIdentityProviderDefinition) {\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_328 | {
"fields": [
{
"declarator": "base64EncodedImg = getResourceAsString(\n JdbcClientMetadataProvisioningTest.class,\n \"base64EncodedImg\")",
"modifier": "private static final",
"original_string": "private static final String base64EncodedImg = getResourceAsString(\n ... | {
"body": "@Test\n void createdByPadsTo36Chars() {\n jdbcTemplate.execute(insertIntoOauthClientDetails(clientId, identityZoneId, \"abcdef\"));\n\n ClientMetadata retrievedClientMetadata = jdbcClientMetadataProvisioning.retrieve(\n clientId,\n identityZoneId);\n\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(JdbcClientMetadataProvisioning.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(JdbcClientMetadataProvisioning.class);",
"type": "Logger",
"var... | {
"body": "@Override\n public ClientMetadata retrieve(String clientId, String zoneId) {\n logger.debug(\"Retrieving UI details for client: \" + clientId);\n return jdbcTemplate.queryForObject(CLIENT_METADATA_QUERY, mapper, clientId, zoneId);\n }",
"class_method_signature": "JdbcClientMetadataPro... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_113 | {
"fields": [
{
"declarator": "CLIENT_ID = \"app\"",
"modifier": "public static final",
"original_string": "public static final String CLIENT_ID = \"app\";",
"type": "String",
"var_name": "CLIENT_ID"
},
{
"declarator": "USER_ID = \"a7f07bf6-e720-4652-8999-e980189cef54\"... | {
"body": "@Test\n public void invalidJwt() {\n expectedException.expect(InvalidTokenException.class);\n\n buildAccessTokenValidator(\"invalid.jwt.token\", new KeyInfoService(\"https://localhost\"));\n }",
"class_method_signature": "TokenValidationTest.invalidJwt()",
"constructor": false,
"f... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(TokenValidation.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(TokenValidation.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public static TokenValidation buildAccessTokenValidator(String tokenJwtValue, KeyInfoService keyInfoService) {\n AccessTokenValidation validator = new AccessTokenValidation(tokenJwtValue, keyInfoService);\n validator.checkSignature();\n return validator;\n }",
"class_method_signat... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_406 | {
"fields": [
{
"declarator": "requestedScopesWithoutOpenId",
"modifier": "private",
"original_string": "private HashSet<String> requestedScopesWithoutOpenId;",
"type": "HashSet<String>",
"var_name": "requestedScopesWithoutOpenId"
},
{
"declarator": "requestedScopesWith... | {
"body": "@Test\n public void shouldSend_isFalse_whenUserTokenGrantType() {\n assertFalse(idTokenGranter.shouldSendIdToken(user, clientWithOpenId, requestedScopesWithOpenId, GRANT_TYPE_JWT_BEARER));\n }",
"class_method_signature": "IdTokenGranterTest.shouldSend_isFalse_whenUserTokenGrantType()",
"co... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(IdTokenGranter.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(IdTokenGranter.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "public boolean shouldSendIdToken(UaaUser user,\n BaseClientDetails clientDetails,\n Set<String> requestedScopes,\n String requestedGrantType\n ) {\n if (null == user || !GRANT_TYPES_THAT_MA... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_82 | {
"fields": [
{
"declarator": "invalidWildCardUrls = Arrays.asList(\n \"*\",\n \"**\",\n \"*/**\",\n \"**/*\",\n \"*/*\",\n \"**/**\")",
"modifier": "private",
"original_string": "private List<String> invalidWildCardUrls = Arrays.... | {
"body": "@Test\n void findMatchingRedirectUri_usesAntPathMatching() {\n //matches pattern\n String matchingRedirectUri1 = UaaUrlUtils.findMatchingRedirectUri(Collections.singleton(\"http://matching.redirect/*\"), \"http://matching.redirect/\", null);\n assertThat(matchingRedirectUri1, equalT... | {
"fields": [
{
"declarator": "VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\")",
"modifier": "private static final",
"original_string": "private static final Pattern VALID_SUBDOMAIN_PATTERN = Pattern.compile(\"([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-... | {
"body": "public static String findMatchingRedirectUri(Collection<String> redirectUris, String requestedRedirectUri, String fallbackRedirectUri) {\n AntPathMatcher matcher = new AntPathMatcher();\n\n for (String pattern : ofNullable(redirectUris).orElse(emptyList())) {\n if (matcher.match(pa... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_390 | {
"fields": [
{
"declarator": "sampleRsaPrivateKey = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"MIICXgIBAAKBgQDfTLadf6QgJeS2XXImEHMsa+1O7MmIt44xaL77N2K+J/JGpfV3\\n\" +\n \"AnkyB06wFZ02sBLB7hko42LIsVEOyTuUBird/3vlyHFKytG7UEt60Fl88SbAEfsU\\n\" +\n \"JN1i1aSUlunPS/NCz+BKwwKFP9Ss3rNImE9Uc2LMvGy... | {
"body": "@Test\n public void whenProvidingNoSigningKey_shouldError() {\n expectedException.expect(IllegalArgumentException.class);\n\n KeyInfoBuilder.build(\"key-id\", null, \"https://localhost\");\n }",
"class_method_signature": "KeyInfoBuilderTest.whenProvidingNoSigningKey_shouldError()",
... | {
"fields": [],
"file": "server/src/main/java/org/cloudfoundry/identity/uaa/oauth/KeyInfoBuilder.java",
"identifier": "KeyInfoBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeyInfoBuilder.build(String keyId, String signingKey, String uaaUrl)",
"constructor": false,
... | {
"body": "public static KeyInfo build(String keyId, String signingKey, String uaaUrl) {\n if (StringUtils.isEmpty(signingKey)) {\n throw new IllegalArgumentException(\"Signing key cannot be empty\");\n }\n\n Assert.hasText(signingKey, \"[Assertion failed] - this String argument must h... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_187 | {
"fields": [
{
"declarator": "emailChangeEmailService",
"modifier": "private",
"original_string": "private EmailChangeEmailService emailChangeEmailService;",
"type": "EmailChangeEmailService",
"var_name": "emailChangeEmailService"
},
{
"declarator": "mockScimUserProvis... | {
"body": "@Test\n void beginEmailChangeWithUsernameConflict() {\n ScimUser user = new ScimUser(\"user-001\", \"user@example.com\", \"test-name\", \"test-name\");\n user.setPrimaryEmail(\"user@example.com\");\n when(mockScimUserProvisioning.retrieve(anyString(), anyString())).thenReturn(user);... | {
"fields": [
{
"declarator": "CHANGE_EMAIL_REDIRECT_URL = \"change_email_redirect_url\"",
"modifier": "static final",
"original_string": "static final String CHANGE_EMAIL_REDIRECT_URL = \"change_email_redirect_url\";",
"type": "String",
"var_name": "CHANGE_EMAIL_REDIRECT_URL"
},... | {
"body": "@Override\n public void beginEmailChange(String userId, String email, String newEmail, String clientId, String redirectUri) {\n ScimUser user = scimUserProvisioning.retrieve(userId, identityZoneManager.getCurrentIdentityZoneId());\n List<ScimUser> results = scimUserProvisioning.retrieveByU... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_168 | {
"fields": [
{
"declarator": "mockHttpServletRequest",
"modifier": "private",
"original_string": "private MockHttpServletRequest mockHttpServletRequest;",
"type": "MockHttpServletRequest",
"var_name": "mockHttpServletRequest"
},
{
"declarator": "mockRequestCache",
... | {
"body": "@Test\n void tryingAccessForcePasswordPageNotAuthenticated() throws Exception {\n mockHttpServletRequest.setPathInfo(\"/force_password_change\");\n passwordChangeUiRequiredFilter.doFilterInternal(mockHttpServletRequest, mockHttpServletResponse, mockFilterChain);\n verify(mockFilterC... | {
"fields": [
{
"declarator": "MATCH_PATH = \"/force_password_change\"",
"modifier": "private final static",
"original_string": "private final static String MATCH_PATH = \"/force_password_change\";",
"type": "String",
"var_name": "MATCH_PATH"
},
{
"declarator": "IGNORE_... | {
"body": "@Override\n protected void doFilterInternal(\n final @NonNull HttpServletRequest request,\n final @NonNull HttpServletResponse response,\n final @NonNull FilterChain filterChain) throws ServletException, IOException {\n if (isIgnored(request)) {\n //pas... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_492 | {
"fields": [],
"file": "server/src/test/java/org/cloudfoundry/identity/uaa/mfa/MfaRegisterQRGeneratorTest.java",
"identifier": "MfaRegisterQRGeneratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testQRCode() throws Exception {\n GoogleAuthenticator authenticator = new GoogleAuthenticator();\n GoogleAuthenticatorKey key = authenticator.createCredentials();\n String encodedQrCode = MfaRegisterQRGenerator.getQRCode(\"testIssuer\", \"accountName\", key.getKe... | {
"fields": [
{
"declarator": "OTPAUTH_TOTP_URI = \"otpauth://totp/%s:%s?secret=%s&issuer=%s\"",
"modifier": "private static final",
"original_string": "private static final String OTPAUTH_TOTP_URI = \"otpauth://totp/%s:%s?secret=%s&issuer=%s\";",
"type": "String",
"var_name": "OTPAU... | {
"body": "public static String getQRCode(String issuer,\n String accountName,\n String secretKey) throws WriterException, IOException {\n if(!StringUtils.hasText(issuer) || issuer.contains(\":\")) {\n throw new IllegalArgumentExcep... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_241 | {
"fields": [
{
"declarator": "db",
"modifier": "private",
"original_string": "private JdbcSamlServiceProviderProvisioning db;",
"type": "JdbcSamlServiceProviderProvisioning",
"var_name": "db"
},
{
"declarator": "jdbcTemplate",
"modifier": "@Autowired\n private... | {
"body": "@Test\n void createSamlServiceProviderInOtherZone() {\n IdentityZone zone = MultitenancyFixture.identityZone(UUID.randomUUID().toString(), \"myzone\");\n\n SamlServiceProvider sp = createSamlServiceProvider(zone.getId());\n\n SamlServiceProvider createdSp = db.create(sp, sp.getIdent... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JdbcIdentityProviderProvisioning.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JdbcIdentityProviderProvisioning.class);",
"type": "Logger",
... | {
"body": "@Override\n public SamlServiceProvider create(final SamlServiceProvider serviceProvider, final String zoneId) {\n validate(serviceProvider);\n final String id = UUID.randomUUID().toString();\n try {\n jdbcTemplate.update(CREATE_SERVICE_PROVIDER_SQL, ps -> {\n ... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_16 | {
"fields": [
{
"declarator": "testDateString = \"2017-07-07T23:25:01.297Z\"",
"modifier": "",
"original_string": "String testDateString = \"2017-07-07T23:25:01.297Z\";",
"type": "String",
"var_name": "testDateString"
},
{
"declarator": "exceptionOccured = null",
... | {
"body": "@Test\n public void testParsingParallel() throws InterruptedException {\n Thread[] threadArray = new Thread[1000];\n for (int i = 0; i < 1000; i++) {\n\n threadArray[i] = new Thread(() -> {\n try {\n Date d = JsonDateDeserializer.getDate(testDat... | {
"fields": [
{
"declarator": "DATE_FORMATTER = \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
"modifier": "public static final",
"original_string": "public static final String DATE_FORMATTER = \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\";",
"type": "String",
"var_name": "DATE_FORMATTER"
}
],
"file"... | {
"body": "public static Date getDate(String text, JsonLocation loc) throws IOException {\n try {\n return new SimpleDateFormat(DATE_FORMATTER).parse(text);\n } catch (ParseException e) {\n throw new JsonParseException(\"Could not parse date:\"+ text, loc, e);\n }\n }",
... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_304 | {
"fields": [
{
"declarator": "secure",
"modifier": "private final",
"original_string": "private final boolean secure;",
"type": "boolean",
"var_name": "secure"
},
{
"declarator": "successHandler",
"modifier": "private",
"original_string": "private AccountSa... | {
"body": "@Test\n public void empty_Account_Cookie() throws IOException, ServletException {\n IdentityZoneHolder.get().getConfig().setAccountChooserEnabled(false);\n Date yesterday = new Date(System.currentTimeMillis()-(1000*60*60*24));\n UaaUser user = new UaaUser(\n \"user-id... | {
"fields": [
{
"declarator": "redirectingHandler",
"modifier": "private",
"original_string": "private SavedRequestAwareAuthenticationSuccessHandler redirectingHandler;",
"type": "SavedRequestAwareAuthenticationSuccessHandler",
"var_name": "redirectingHandler"
},
{
"dec... | {
"body": "@Override\n public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {\n setSavedAccountOptionCookie(request, response, authentication);\n redirectingHandler.onAuthenticationSuccess(req... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_41 | {
"fields": [
{
"declarator": "alias = \"saml\"",
"modifier": "public static final",
"original_string": "public static final String alias = \"saml\";",
"type": "String",
"var_name": "alias"
},
{
"declarator": "idpMetaData = \"<?xml version=\\\"1.0\\\"?>\\n\" +\n ... | {
"body": "@Test\n public void test_default_idp_and_client_setup() {\n assertThat(filter.filter(activeProviders,null,email), Matchers.containsInAnyOrder(uaaProvider));\n assertThat(filter.filter(activeProviders,client,email), Matchers.containsInAnyOrder(uaaProvider));\n assertThat(filter.filte... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(DomainFilter.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LoggerFactory.getLogger(DomainFilter.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": "server/sr... | {
"body": "public static List<IdentityProvider> filter(List<IdentityProvider> activeProviders, ClientDetails client, String email) {\n return filter(activeProviders, client, email, true);\n }",
"class_method_signature": "DomainFilter.filter(List<IdentityProvider> activeProviders, ClientDetails client, Str... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_216 | {
"fields": [
{
"declarator": "attrs",
"modifier": "private",
"original_string": "private Attributes attrs;",
"type": "Attributes",
"var_name": "attrs"
},
{
"declarator": "adapter",
"modifier": "private",
"original_string": "private DirContextAdapter adapter... | {
"body": "@Test\n public void testFamilyNameAttributeNameMapping() throws Exception {\n attrs.put(\"lastName\", \"Lastnamerton\");\n adapter = new DirContextAdapter(attrs, new LdapName(\"cn=marissa,ou=Users,dc=test,dc=com\"));\n mapper.setFamilyNameAttributeName(\"lastName\");\n\n Exte... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ExtendedLdapUserMapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ExtendedLdapUserMapper.class);",
"type": "Logger",
"var_name": "logger"... | {
"body": "public void setFamilyNameAttributeName(String familyNameAttributeName) {\n this.familyNameAttributeName = familyNameAttributeName;\n }",
"class_method_signature": "ExtendedLdapUserMapper.setFamilyNameAttributeName(String familyNameAttributeName)",
"constructor": false,
"full_signature": "pu... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_353 | {
"fields": [
{
"declarator": "filter",
"modifier": "",
"original_string": "DisableIdTokenResponseTypeFilter filter;",
"type": "DisableIdTokenResponseTypeFilter",
"var_name": "filter"
},
{
"declarator": "disabledFilter",
"modifier": "",
"original_string": "D... | {
"body": "@Test\n public void testDoFilterInternal_NO_Response_Type_Parameter() throws Exception {\n filter.doFilterInternal(request, response, chain);\n verify(chain).doFilter(captor.capture(), any());\n assertSame(request, captor.getValue());\n reset(chain);\n\n disabledFilter... | {
"fields": [
{
"declarator": "ID_TOKEN = \"id_token\"",
"modifier": "public static final",
"original_string": "public static final String ID_TOKEN = \"id_token\";",
"type": "String",
"var_name": "ID_TOKEN"
},
{
"declarator": "logger = LoggerFactory.getLogger(DisableIdT... | {
"body": "@Override\n protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {\n logger.debug(\"Processing id_token disable filter\");\n\n HttpServletRequest requestWrapper = request;\n logger.deb... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
3382195_129 | {
"fields": [
{
"declarator": "instance",
"modifier": "private",
"original_string": "private PasswordGrantAuthenticationManager instance;",
"type": "PasswordGrantAuthenticationManager",
"var_name": "instance"
},
{
"declarator": "zoneAwareAuthzAuthenticationManager",
... | {
"body": "@Test\n void testUaaPasswordGrant_allowedProvidersOnlyUaa() {\n Authentication auth = mock(Authentication.class);\n when(zoneAwareAuthzAuthenticationManager.extractLoginHint(auth)).thenReturn(null);\n Map<String, Object> additionalInformation = new HashMap<>();\n additionalIn... | {
"fields": [
{
"declarator": "zoneAwareAuthzAuthenticationManager",
"modifier": "private",
"original_string": "private DynamicZoneAwareAuthenticationManager zoneAwareAuthzAuthenticationManager;",
"type": "DynamicZoneAwareAuthenticationManager",
"var_name": "zoneAwareAuthzAuthenticat... | {
"body": "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n UaaLoginHint uaaLoginHint = zoneAwareAuthzAuthenticationManager.extractLoginHint(authentication);\n List<String> allowedProviders = getAllowedProviders();\n String defaul... | {
"created": "2/7/2012 10:40:55 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3382195,
"size": null,
"stargazer_count": null,
"stars": 1091,
"updates": "2020-01-27T19:04:55+00:00",
"url": "https://github.com/cloudfoundry/uaa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.