From 16a9fce0e104a38371a9e5a567ec611ae3fc7f33 Mon Sep 17 00:00:00 2001 From: ys9693 Date: Sun, 19 Jan 2020 13:50:02 +0200 Subject: Catalog alignment Issue-ID: SDC-2724 Signed-off-by: ys9693 Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe --- .../default/SDC-Simulator-webseal.conf.erb | 1 + .../org/openecomp/sdc/webseal/simulator/Login.java | 1 + .../openecomp/sdc/webseal/simulator/conf/Conf.java | 22 +++++++++++++++------- 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'utils') diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb index e4c5d753fa..4cdd4fbfba 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb @@ -1,6 +1,7 @@ { webseal { fe="<%= @fe_url %>" + portalCookieName="EPService" users = [ { userId="cs0008" diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java index 4c807f4912..9780c09936 100644 --- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java +++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/Login.java @@ -148,6 +148,7 @@ public class Login extends HttpServlet { response.addCookie(cookieLastName); response.addCookie(cookieRemoteAddress); response.addCookie(cookieWsType); + response.addCookie(new Cookie(Conf.getInstance().getPortalCookieName(), "portal")); response.sendRedirect("/sdc1"); } diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/conf/Conf.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/conf/Conf.java index 6b5103f51c..449fe62f49 100644 --- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/conf/Conf.java +++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/conf/Conf.java @@ -31,10 +31,19 @@ import java.util.Map; public class Conf { - private static Conf conf= null; + private static Conf conf = new Conf(); private String feHost; - Map users = new HashMap(); - + private Map users = new HashMap(); + private String portalCookieName; + + private void setPortalCookieName(String portalCookieName) { + this.portalCookieName = portalCookieName; + } + + public String getPortalCookieName() { + return portalCookieName; + } + private Conf(){ initConf(); } @@ -50,7 +59,9 @@ public class Conf { Config confFile = ConfigFactory.parseFileAnySyntax(new File(confPath)); Config resolve = confFile.resolve(); setFeHost(resolve.getString("webseal.fe")); - List list = resolve.getConfigList("webseal.users"); + setPortalCookieName(resolve.getString("webseal.portalCookieName")); + List list = resolve.getConfigList("webseal.users"); + for (Config conf : list ){ String userId = conf.getString("userId"); String password = conf.getString("password"); @@ -67,9 +78,6 @@ public class Conf { } public static Conf getInstance(){ - if (conf == null){ - conf = new Conf(); - } return conf; } -- cgit 1.2.3-korg