pivotal-jbarrett commented on a change in pull request #7116:
URL: https://github.com/apache/geode/pull/7116#discussion_r758670715
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/security/SecurityServiceFactory.java
##########
@@ -49,8 +53,21 @@ public static SecurityService create(Properties
securityProps, CacheConfig cache
return create(securityProps, cacheConfig.getSecurityManager(),
cacheConfig.getPostProcessor());
}
+ private static SecurityService getTestSecurityService() {
+ String securityServiceClassName =
System.getProperty(TEST_SECURITY_SERVICE_SYSTEM_PROPERTY);
+ if (securityServiceClassName == null) {
+ return null;
+ }
+ return CallbackInstantiator.getObjectOfType(securityServiceClassName,
SecurityService.class);
+ }
+
public static SecurityService create(Properties securityProps,
SecurityManager preferredSecurityManager, PostProcessor
preferredPostProcessor) {
+ SecurityService testSecurityService = getTestSecurityService();
+ if (testSecurityService != null) {
+ return testSecurityService;
Review comment:
If the purpose for this is to just create a specific `SecurityManager`
for testing why isn't the normal method, using security properties, an
acceptable way to configure a test `SecurityManager`? As written, this test
only method completely bypasses all the other security initialization below
resulting in a modification of behavior from the normal production behavior.
--
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]