diff options
author | Jorge Hernandez <jh1730@att.com> | 2018-08-08 10:28:36 -0500 |
---|---|---|
committer | Jorge Hernandez <jh1730@att.com> | 2018-08-08 12:29:54 -0500 |
commit | 0d62e1d1e8d0a7744a62f437605a4197ec6e3285 (patch) | |
tree | b007ff5332a71fdb1387cf5212dc178f6650038f /policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java | |
parent | 7ff19ee29e708be8c7fb3fc4428db0f399c0b4df (diff) |
generic jetty filter and cadi support
Change-Id: I363e44e85e1d89c6254218629010d5c3e1507e0a
Issue-ID: POLICY-1043
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java')
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java index c7d2b1bf..4a430b20 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java @@ -26,6 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Properties; +import org.onap.aaf.cadi.filter.CadiFilter; import org.onap.policy.common.endpoints.http.server.internal.JettyJerseyServer; import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; import org.slf4j.Logger; @@ -222,6 +223,13 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { https = Boolean.parseBoolean(httpsString); } + String aafString = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + + serviceName + PolicyEndPointProperties.PROPERTY_AAF_SUFFIX); + boolean aaf = false; + if (aafString != null && !aafString.isEmpty()) { + aaf = Boolean.parseBoolean(httpsString); + } + HttpServletServer service = build(serviceName, https, hostName, servicePort, contextUriPath, swagger, managed); if (userName != null && !userName.isEmpty() && password != null && !password.isEmpty()) { service.setBasicAuthentication(userName, password, authUriPath); @@ -241,6 +249,10 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { } } + if (aaf) { + service.addFilterClass(contextUriPath, CadiFilter.class.getCanonicalName()); + } + serviceList.add(service); } |