use of org.gluu.orm.util.properties.FileConfiguration in project oxAuth by GluuFederation.
the class AppInitializer method prepareAuthConnectionProperties.
private Properties prepareAuthConnectionProperties(GluuLdapConfiguration persistenceAuthConfig, String persistenceType) {
String prefix = persistenceType + "#";
FileConfiguration configuration = configurationFactory.getPersistenceConfiguration().getConfiguration();
Properties properties = (Properties) configuration.getProperties().clone();
if (persistenceAuthConfig != null) {
properties.setProperty(prefix + "servers", buildServersString(persistenceAuthConfig.getServers()));
String bindDn = persistenceAuthConfig.getBindDN();
if (StringHelper.isNotEmpty(bindDn)) {
properties.setProperty(prefix + "bindDN", bindDn);
properties.setProperty(prefix + "bindPassword", persistenceAuthConfig.getBindPassword());
}
properties.setProperty(prefix + "useSSL", Boolean.toString(persistenceAuthConfig.isUseSSL()));
properties.setProperty(prefix + "maxconnections", Integer.toString(persistenceAuthConfig.getMaxConnections()));
// Remove internal DB trustStoreFile property
properties.remove(prefix + "ssl.trustStoreFile");
properties.remove(prefix + "ssl.trustStorePin");
properties.remove(prefix + "ssl.trustStoreFormat");
}
EncryptionService securityService = encryptionServiceInstance.get();
Properties decrypytedProperties = securityService.decryptAllProperties(properties);
return decrypytedProperties;
}
use of org.gluu.orm.util.properties.FileConfiguration in project oxCore by GluuFederation.
the class ConfigurationFactory method preparePersistanceProperties.
protected Properties preparePersistanceProperties() {
FileConfiguration persistenceConfig = persistenceConfiguration.getConfiguration();
Properties connectionProperties = (Properties) persistenceConfig.getProperties();
Properties decryptedConnectionProperties;
try {
decryptedConnectionProperties = PropertiesDecrypter.decryptAllProperties(StringEncrypter.defaultInstance(), connectionProperties, this.cryptoConfigurationSalt);
} catch (EncryptionException ex) {
throw new ConfigurationException("Failed to decript configuration properties", ex);
}
return decryptedConnectionProperties;
}
use of org.gluu.orm.util.properties.FileConfiguration in project oxTrust by GluuFederation.
the class AppInitializer method preparePersistanceProperties.
protected Properties preparePersistanceProperties() {
PersistenceConfiguration persistenceConfiguration = this.configurationFactory.getPersistenceConfiguration();
FileConfiguration persistenceConfig = persistenceConfiguration.getConfiguration();
Properties connectionProperties = (Properties) persistenceConfig.getProperties();
EncryptionService securityService = encryptionServiceInstance.get();
Properties decryptedConnectionProperties = securityService.decryptAllProperties(connectionProperties);
return decryptedConnectionProperties;
}
use of org.gluu.orm.util.properties.FileConfiguration in project oxAuth by GluuFederation.
the class AppInitializer method preparePersistanceProperties.
protected Properties preparePersistanceProperties() {
PersistenceConfiguration persistenceConfiguration = this.configurationFactory.getPersistenceConfiguration();
FileConfiguration persistenceConfig = persistenceConfiguration.getConfiguration();
Properties connectionProperties = (Properties) persistenceConfig.getProperties();
EncryptionService securityService = encryptionServiceInstance.get();
Properties decryptedConnectionProperties = securityService.decryptAllProperties(connectionProperties);
return decryptedConnectionProperties;
}
Aggregations