summaryrefslogtreecommitdiffstats
path: root/auth/auth-locate/src
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-07-19 13:29:32 -0500
committerInstrumental <jonathan.gathman@att.com>2018-07-19 13:29:44 -0500
commit32cdd553a8668e6d03a9cf5b11b360d35a63c87f (patch)
tree48c02e4be820d87efb777d7be20bad57d517b61c /auth/auth-locate/src
parent9c8a8b0926b13b07fb1e5394903401e7a3f1ff79 (diff)
Configuration and Auto-Certificates
Issue-ID: AAF-378 Change-Id: Ic820a4e43684a6130f00b28b415a974876099fc3 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-locate/src')
-rw-r--r--auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/api/API_AAFAccess.java12
-rw-r--r--auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/service/LocateServiceImpl.java4
2 files changed, 12 insertions, 4 deletions
diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/api/API_AAFAccess.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/api/API_AAFAccess.java
index af7611a3..802c1b55 100644
--- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/api/API_AAFAccess.java
+++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/api/API_AAFAccess.java
@@ -135,19 +135,27 @@ public class API_AAFAccess {
,"text/plain","*/*","*");
/**
- * Query User Has Perm
+ * Query User Has Perm is DEPRECATED
+ *
+ * Need to move towards NS declaration... is this even being used?
+ * @deprecated
*/
gwAPI.route(HttpMethods.GET,"/ask/:user/has/:type/:instance/:action",API.VOID,new LocateCode(facade,USER_HAS_PERM, true) {
@Override
public void handle(final AuthzTrans trans, final HttpServletRequest req, HttpServletResponse resp) throws Exception {
try {
+ String type = pathParam(req,":type");
+ int idx = type.lastIndexOf('.');
+ String ns = type.substring(0,idx);
+ type = type.substring(idx+1);
resp.getOutputStream().print(
gwAPI.aafLurPerm.fish(new Principal() {
public String getName() {
return pathParam(req,":user");
};
}, new AAFPermission(
- pathParam(req,":type"),
+ ns,
+ type,
pathParam(req,":instance"),
pathParam(req,":action"))));
resp.setStatus(HttpStatus.OK_200);
diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/service/LocateServiceImpl.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/service/LocateServiceImpl.java
index 595a6857..b2cdfab6 100644
--- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/service/LocateServiceImpl.java
+++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/service/LocateServiceImpl.java
@@ -75,7 +75,7 @@ public class LocateServiceImpl<IN,OUT,ERROR>
for(MgmtEndpoint me : meps.getMgmtEndpoint()) {
if(permToRegister) {
int dot = me.getName().lastIndexOf('.'); // Note: Validator checks for NS for getName()
- AAFPermission p = new AAFPermission(me.getName().substring(0,dot)+".locator",me.getName(),"write");
+ AAFPermission p = new AAFPermission(me.getName().substring(0,dot),"locator",me.getName(),"write");
if(trans.fish(p)) {
LocateDAO.Data data = mapper.locateData(me);
locateDAO.update(trans, data, true);
@@ -108,7 +108,7 @@ public class LocateServiceImpl<IN,OUT,ERROR>
int count = 0;
for(MgmtEndpoint me : meps.getMgmtEndpoint()) {
int dot = me.getName().lastIndexOf('.'); // Note: Validator checks for NS for getName()
- AAFPermission p = new AAFPermission(me.getName().substring(0,dot)+".locator",me.getHostname(),"write");
+ AAFPermission p = new AAFPermission(me.getName().substring(0,dot),"locator",me.getHostname(),"write");
if(trans.fish(p)) {
LocateDAO.Data data = mapper.locateData(me);
data.port_key = UUID.randomUUID();