diff options
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util')
3 files changed, 13 insertions, 12 deletions
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/AuthUtil.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/AuthUtil.java index dc49933e..ac310805 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/AuthUtil.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/AuthUtil.java @@ -53,6 +53,7 @@ import org.apache.commons.logging.LogFactory; import org.onap.aaf.cadi.CadiWrap; import org.onap.aaf.cadi.Permission; import org.onap.aaf.cadi.aaf.AAFPermission; +import org.onap.portalsdk.core.onboarding.crossapi.IPortalRestCentralService; import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; public class AuthUtil { @@ -215,9 +216,9 @@ public class AuthUtil { String appName = ""; for (Map.Entry<String, String> entry : appCredentials.entrySet()) { - if (entry.getKey().equalsIgnoreCase("username")) { + if (entry.getKey().equalsIgnoreCase(IPortalRestCentralService.CREDENTIALS_USER)) { appUserName = entry.getValue(); - } else if (entry.getKey().equalsIgnoreCase("password")) { + } else if (entry.getKey().equalsIgnoreCase(IPortalRestCentralService.CREDENTIALS_PASS)) { appPassword = entry.getValue(); } else { appName = entry.getValue(); @@ -225,8 +226,8 @@ public class AuthUtil { } try { - String appUser = request.getHeader("username"); - String password = request.getHeader("password"); + String appUser = request.getHeader(IPortalRestCentralService.CREDENTIALS_USER); + String password = request.getHeader(IPortalRestCentralService.CREDENTIALS_PASS); if (password.equals(appPassword) && appUserName.equals(appUser)) { isauthorized = true; diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java index 6fa35372..28ada258 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/KeyProperties.java @@ -57,7 +57,7 @@ public class KeyProperties { private static final Log logger = LogFactory.getLog(KeyProperties.class); private static Properties properties; - private static String propertyFileName = "key.properties"; + public static final String PROPERTY_FILE_NAME = "key.properties"; private static final Object lockObject = new Object(); @@ -81,11 +81,11 @@ public class KeyProperties { synchronized (lockObject) { try { if (!initialize()) { - logger.error("Failed to read property file " + propertyFileName); + logger.error("Failed to read property file " + PROPERTY_FILE_NAME); return null; } } catch (IOException e) { - logger.error("Failed to read property file " + propertyFileName, e); + logger.error("Failed to read property file " + PROPERTY_FILE_NAME, e); return null; } } @@ -109,7 +109,7 @@ public class KeyProperties { private static boolean initialize() throws IOException { if (properties != null) return true; - InputStream in = KeyProperties.class.getClassLoader().getResourceAsStream(propertyFileName); + InputStream in = KeyProperties.class.getClassLoader().getResourceAsStream(PROPERTY_FILE_NAME); if (in == null) return false; properties = new Properties(); diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/PortalApiProperties.java b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/PortalApiProperties.java index aba57e44..501d35ca 100644 --- a/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/PortalApiProperties.java +++ b/ecomp-sdk/epsdk-fw/src/main/java/org/onap/portalsdk/core/onboarding/util/PortalApiProperties.java @@ -58,7 +58,7 @@ public class PortalApiProperties { private static final Log logger = LogFactory.getLog(PortalApiProperties.class); private static Properties properties; - private static String propertyFileName = "portal.properties"; + public static final String PROPERTY_FILE_NAME = "portal.properties"; private static final Object lockObject = new Object(); @@ -82,11 +82,11 @@ public class PortalApiProperties { synchronized (lockObject) { try { if (!initialize()) { - logger.error("Failed to read property file " + propertyFileName); + logger.error("Failed to read property file " + PROPERTY_FILE_NAME); return null; } } catch (IOException e) { - logger.error("Failed to read property file " + propertyFileName, e); + logger.error("Failed to read property file " + PROPERTY_FILE_NAME, e); return null; } } @@ -110,7 +110,7 @@ public class PortalApiProperties { public static boolean initialize() throws IOException { if (properties != null) return true; - InputStream in = PortalApiProperties.class.getClassLoader().getResourceAsStream(propertyFileName); + InputStream in = PortalApiProperties.class.getClassLoader().getResourceAsStream(PROPERTY_FILE_NAME); if (in == null) return false; properties = new Properties(); |