From 27fa75194efcf77c93b645ef7b412668ac3f5d38 Mon Sep 17 00:00:00 2001 From: xuegao Date: Wed, 9 Dec 2020 16:01:22 +0100 Subject: Add basic auth Adding basic auth for SDC apis. Issue-ID: OJSI-90 Signed-off-by: xuegao Change-Id: Ie84e6bab8d8526f7f4d21a36bba52d8fe9abebbb Signed-off-by: xuegao --- .../org/openecomp/sdc/be/config/Configuration.java | 49 ++++++++++++++++++++++ .../org/openecomp/sdc/fe/config/Configuration.java | 40 ++++++++++++++++++ 2 files changed, 89 insertions(+) (limited to 'common-app-api') diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java index 4ec7a16a5c..4ebacffa0e 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java @@ -118,6 +118,8 @@ public class Configuration extends BasicConfiguration { private DcaeConfig dcae; + private BasicAuthConfig basicAuth; + private CassandrConfig cassandraConfig; private SwitchoverDetectorConfig switchoverDetector; @@ -1175,6 +1177,53 @@ public class Configuration extends BasicConfiguration { } + public BasicAuthConfig getBasicAuth() { + return basicAuth; + } + + public void setBasicAuth(BasicAuthConfig basicAuth) { + this.basicAuth = basicAuth; + } + + public static class BasicAuthConfig { + boolean enabled; + String userName; + String userPass; + String excludedUrls; + + public boolean getEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserPass() { + return userPass; + } + + public void setUserPass(String userPass) { + this.userPass = userPass; + } + + public String getExcludedUrls() { + return excludedUrls; + } + + public void setExcludedUrls(String excludedUrls) { + this.excludedUrls = excludedUrls; + } + } + public DcaeConfig getDcae() { return dcae; } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/fe/config/Configuration.java b/common-app-api/src/main/java/org/openecomp/sdc/fe/config/Configuration.java index b2e58f5766..e437034ea0 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/fe/config/Configuration.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/fe/config/Configuration.java @@ -61,6 +61,8 @@ public class Configuration extends BasicConfiguration { private CookieConfig authCookie; + private BasicAuthConfig basicAuth; + private CatalogFacadeMsConfig catalogFacadeMs; /** * be http context @@ -265,6 +267,14 @@ public class Configuration extends BasicConfiguration { this.authCookie = authCookie; } + public BasicAuthConfig getBasicAuth() { + return basicAuth; + } + + public void setBasicAuth(BasicAuthConfig basicAuth) { + this.basicAuth = basicAuth; + } + @Override public String toString() { return new StringBuilder().append(format("backend host: %s%n", beHost)) @@ -456,6 +466,36 @@ public class Configuration extends BasicConfiguration { } } + public static class BasicAuthConfig { + boolean enabled = false; + String userName = ""; + String userPass = ""; + + public boolean getEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserPass() {return userPass; + } + + public void setUserPass(String userPass) { + this.userPass = userPass; + } + + } + public static class CatalogFacadeMsConfig { String protocol; String host; -- cgit 1.2.3-korg