Skip to content

Commit

Permalink
Update User Management core
Browse files Browse the repository at this point in the history
  • Loading branch information
danjasuw committed Jul 12, 2019
1 parent d2bfb03 commit 16e509d
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 308 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public class ProxlConfigFileReader {
private static String CONFIG_DEFAULTS_FILENAME = "proxl_config_defaults.properties";
private static String CONFIG_OVERRIDES_FILENAME = "proxl_config.properties";

private static String PROPERTY_NAME__USER_ACCOUNT_WEB_APP_URL = "user.account.webapp.url.app.context";
private static String PROPERTY_NAME__PROXL_WEBAPP_IDENTIFIER_FOR_USER_ACCOUNT_WEB_APP = "proxl.webapp.identifier.for.user.account.webapp";
private static String PROPERTY_NAME__PROXL_WEBAPP_KEY_FOR_USER_ACCOUNT_WEB_APP = "proxl.webapp.key.for.user.account.webapp";

private static String PROPERTY_NAME__SPECTRAL_STORAGE_WEB_APP_URL = "spectral.storage.webapp.url.app.context";

/**
Expand All @@ -36,10 +32,6 @@ public class ProxlConfigFileReader {

private static String PROPERTY_NAME__allowAnnTypeFilterDefaultFilterValueAtDatabaseLoad_Null_When_isDefaultFilter_True_ValueTrue = "true";

// Encryption key. Value must be 16 characters, 128 bits
private static String PROPERTY_NAME__PROXL_WEBAPP_ENCRYPTION_KEY_FOR_USER_ACCOUNT_WEB_APP =
"proxl.webapp.encryption.key.for.user.account.webapp";

private static enum AllowNoPropertiesFile { YES, NO }

/**
Expand Down Expand Up @@ -78,24 +70,6 @@ public void populateProxlConfigFileValuesFromConfigFiles() throws IOException, P
// throw new ProxlWebappConfigException( msg );
// }

log.warn( "INFO: '" + PROPERTY_NAME__USER_ACCOUNT_WEB_APP_URL + "' has value: "
+ proxlConfigFileValues.getUserAccountServerURLandAppContext() );
log.warn( "INFO: '" + PROPERTY_NAME__PROXL_WEBAPP_IDENTIFIER_FOR_USER_ACCOUNT_WEB_APP + "' has value: "
+ proxlConfigFileValues.getRequestingWebappIdentifier() );
if ( StringUtils.isNotEmpty( proxlConfigFileValues.getRequestingWebappKey() ) ) {
log.warn( "INFO: '" + PROPERTY_NAME__PROXL_WEBAPP_KEY_FOR_USER_ACCOUNT_WEB_APP + "' has value: "
+ proxlConfigFileValues.getRequestingWebappKey() );
} else {
log.warn( "INFO: '" + PROPERTY_NAME__PROXL_WEBAPP_KEY_FOR_USER_ACCOUNT_WEB_APP
+ "' is not populated in config or is empty string." );
}
if ( StringUtils.isNotEmpty( proxlConfigFileValues.getRequestingEncryptionKey() ) ) {
log.warn( "INFO: '" + PROPERTY_NAME__PROXL_WEBAPP_ENCRYPTION_KEY_FOR_USER_ACCOUNT_WEB_APP + "' has a value" );
} else {
log.warn( "INFO: '" + PROPERTY_NAME__PROXL_WEBAPP_ENCRYPTION_KEY_FOR_USER_ACCOUNT_WEB_APP
+ "' is not populated in config or is empty string." );
}

log.warn( "INFO: '" + PROPERTY_NAME__SPECTRAL_STORAGE_WEB_APP_URL + "' has value: "
+ proxlConfigFileValues.getSpectralStorageServerURLandAppContext() );

Expand Down Expand Up @@ -139,23 +113,7 @@ private void processPropertiesFilename(
Properties configProps = new Properties();
configProps.load(propertiesFileAsStream);
String propertyValue = null;
propertyValue = configProps.getProperty( PROPERTY_NAME__USER_ACCOUNT_WEB_APP_URL );
if ( StringUtils.isNotEmpty( propertyValue ) ) {
proxlConfigFileValues.setUserAccountServerURLandAppContext( propertyValue );
}
propertyValue = configProps.getProperty( PROPERTY_NAME__PROXL_WEBAPP_IDENTIFIER_FOR_USER_ACCOUNT_WEB_APP );
if ( StringUtils.isNotEmpty( propertyValue ) ) {
proxlConfigFileValues.setRequestingWebappIdentifier( propertyValue );
}
propertyValue = configProps.getProperty( PROPERTY_NAME__PROXL_WEBAPP_KEY_FOR_USER_ACCOUNT_WEB_APP );
if ( StringUtils.isNotEmpty( propertyValue ) ) {
proxlConfigFileValues.setRequestingWebappKey( propertyValue );
}
propertyValue = configProps.getProperty( PROPERTY_NAME__PROXL_WEBAPP_ENCRYPTION_KEY_FOR_USER_ACCOUNT_WEB_APP );
if ( StringUtils.isNotEmpty( propertyValue ) ) {
proxlConfigFileValues.setRequestingEncryptionKey( propertyValue );
}


propertyValue = configProps.getProperty( PROPERTY_NAME__SPECTRAL_STORAGE_WEB_APP_URL );
if ( StringUtils.isNotEmpty( propertyValue ) ) {
proxlConfigFileValues.setSpectralStorageServerURLandAppContext( propertyValue );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ public static ProxlConfigFileValues getInstance() {
*/
private ProxlConfigFileValues() {}

// User Account Server Connection Info
private String userAccountServerURLandAppContext;
private String requestingWebappIdentifier;
private String requestingWebappKey;
private String requestingEncryptionKey;

// Spectral Storage Server Connection Info
private String spectralStorageServerURLandAppContext;

Expand Down Expand Up @@ -58,32 +52,6 @@ public void setAllowAnnTypeFilterDefaultFilterValueAtDatabaseLoad_Null_When_isDe
this.allowAnnTypeFilterDefaultFilterValueAtDatabaseLoad_Null_When_isDefaultFilter_True = allowAnnTypeFilterDefaultFilterValueAtDatabaseLoad_Null_When_isDefaultFilter_True;
}


