bug6097: apply same mechanism for user creation per IP locking as for failed bearer token-based authentication

This commit is contained in:
Axel Uhl
2025-03-19 14:17:35 +01:00
parent f61055f62e
commit b97ace3db0
15 changed files with 175 additions and 63 deletions
@@ -63,7 +63,7 @@ public class LeagueEventHierarchyOwnershipChangeTest {
securityService = new SecurityBundleTestWrapper().initializeSecurityServiceForTesting();
Mockito.doReturn(securityService).when(service).getSecurityService();
securityService.createSimpleUser(USERNAME, "a@b.c", PASSWORD, "The User", "SAP SE",
/* validation URL */ Locale.ENGLISH, null, null);
/* validation URL */ Locale.ENGLISH, null, null, /* clientIP */ null);
}
@Before
@@ -96,7 +96,7 @@ public class TaggingServiceTest {
securityService = new SecurityBundleTestWrapper().initializeSecurityServiceForTesting();
// create & login user
securityService.createSimpleUser(username, email, password, fullName, company, Locale.ENGLISH, null,
securityService.getDefaultTenantForCurrentUser());
securityService.getDefaultTenantForCurrentUser(), /* clientIP */ null);
ThreadContext.unbindSubject(); // ensure that a new subject is created that knows the current security manager
subject = SecurityUtils.getSubject(); // this also binds the Subject to the ThreadContext
subject.login(new UsernamePasswordToken(username, password));