import org.onap.portalapp.portal.logging.logic.EPLogUtil;
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.slf4j.MDC;
import org.springframework.http.HttpHeaders;
// It is a regular expression used for while creating a External Central Auth
// Role
- public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:])";
+ public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:^-])";
+ public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS_EXCLUDE_HYPHEN = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:])";
public static final String slash = "/";
public static String widgetMsProtocol() {
return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_PROTOCOL, "https");
}
+
+ /**
+ * Answers the protocol to use.
+ *
+ * @return Protocol name from property file; defaults to https.
+ */
+ public static String widgetMLProtocol() {
+ return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_ML_PROTOCOL, "https");
+ }
/**
* Answers the host to use.
public static String localOrDockerHost() {
return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_HOSTNAME, "localhost");
}
+
+ /**
+ * Answers the host to use.
+ *
+ * @return Host name from property file; defaults to localhost.
+ */
+ public static String mlLocalOrDockerHost() {
+ return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_ML_HOSTNAME, "localhost");
+ }
/**
* It returns headers where username and password of external central auth is
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;