summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-09-18 19:17:24 -0400
committerPamela Dragosh <pdragosh@research.att.com>2018-09-18 19:17:29 -0400
commita0f011137a139598efa7cfa09df334bd7826d71e (patch)
tree1dde95db455d3a1761a815897167dede9b984dd6
parent49afdc08f0fa93264f2ae59d8a5e9931d02e6369 (diff)
Fixes for oparent upgrade
Small code fix to support jetty upgrade within oparent 1.2.1 from 9.3.* to 9.4.* Issue-ID: POLICY-1126 Change-Id: Id2df5579d05acc738d5edfd055f42628b545dd5a Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
-rw-r--r--policy-endpoints/pom.xml3
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java7
2 files changed, 5 insertions, 5 deletions
diff --git a/policy-endpoints/pom.xml b/policy-endpoints/pom.xml
index 2f52f5ea..69294844 100644
--- a/policy-endpoints/pom.xml
+++ b/policy-endpoints/pom.xml
@@ -35,7 +35,6 @@
<description>Endpoints</description>
<properties>
- <jetty.version>9.3.24.v20180605</jetty.version>
<jersey.swagger.version>1.5.18</jersey.swagger.version>
<cambria.version>1.2.1-oss</cambria.version>
<jersey.version>2.25.1</jersey.version>
@@ -92,13 +91,11 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
- <version>${jetty.version}</version>
</dependency>
<dependency>
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 3b8c08fc..62fa0526 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
@@ -29,6 +29,7 @@ import javax.servlet.DispatcherType;
import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.HashLoginService;
+import org.eclipse.jetty.security.UserStore;
import org.eclipse.jetty.security.authentication.BasicAuthenticator;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
@@ -244,8 +245,10 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
srvltPath = "/*";
}
- HashLoginService hashLoginService = new HashLoginService();
- hashLoginService.putUser(user, Credential.getCredential(password), new String[] {"user"});
+ final HashLoginService hashLoginService = new HashLoginService();
+ final UserStore userStore = new UserStore();
+ userStore.addUser(user, Credential.getCredential(password), new String[] {"user"});
+ hashLoginService.setUserStore(userStore);
hashLoginService.setName(this.connector.getName() + "-login-service");
Constraint constraint = new Constraint();