From 6309ef454e6960d95d13534645e1f15904de6862 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Tue, 3 Sep 2019 12:31:32 -0500 Subject: Update Fixes from testing Issue-ID: AAF-961 Change-Id: I142e460607bf32a785037fa2360b1c0efc3948b1 Signed-off-by: Instrumental --- .../src/main/java/org/onap/aaf/auth/service/api/API_Perms.java | 6 ++++-- .../src/main/java/org/onap/aaf/auth/service/api/API_Roles.java | 5 ++++- .../src/main/java/org/onap/aaf/auth/service/api/API_User.java | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'auth/auth-service/src/main/java') diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Perms.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Perms.java index ae94553c..04654d47 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Perms.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Perms.java @@ -232,8 +232,10 @@ public class API_Perms { HttpServletRequest req, HttpServletResponse resp) throws Exception { - Result r = context.renamePerm(trans, req, resp, pathParam(req, "type"), - pathParam(req, "instance"), pathParam(req, "action")); + Result r = context.renamePerm(trans, req, resp, + pathParam(req, "type"), + URLDecoder.decode(pathParam(req, "instance"),Config.UTF_8), + pathParam(req, "action")); switch(r.status) { case OK: resp.setStatus(HttpStatus.OK_200); diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Roles.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Roles.java index 2c93bc38..6088dd36 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Roles.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_Roles.java @@ -27,6 +27,8 @@ import static org.onap.aaf.auth.rserv.HttpMethods.GET; import static org.onap.aaf.auth.rserv.HttpMethods.POST; import static org.onap.aaf.auth.rserv.HttpMethods.PUT; +import java.net.URLDecoder; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -38,6 +40,7 @@ import org.onap.aaf.auth.service.AAF_Service; import org.onap.aaf.auth.service.Code; import org.onap.aaf.auth.service.facade.AuthzFacade; import org.onap.aaf.auth.service.mapper.Mapper.API; +import org.onap.aaf.cadi.config.Config; public class API_Roles { public static void init(AAF_Service authzAPI, AuthzFacade facade) throws Exception { @@ -231,7 +234,7 @@ public class API_Roles { Result r = context.getRolesByPerm(trans, resp, pathParam(req, "type"), - pathParam(req, "instance"), + URLDecoder.decode(pathParam(req, "instance"),Config.UTF_8), pathParam(req, "action")); switch(r.status) { case OK: diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_User.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_User.java index 0ce1dfe2..d5ce00c3 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_User.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_User.java @@ -24,6 +24,8 @@ package org.onap.aaf.auth.service.api; import static org.onap.aaf.auth.layer.Result.OK; import static org.onap.aaf.auth.rserv.HttpMethods.GET; +import java.net.URLDecoder; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -34,6 +36,7 @@ import org.onap.aaf.auth.service.AAF_Service; import org.onap.aaf.auth.service.Code; import org.onap.aaf.auth.service.facade.AuthzFacade; import org.onap.aaf.auth.service.mapper.Mapper.API; +import org.onap.aaf.cadi.config.Config; /** * User Role APIs @@ -61,7 +64,7 @@ public class API_User { // Result r = context.getUsersByPermission(trans, resp, pathParam(req, ":type"), - pathParam(req, ":instance"), + URLDecoder.decode(pathParam(req, ":instance"),Config.UTF_8), pathParam(req, ":action")); switch(r.status) { case OK: -- cgit 1.2.3-korg