diff options
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server')
3 files changed, 24 insertions, 14 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 b98ed180..488512f9 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 @@ -179,33 +179,41 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { continue; } - String hostName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String hostName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_HOST_SUFFIX); - String contextUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String contextUriPath = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_CONTEXT_URIPATH_SUFFIX); - String userName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String userName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX); - String password = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String password = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX); - String authUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String authUriPath = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_URIPATH_SUFFIX); - String restClasses = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String restClasses = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX); - String filterClasses = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_FILTER_CLASSES_SUFFIX); + final String filterClasses = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_FILTER_CLASSES_SUFFIX); - String restPackages = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String restPackages = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_PACKAGES_SUFFIX); - String restUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + + final String restUriPath = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_URIPATH_SUFFIX); - String managedString = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String managedString = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX); boolean managed = true; if (managedString != null && !managedString.isEmpty()) { @@ -233,14 +241,15 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { aaf = Boolean.parseBoolean(aafString); } - HttpServletServer service = build(serviceName, https, hostName, servicePort, contextUriPath, swagger, managed); + HttpServletServer service = build(serviceName, https, hostName, servicePort, + contextUriPath, swagger, managed); /* authentication method either AAF or HTTP Basic Auth */ if (aaf) { service.addFilterClass(contextUriPath, CadiFilter.class.getCanonicalName()); } else if (userName != null && !userName.isEmpty() && password != null && !password.isEmpty()) { - service.setBasicAuthentication(userName, password, authUriPath); + service.setBasicAuthentication(userName, password, authUriPath); } if (filterClasses != null && !filterClasses.isEmpty()) { diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java index 5f6bb544..df1f6044 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java @@ -40,5 +40,6 @@ public abstract class AafAuthFilter extends AuthorizationFilter { } protected abstract String getPermissionType(HttpServletRequest request); + protected abstract String getPermissionInstance(HttpServletRequest request); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java index 62fa0526..ebac41ef 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java @@ -198,7 +198,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable /** * Returns the https connector. * - * @return + * @return the server connector */ public ServerConnector httpsConnector() { SslContextFactory sslContextFactory = new SslContextFactory(); |