mhansonp commented on a change in pull request #6755:
URL: https://github.com/apache/geode/pull/6755#discussion_r692552789
##########
File path:
geode-core/src/upgradeTest/java/org/apache/geode/security/AuthExpirationDUnitTest.java
##########
@@ -109,4 +114,82 @@ public void
clientShouldReAuthenticateWhenCredentialExpiredAndOperationSucceed()
assertThat(region.size()).isEqualTo(2);
}
+ @Test
+ public void
userShouldReAuthenticateWhenCredentialExpiredAndOperationSucceed() throws
Exception {
+ int serverPort = server.getPort();
+ ClientVM clientVM = lsRule.startClientVM(0, clientVersion,
+ c -> c.withMultiUser(true)
+ .withProperty(SECURITY_CLIENT_AUTH_INIT,
UpdatableUserAuthInitialize.class.getName())
+ .withPoolSubscription(true)
+ .withServerConnection(serverPort));
+
+ clientVM.invoke(() -> {
+ UpdatableUserAuthInitialize.setUser("serviceUser0");
+ UpdatableUserAuthInitialize.setAttempts(0);
+ UpdatableUserAuthInitialize.setAlternate(false);
+ ClientCache clientCache = ClusterStartupRule.getClientCache();
+ assert clientCache != null;
+
clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("region");
+ Properties userSecurityProperties = new Properties();
+ userSecurityProperties.put("security-username", "serviceUser0");
+ userSecurityProperties.put("security-password", "serviceUser0");
+ RegionService regionService =
clientCache.createAuthenticatedView(userSecurityProperties);
+ Region<Object, Object> region = regionService.getRegion("/region");
+ region.put(0, "value0");
+ regionService.close();
+ });
+
Review comment:
One note that is most likely irrelevant in this case is that splitting
it takes more time for context switching.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]