private ClientProxyMembershipID(int id, byte[] clientSideIdentity) { boolean specialCase = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "SPECIAL_DURABLE"); String durableID = this.system.getProperties().getProperty(DURABLE_CLIENT_ID); if (specialCase && durableID != null && (!durableID.equals(""))) { this.uniqueId = durable_synch_counter; } else { this.uniqueId = id; } this.identity = clientSideIdentity; this.memberId = systemMemberId; }
private byte determineClientConflation() { byte result = CONFLATION_DEFAULT; String clientConflationValue = this.system.getProperties().getProperty(CONFLATE_EVENTS); if (DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_ON .equalsIgnoreCase(clientConflationValue)) { result = CONFLATION_ON; } else if (DistributionConfig.CLIENT_CONFLATION_PROP_VALUE_OFF .equalsIgnoreCase(clientConflationValue)) { result = CONFLATION_OFF; } return result; }
protected Properties getCredentials(DistributedMember member) { String authInitMethod = this.system.getProperties().getProperty(SECURITY_CLIENT_AUTH_INIT); return getCredentials(authInitMethod, this.system.getSecurityProperties(), member, false, (InternalLogWriter) this.system.getLogWriter(), (InternalLogWriter) this.system.getSecurityLogWriter()); }
private void checkIfAuthenticWanSite(DataInputStream dis, DataOutputStream dos, DistributedMember member) throws GemFireSecurityException, IOException { if (this.credentials == null) { return; } String authenticator = this.system.getProperties().getProperty(SECURITY_CLIENT_AUTHENTICATOR); Properties peerWanProps = readCredentials(dis, dos, this.system, this.securityService); verifyCredentials(authenticator, peerWanProps, this.system.getSecurityProperties(), (InternalLogWriter) this.system.getLogWriter(), (InternalLogWriter) this.system.getSecurityLogWriter(), member, this.securityService); } }
private void startCache(DistributedSystem ds) { InternalCache internalCache = GemFireCacheImpl.getInstance(); if (internalCache == null) { logger.info("Creating cache for locator."); this.myCache = (InternalCache) new CacheFactory(ds.getProperties()).create(); internalCache = this.myCache; } else { logger.info("Using existing cache for locator."); ((InternalDistributedSystem) ds).handleResourceEvent(ResourceEvent.LOCATOR_START, this); } startJmxManagerLocationService(internalCache); startClusterManagementService(); }
public Object verifyCredentials() throws AuthenticationRequiredException, AuthenticationFailedException { String methodName = this.system.getProperties().getProperty(SECURITY_CLIENT_AUTHENTICATOR); return verifyCredentials(methodName, this.credentials, this.system.getSecurityProperties(), (InternalLogWriter) this.system.getLogWriter(), (InternalLogWriter) this.system.getSecurityLogWriter(), this.id.getDistributedMember(), this.securityService); }
public MemberCommandService(InternalCache cache) throws CommandServiceException { this.cache = cache; try { this.onlineCommandProcessor = new OnlineCommandProcessor( cache.getDistributedSystem().getProperties(), cache.getSecurityService(), cache); } catch (Exception e) { throw new CommandServiceException("Could not load commands.", e); } }
Properties props = cache.getDistributedSystem().getProperties(); assertThat(this.getMaxLogFileSizes()).contains(props.getProperty(LOG_FILE_SIZE_LIMIT));
public InternalConfigurationPersistenceService(InternalCache cache, Class<?>... xsdClasses) throws IOException { this.cache = cache; Properties properties = cache.getDistributedSystem().getProperties();
Properties sysProps = system.getProperties(); String authenticator = sysProps.getProperty(SECURITY_CLIENT_AUTHENTICATOR);
this.cache.getDistributedSystem().getProperties().getProperty(SECURITY_CLIENT_ACCESSOR_PP);
public AuthenticateUserOpImpl(Connection con, ExecutablePool pool) { super(MessageType.USER_CREDENTIAL_MESSAGE, 1); byte[] credentialBytes = null; DistributedMember server = new InternalDistributedMember(con.getSocket().getInetAddress(), con.getSocket().getPort(), false); DistributedSystem sys = InternalDistributedSystem.getConnectedInstance(); String authInitMethod = sys.getProperties().getProperty(SECURITY_CLIENT_AUTH_INIT); Properties tmpSecurityProperties = sys.getSecurityProperties(); // LOG: following passes the DS API LogWriters into the security API Properties credentials = Handshake.getCredentials(authInitMethod, tmpSecurityProperties, server, false, (InternalLogWriter) sys.getLogWriter(), (InternalLogWriter) sys.getSecurityLogWriter()); getMessage().setMessageHasSecurePartFlag(); HeapDataOutputStream heapdos = new HeapDataOutputStream(Version.CURRENT); try { DataSerializer.writeProperties(credentials, heapdos); credentialBytes = ((ConnectionImpl) con).encryptBytes(heapdos.toByteArray()); } catch (Exception e) { throw new ServerOperationException(e); } finally { heapdos.close(); } getMessage().addBytesPart(credentialBytes); }
InternalLogWriter securityLogWriter = getSecurityLogWriter(); DistributedSystem system = getDistributedSystem(); Properties systemProperties = system.getProperties(); String authzFactoryName = systemProperties.getProperty(SECURITY_CLIENT_ACCESSOR); String postAuthzFactoryName = systemProperties.getProperty(SECURITY_CLIENT_ACCESSOR_PP);
String authInitMethod = this.system.getProperties().getProperty(SECURITY_CLIENT_AUTH_INIT); acceptanceCode = writeCredential(dos, dis, authInitMethod, ports != null, member, hdos);
this.clientReadTimeout, null, this.credentials, member, false); String authInit = this.system.getProperties().getProperty(SECURITY_CLIENT_AUTH_INIT); if (!communicationMode.isWAN() && intermediateAcceptanceCode != REPLY_AUTH_NOT_REQUIRED
cnx.getSocket().getPort(), false); DistributedSystem sys = InternalDistributedSystem.getConnectedInstance(); String authInitMethod = sys.getProperties().getProperty(SECURITY_CLIENT_AUTH_INIT);
String methodName = system.getProperties().getProperty(SECURITY_CLIENT_AUTHENTICATOR);
@Nullable @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof GemFireCache) { GemFireCache gemfireCache = (GemFireCache) bean; when(gemfireCache.getDistributedSystem().getProperties()).thenReturn(this.gemfireProperties.get()); } return bean; }
public static DistributedSystem mockDistributedSystem() { DistributedSystem mockDistributedSystem = mock(DistributedSystem.class); when(mockDistributedSystem.getProperties()).thenAnswer(invocation -> gemfireProperties.get()); when(mockDistributedSystem.getReconnectedSystem()).thenAnswer(invocation -> mockDistributedSystem()); return mockDistributedSystem; }
@Test public void testGemFireCacheConfiguration() { assertNotNull("The GemFire Cache was not properly configured and initialized!", gemfireCache); assertNotNull(gemfireCache.getDistributedSystem()); assertNotNull(gemfireCache.getDistributedSystem().getProperties()); assertEquals("SpringGemFireJavaConfigTest", gemfireCache.getDistributedSystem().getProperties().getProperty("name")); assertEquals("0", gemfireCache.getDistributedSystem().getProperties().getProperty("mcast-port")); assertEquals("config", gemfireCache.getDistributedSystem().getProperties().getProperty("log-level")); }