diff options
author | “Kruthi <krutbhat@att.com> | 2020-06-04 20:32:59 +0530 |
---|---|---|
committer | “Kruthi <krutbhat@att.com> | 2020-06-04 20:33:08 +0530 |
commit | 5a5dc6298559ca0cbd3f60923f779f0d3a4e3de9 (patch) | |
tree | 1d01c08a428a015064579b44b1ac45f7ae02e268 /ecomp-sdk/epsdk-core/src/main | |
parent | 6d48b04c34a009323b92b23efc507c63e40b1d87 (diff) |
Resubmitting KeyProperties changes
Change-Id: Ifdf5d90b6773ef3260572eb8d8a65238262d361f
Issue-ID: PORTAL-914
Signed-off-by: krutbhat@att.com
Diffstat (limited to 'ecomp-sdk/epsdk-core/src/main')
4 files changed, 14 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java index 58c6cd62..3a7baccd 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java @@ -51,6 +51,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.objectcache.AbstractCacheManager; import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.onap.portalsdk.core.service.DataAccessService; @@ -144,7 +146,7 @@ public class ResourceInterceptor extends HandlerInterceptorAdapter { String decreptedPwd = null; try { decreptedPwd = CipherUtil.decryptPKC(app.getAppPassword(), - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "handleSessionUpdates failed to decrypt password", e); } diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java index d9b96284..8f1a26bb 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java @@ -46,6 +46,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; import org.onap.portalsdk.core.onboarding.rest.RestWebServiceClient; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; @@ -78,7 +80,7 @@ public class RestApiRequestBuilder { appUserName = app.getUsername(); try { decryptedPwd = CipherUtil.decryptPKC(app.getAppPassword(), - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (CipherUtilException e) { logger.error(EELFLoggerDelegate.errorLogger, "getViaREST failed", e); throw new IOException("getViaREST failed", e); @@ -116,7 +118,7 @@ public class RestApiRequestBuilder { appUserName = app.getUsername(); try { decryptedPwd = CipherUtil.decryptPKC(app.getAppPassword(), - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (CipherUtilException e) { logger.error(EELFLoggerDelegate.errorLogger, "postViaREST failed", e); throw new IOException("postViaREST failed", e); @@ -153,7 +155,7 @@ public class RestApiRequestBuilder { appUserName = app.getUsername(); try { decryptedPwd = CipherUtil.decryptPKC(app.getAppPassword(), - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (CipherUtilException e) { logger.error(EELFLoggerDelegate.errorLogger, "deleteViaRest failed", e); throw new IOException("deleteViaRest failed", e); diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserApiServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserApiServiceImpl.java index 9ed0f38c..7df80183 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserApiServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UserApiServiceImpl.java @@ -58,6 +58,8 @@ import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.domain.UserApp; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.onap.portalsdk.external.authorization.domain.ExternalAccessPerms; import org.onap.portalsdk.external.authorization.domain.ExternalAccessRole; @@ -265,7 +267,7 @@ public class UserApiServiceImpl implements UserApiService { if (encrypted != null && encrypted.length() > 0) { try { result = CipherUtil.decryptPKC(encrypted, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e); throw e; diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java index 5582fd2e..a49be085 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java @@ -42,6 +42,8 @@ import java.util.List; import org.onap.portalsdk.core.domain.App; import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -70,7 +72,7 @@ public class WebServiceCallServiceImpl implements WebServiceCallService { String encriptedPwdDB = app.getAppPassword(); String appUserName = app.getUsername(); String decreptedPwd = CipherUtil.decryptPKC(encriptedPwdDB, - secretKey == null ? SystemProperties.getProperty(SystemProperties.Decryption_Key) : secretKey); + secretKey == null ? KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY) : secretKey); if (decreptedPwd.equals(requestPassword) && appUserName.equals(requestAppName)) { return true; } |