@Override public Properties getSecurityProperties() { return this.config.getSecurityProps(); }
@Override public void init(Services s) { this.services = s; this.securityProps = this.services.getConfig().getDistributionConfig().getSecurityProps(); }
@Test public void testSecurityProps() { Properties props = new Properties(); props.put(SECURITY_MANAGER, TestSecurityManager.class.getName()); props.put(SECURITY_POST_PROCESSOR, TestPostProcessor.class.getName()); props.put(SECURITY_LOG_LEVEL, "config"); // add another non-security property to verify it won't get put in the security properties props.put(ACK_WAIT_THRESHOLD, 2); DistributionConfig config = new DistributionConfigImpl(props); // SECURITY_ENABLED_COMPONENTS is automatically added to getSecurityProps assertEquals(config.getSecurityProps().size(), 3); }
@Test public void testSecurityPropsWithNoSetter() { Properties props = new Properties(); props.put(SECURITY_MANAGER, TestSecurityManager.class.getName()); props.put(SECURITY_POST_PROCESSOR, TestPostProcessor.class.getName()); props.put(SECURITY_LOG_LEVEL, "config"); // add another non-security property to verify it won't get put in the security properties props.put(ACK_WAIT_THRESHOLD, 2); props.put("security-username", "testName"); DistributionConfig config = new DistributionConfigImpl(props); // SECURITY_ENABLED_COMPONENTS is automatically added to getSecurityProps assertEquals(config.getSecurityProps().size(), 4); }
@Before public void setUp() throws Exception { clearStatics(); MockitoAnnotations.initMocks(this); this.props = new Properties(); this.securityProps = new Properties(); when(this.securityService.isIntegratedSecurity()).thenReturn(isIntegratedSecurity()); when(this.securityService.isPeerSecurityRequired()).thenReturn(true); when(this.securityService.login(this.securityProps)).thenReturn(this.subject); when(this.distributionConfig.getSecurityProps()).thenReturn(this.securityProps); when(this.serviceConfig.getDistributionConfig()).thenReturn(this.distributionConfig); when(this.services.getSecurityLogWriter()).thenReturn(mock(InternalLogWriter.class)); when(this.services.getConfig()).thenReturn(this.serviceConfig); when(this.services.getSecurityService()).thenReturn(this.securityService); this.authenticator.init(this.services); }
Properties serverSecProperties = config.getSecurityProps();
this.config.getSecurityProps(), securityManager, postProcessor); EncryptorImpl.initCertsMap(this.config.getSecurityProps()); EncryptorImpl.initPrivateKey(this.config.getSecurityProps()); EncryptorImpl.initDHKeys(this.config); } catch (Exception ex) {
SecurityServiceFactory.create(this.system.getConfig().getSecurityProps(), cacheConfig); this.system.setSecurityService(this.securityService); } else {
securityLogLevel = other.getSecurityLogLevel(); securityLogFile = other.getSecurityLogFile(); security.putAll(other.getSecurityProps()); removeUnresponsiveClient = other.getRemoveUnresponsiveClient(); deltaPropagation = other.getDeltaPropagation();