summaryrefslogtreecommitdiffstats
path: root/auth/auth-certman/src
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-certman/src')
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java7
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java3
-rw-r--r--auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Artifact.java3
-rw-r--r--auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Cert.java3
4 files changed, 9 insertions, 7 deletions
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
index 3727e34d..7dea9f07 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java
@@ -244,11 +244,10 @@ public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
try {
Log4JLogIt logIt = new Log4JLogIt(args, "cm");
PropAccess propAccess = new PropAccess(logIt,args);
-
try {
- AAF_CM service = new AAF_CM(new AuthzEnv(propAccess));
- JettyServiceStarter<AuthzEnv,AuthzTrans> jss = new JettyServiceStarter<AuthzEnv,AuthzTrans>(service);
- jss.start();
+ new JettyServiceStarter<AuthzEnv,AuthzTrans>(
+ new AAF_CM(new AuthzEnv(propAccess)),true)
+ .start();
} catch (Exception e) {
propAccess.log(e);
}
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
index 18f062d5..1f2ee645 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
@@ -193,7 +193,8 @@ public class CMService {
} else if (primary == null) {
return Result.err(Result.ERR_Denied, "Request not made from matching IP (%s)", trans.ip());
} else {
- host = primary.getHostAddress();
+ String thost = primary.getHostName();
+ host = thost==null?primary.getHostAddress():thost;
}
ArtiDAO.Data add = null;
diff --git a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Artifact.java b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Artifact.java
index ab10e66b..4ef85aa2 100644
--- a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Artifact.java
+++ b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Artifact.java
@@ -59,8 +59,9 @@ public class JU_API_Artifact {
public static void setUp() {
AuthzTrans trans = mock(AuthzTrans.class);
req = mock(HttpServletRequest.class);
+ res = mock(HttpServletResponse.class);
trans.setProperty("testTag", "UserValue");
- trans.set(req);
+ trans.set(req,res);
}
@Rule
diff --git a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Cert.java b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Cert.java
index 49632975..674e4edf 100644
--- a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Cert.java
+++ b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/api/JU_API_Cert.java
@@ -59,8 +59,9 @@ public class JU_API_Cert {
public static void setUp() {
AuthzTrans trans = mock(AuthzTrans.class);
req = mock(HttpServletRequest.class);
+ res = mock(HttpServletResponse.class);
trans.setProperty("testTag", "UserValue");
- trans.set(req);
+ trans.set(req,res);
}
@Rule