Fix Version Mismatch 23/69523/1
authorInstrumental <jonathan.gathman@att.com>
Fri, 28 Sep 2018 19:31:39 +0000 (14:31 -0500)
committerInstrumental <jonathan.gathman@att.com>
Fri, 28 Sep 2018 19:32:33 +0000 (14:32 -0500)
This showed up in Password Management calling Service

Issue-ID: AAF-523
Change-Id: Ib8c4205b82ec9e9984d63c469319fa69b8505e9e
Signed-off-by: Instrumental <jonathan.gathman@att.com>
auth/.gitignore
auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/JU_AAFCli.java
auth/auth-service/src/main/java/org/onap/aaf/auth/service/AAF_Service.java
auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Creds.java
cadi/servlet-sample/src/test/java/org/onap/aaf/sample/cadi/MyServlet.java

index 5833316..943f63b 100644 (file)
@@ -4,3 +4,4 @@
 /aaf_*
 /deploy.gz
 /createLocalDeploy.sh
+/helm
index 7316a55..0120fa7 100644 (file)
@@ -193,7 +193,7 @@ public class JU_AAFCli {
         Locator loc;
         loc = new PropertyLocator(aafUrl);
         TIMEOUT = Integer.parseInt(env.getProperty(Config.AAF_CONN_TIMEOUT, Config.AAF_CONN_TIMEOUT_DEF));
-        HMangr hman = new HMangr(env, loc).readTimeout(TIMEOUT).apiVersion("2.0");
+        HMangr hman = new HMangr(env, loc).readTimeout(TIMEOUT).apiVersion(Config.AAF_DEFAULT_VERSION);
 
         // TODO: Consider requiring a default in properties
         env.setProperty(Config.AAF_DEFAULT_REALM,
index 4a59265..5253513 100644 (file)
@@ -209,14 +209,13 @@ public class AAF_Service extends AbsService<AuthzEnv,AuthzTrans> {
      * 
      */
     public void route(HttpMethods meth, String path, API api, Code code) throws Exception {
-        String version = "2.0";
         Class<?> respCls = facade.mapper().getClass(api); 
         if (respCls==null) throw new Exception("Unknown class associated with " + api.getClass().getName() + ' ' + api.name());
-        String application = applicationJSON(respCls, version);
+        String application = applicationJSON(respCls, Config.AAF_DEFAULT_VERSION);
 
-        route(env,meth,path,code,application,"application/json;version=2.0","*/*");
-        application = applicationXML(respCls, version);
-        route(env,meth,path,code.clone(facade_XML,false),application,"text/xml;version=2.0");
+        route(env,meth,path,code,application,"application/json;version="+Config.AAF_DEFAULT_VERSION,"*/*");
+        application = applicationXML(respCls, Config.AAF_DEFAULT_VERSION);
+        route(env,meth,path,code.clone(facade_XML,false),application,"text/xml;version=Config.AAF_DEFAULT_VERSION");
     }
 
     /**
index a8830c9..964a052 100644 (file)
@@ -194,7 +194,8 @@ public class API_Creds {
          */
         authzAPI.route(POST,"/authn/cred",API.CRED_REQ,new Code(facade,"Add a New ID/Credential", true) {
             @Override
-            public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {                Result<Void> r = context.createUserCred(trans, req);
+            public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {                
+               Result<Void> r = context.createUserCred(trans, req);
                 if (r.isOK()) {
                     resp.setStatus(HttpStatus.CREATED_201);
                 } else {
index e334291..7d1eae9 100644 (file)
@@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.onap.aaf.cadi.aaf.v2_0.AAFCon;
 import org.onap.aaf.cadi.client.Future;
+import org.onap.aaf.cadi.config.Config;
 import org.onap.aaf.cadi.principal.TaggedPrincipal;
 
 // Uncomment if you utilized the "MiniJASPIWrap" in the Servlet setup in "main()", and want to protect your service via Permission or mapped role
@@ -99,8 +100,8 @@ import org.onap.aaf.cadi.principal.TaggedPrincipal;
                         };
                     }
                     // This call will be "as the user calling", but only if permission is set to trust.
-//                    Future<String> future = aafcon.clientAs("2.0",tp).read("/authz/perms/user/"+request.getUserPrincipal().getName(),"application/Perms+json");
-                    Future<String> future = aafcon.client("2.0").read("/authz/perms/user/"+request.getUserPrincipal().getName(),"application/Perms+json");
+//                    Future<String> future = aafcon.clientAs(Config.AAF_DEFAULT_VERSION,tp).read("/authz/perms/user/"+request.getUserPrincipal().getName(),"application/Perms+json");
+                    Future<String> future = aafcon.client(Config.AAF_DEFAULT_VERSION).read("/authz/perms/user/"+request.getUserPrincipal().getName(),"application/Perms+json");
                     if (future.get(4000 /* timeout */)) {
                         res.getOutputStream().print(future.value);
                     } else {