Refactor Apache Geode/Pivotal GemFire (PCC) peer Security (Auth) auto-configuration.

Switch from using the GemfireBeanFactoryLocator with the security-manager property set to the SecurityManagerProxy to using the @EnableSecurityManager Annotation with the CacheFactory API.
This commit is contained in:
John Blum
2019-05-03 19:17:09 -07:00
parent cdcbbca6a4
commit 27b52f0e1d

View File

@@ -13,7 +13,6 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.springframework.geode.boot.autoconfigure;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -23,9 +22,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
import org.springframework.data.gemfire.config.annotation.ApacheShiroSecurityConfiguration;
import org.springframework.data.gemfire.config.annotation.EnableBeanFactoryLocator;
import org.springframework.data.gemfire.config.annotation.EnableSecurity;
import org.springframework.data.gemfire.config.annotation.GeodeIntegratedSecurityConfiguration;
import org.springframework.geode.config.annotation.EnableSecurityManager;
/**
* Spring Boot {@link EnableAutoConfiguration auto-configuration} enabling Apache Geode's Security functionality,
@@ -39,11 +37,9 @@ import org.springframework.data.gemfire.config.annotation.GeodeIntegratedSecurit
* @see org.springframework.data.gemfire.CacheFactoryBean
* @see org.springframework.data.gemfire.client.ClientCacheFactoryBean
* @see org.springframework.data.gemfire.config.annotation.ApacheShiroSecurityConfiguration
* @see org.springframework.data.gemfire.config.annotation.EnableBeanFactoryLocator
* @see org.springframework.data.gemfire.config.annotation.EnableSecurity
* @see org.springframework.data.gemfire.config.annotation.GeodeIntegratedSecurityConfiguration
* @see org.springframework.geode.boot.autoconfigure.HttpBasicAuthenticationSecurityConfiguration
* @see org.springframework.geode.security.support.SecurityManagerProxy
* @see org.springframework.geode.config.annotation.EnableSecurityManager
* @since 1.0.0
*/
@Configuration
@@ -53,8 +49,7 @@ import org.springframework.data.gemfire.config.annotation.GeodeIntegratedSecurit
ApacheShiroSecurityConfiguration.class,
GeodeIntegratedSecurityConfiguration.class
})
@EnableBeanFactoryLocator
@EnableSecurity(securityManagerClassName = "org.springframework.geode.security.support.SecurityManagerProxy")
@EnableSecurityManager
@Import(HttpBasicAuthenticationSecurityConfiguration.class)
@SuppressWarnings("unused")
public class PeerSecurityAutoConfiguration {