summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>2018-05-11 16:08:49 -0400
committerKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>2018-05-11 16:08:49 -0400
commitfe25bf3a040455e931a9f5f61ff913ce78db1d69 (patch)
tree9dfb588a81ef680bc5e1259d7cd22373a165df15
parentcdd352a26a927955767e7811f9c254a5d3c8a06d (diff)
Fixes in SDK AAF JAR
Issue-ID: PORTAL-281 Portal SDK AAF jar throws null pointer exception Change-Id: Icdbd5a254221994a921fd9b58e8ca6786956273d Signed-off-by: Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
-rw-r--r--ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java2
-rw-r--r--ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java46
-rw-r--r--ecomp-sdk/epsdk-app-os/README.md1
3 files changed, 28 insertions, 21 deletions
diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java
index d2ccfc2e..063c207f 100644
--- a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java
+++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java
@@ -59,6 +59,7 @@ import org.onap.portalsdk.core.web.support.AppUtils;
import org.onap.portalsdk.core.web.support.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
@Service("loginExternalAuthService")
public class LoginExternalAuthServiceImpl implements LoginExternalAuthService {
@@ -79,6 +80,7 @@ public class LoginExternalAuthServiceImpl implements LoginExternalAuthService {
@Override
@SuppressWarnings("rawtypes")
+ @Transactional
public LoginBean findUser(LoginBean bean, String menuPropertiesFilename, Map additionalParams,
boolean matchPassword, HttpServletRequest request) throws Exception {
diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java
index 8425f7da..32a7421f 100644
--- a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java
+++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java
@@ -71,6 +71,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -103,6 +104,7 @@ public class UserApiServiceImpl implements UserApiService {
private AppService appService;
@Override
+ @Transactional
public User getUser(String orgUserId, HttpServletRequest request)
throws UserNotFoundException {
User user = null;
@@ -207,28 +209,30 @@ public class UserApiServiceImpl implements UserApiService {
role.setPriority(Integer.valueOf(roleDesc.getPriority()));
}
}
- for (ExternalAccessPerms extPerm : roleDesc.getPermissions()) {
- RoleFunction roleFunction = new RoleFunction();
- roleFunction.setCode(extPerm.getInstance());
- roleFunction.setAction(extPerm.getAction());
- if (extPerm.getDescription() != null
- && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
- roleFunction.setName(extPerm.getDescription());
- } else if (extPerm.getDescription() == null
- && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
- roleFunction.setName(extPerm.getType().substring(namespace.length() + 1) + "|"
- + extPerm.getInstance() + "|" + extPerm.getAction());
- } else if (extPerm.getDescription() == null
- && !EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
- roleFunction.setName(
- extPerm.getType() + "|" + extPerm.getInstance() + "|" + extPerm.getAction());
+ if (roleDesc.getPermissions() != null) {
+ for (ExternalAccessPerms extPerm : roleDesc.getPermissions()) {
+ RoleFunction roleFunction = new RoleFunction();
+ roleFunction.setCode(extPerm.getInstance());
+ roleFunction.setAction(extPerm.getAction());
+ if (extPerm.getDescription() != null
+ && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
+ roleFunction.setName(extPerm.getDescription());
+ } else if (extPerm.getDescription() == null
+ && EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
+ roleFunction.setName(extPerm.getType().substring(namespace.length() + 1) + "|"
+ + extPerm.getInstance() + "|" + extPerm.getAction());
+ } else if (extPerm.getDescription() == null
+ && !EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
+ roleFunction.setName(
+ extPerm.getType() + "|" + extPerm.getInstance() + "|" + extPerm.getAction());
+ }
+ if (EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
+ roleFunction.setType(extPerm.getType().substring(namespace.length() + 1));
+ } else {
+ roleFunction.setType(extPerm.getType());
+ }
+ roleFunctions.add(roleFunction);
}
- if (EcompExternalAuthUtils.checkNameSpaceMatching(extPerm.getType(), namespace)) {
- roleFunction.setType(extPerm.getType().substring(namespace.length() + 1));
- } else {
- roleFunction.setType(extPerm.getType());
- }
- roleFunctions.add(roleFunction);
}
}
role.setRoleFunctions(roleFunctions);
diff --git a/ecomp-sdk/epsdk-app-os/README.md b/ecomp-sdk/epsdk-app-os/README.md
index c61ebe63..675919bb 100644
--- a/ecomp-sdk/epsdk-app-os/README.md
+++ b/ecomp-sdk/epsdk-app-os/README.md
@@ -14,6 +14,7 @@ https://www.eclipse.org/m2e-wtp/
## Release Notes
Version 2.3.0
- PORTAL 254 ECOMP AAF jar
+- PORTAL-281 Portal SDK AAF jar throws null pointer exception
Version 2.2.0
- PORTAL 136 Junits for SDK