CADI AAF Integration and merging the code
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / utils / EcompPortalUtils.java
index ab43149..1b5613c 100644 (file)
@@ -43,6 +43,7 @@ import java.net.UnknownHostException;
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Base64;
 import java.util.Date;
 import java.util.List;
@@ -58,7 +59,6 @@ import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
 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.PortalApiConstants;
 import org.onap.portalsdk.core.util.SystemProperties;
 import org.slf4j.MDC;
 import org.springframework.http.HttpHeaders;
@@ -87,7 +87,7 @@ public class EcompPortalUtils {
         *         otherwise
         */
        public static boolean legitimateUserId(String orgUserId) {
-               return orgUserId.matches("^[a-zA-Z0-9]+$");
+               return orgUserId.matches("^[a-zA-Z0-9/_/-/@]+$");
        }
 
        /**
@@ -248,9 +248,13 @@ public class EcompPortalUtils {
        // This method might be just for testing purposes.
        public static void setExternalAppResponseCode(int responseCode) {
                try {
-                       String code = String.valueOf(responseCode);
+                       /*String code = String.valueOf(responseCode);
                        MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,code );
-                       code=StringUtils.EMPTY;
+                       code=StringUtils.EMPTY;*/
+                       String code = Integer.toString(responseCode);
+                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,code );
+                       char[] chars=code.toCharArray();
+               Arrays.fill(chars, ' ');
                } catch (Exception e) {
                        logger.error(EELFLoggerDelegate.errorLogger, "setExternalAppResponseCode failed", e);
                }