public String getRequestingEncryptionKey() {
return requestingEncryptionKey;
}
public void setRequestingEncryptionKey(String requestingEncryptionKey) {
this.requestingEncryptionKey = requestingEncryptionKey;
}
public String getRequestingWebappIdentifier() {
return requestingWebappIdentifier;
}
public void setRequestingWebappIdentifier(String requestingWebappIdentifier) {
this.requestingWebappIdentifier = requestingWebappIdentifier;
}
public String getRequestingWebappKey() {
return requestingWebappKey;
}
public void setRequestingWebappKey(String requestingWebappKey) {
this.requestingWebappKey = requestingWebappKey;
}
public String getUserAccountServerURLandAppContext() {
return userAccountServerURLandAppContext;
}
public void setUserAccountServerURLandAppContext(String userAccountServerURLandAppContext) {
this.userAccountServerURLandAppContext = userAccountServerURLandAppContext;
}

public String getSpectralStorageServerURLandAppContext() {
return spectralStorageServerURLandAppContext;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.slf4j.LoggerFactory; import org.slf4j.Logger;
import org.yeastrc.auth.db.AuthLibraryDBConnectionFactory;
import org.yeastrc.session_mgmt.main.YRCSessionMgmtMain;
import org.yeastrc.user_mgmt_central.main_code.db.UserMgmtCentralMainDBConnectionFactory;
import org.yeastrc.xlink.db.DBConnectionFactory;
import org.yeastrc.xlink.base.config_system_table_common_access.ConfigSystemTableGetValueCommon;
import org.yeastrc.xlink.base.config_system_table_common_access.IConfigSystemTableGetValue;
Expand Down Expand Up @@ -88,9 +87,6 @@ public void contextInitialized(ServletContextEvent event) {
AuthLibraryDBConnectionFactoryForWeb dbConnectFactory = new AuthLibraryDBConnectionFactoryForWeb();
AuthLibraryDBConnectionFactory.setDbConnectionFactoryImpl(dbConnectFactory);

UserMgmtCentralMainDBConnectionFactory_For_Proxl userMgmtCentralMainDBConnectionFactory_For_Proxl = new UserMgmtCentralMainDBConnectionFactory_For_Proxl();
UserMgmtCentralMainDBConnectionFactory.setDbConnectionFactoryImpl( userMgmtCentralMainDBConnectionFactory_For_Proxl );

// Remove validation so web app will start up with no configuration records
// try {
// GetEmailConfig.validateEmailConfig(); // throws Exception if error
Expand All @@ -108,7 +104,9 @@ public void contextInitialized(ServletContextEvent event) {
throw new RuntimeException( e );
}

UserMgmtCentralWebappWebserviceAccess.getInstance().init();
UserMgmtCentralMainDBConnectionFactory_For_Proxl userMgmtCentralMainDBConnectionFactory_For_Proxl = new UserMgmtCentralMainDBConnectionFactory_For_Proxl();

UserMgmtCentralWebappWebserviceAccess.getInstance().init( userMgmtCentralMainDBConnectionFactory_For_Proxl );

AppContextConfigSystemValuesRetrieval appContextConfigSystemValuesRetrieval =
new AppContextConfigSystemValuesRetrieval();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import java.sql.Connection;

import org.yeastrc.user_mgmt_central.main_code.db.IUserMgmtCentralMainDBConnectionFactory;
import org.yeastrc.user_mgmt_central.user_mgmt_central__embed_code.UserMgmtEmbed_SQL_Connection_Provider_IF;
import org.yeastrc.xlink.db.DBConnectionFactory;

/**
* concrete class that will be passed to AuthLibraryDBConnectionFactory in User Mgmt Embed Library
* for getting a database connection in the Cross Linking web app
*
*/
public class UserMgmtCentralMainDBConnectionFactory_For_Proxl implements IUserMgmtCentralMainDBConnectionFactory {
public class UserMgmtCentralMainDBConnectionFactory_For_Proxl implements UserMgmtEmbed_SQL_Connection_Provider_IF {

/* (non-Javadoc)
* @see org.yeastrc.user_mgmt_central.main_code.db.IUserMgmtCentralMainDBConnectionFactory#getConnection()
Expand Down

0 comments on commit 16e509d

Please sign in to comment.