summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordglFromAtt <dgl@research.att.com>2018-08-24 14:04:02 -0400
committerdglFromAtt <dgl@research.att.com>2018-08-24 14:07:23 -0400
commit9a73b27ac2fa5edc9cadf15c6af7262866c5312c (patch)
treedc660498b99996d4b0638d4dee8b63229848e7a5
parent4a0a3c6f656d35483b4918b6041ea0aea48f4e32 (diff)
Only create AAF Perm when needed
-patchset 2: increment version Change-Id: Ib2f61ed903b95e4c218aaae0850d86f6f30c31af Signed-off-by: dglFromAtt <dgl@research.att.com> Issue-ID: DMAAP-647 Signed-off-by: dglFromAtt <dgl@research.att.com>
-rw-r--r--pom.xml2
-rw-r--r--src/main/java/org/onap/dmaap/dbcapi/server/Main.java4
-rw-r--r--src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java15
-rw-r--r--version.properties2
4 files changed, 16 insertions, 7 deletions
diff --git a/pom.xml b/pom.xml
index 4853b5c..bacee33 100644
--- a/pom.xml
+++ b/pom.xml
@@ -350,7 +350,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jettyVersion>9.3.9.v20160517</jettyVersion>
<eelf.version>0.0.1</eelf.version>
- <artifact.version>1.0.12-SNAPSHOT</artifact.version>
+ <artifact.version>1.0.13-SNAPSHOT</artifact.version>
<!-- SONAR -->
<jacoco.version>0.7.7.201606060606</jacoco.version>
<sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
diff --git a/src/main/java/org/onap/dmaap/dbcapi/server/Main.java b/src/main/java/org/onap/dmaap/dbcapi/server/Main.java
index c3340e6..d8ee278 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/server/Main.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/server/Main.java
@@ -24,6 +24,7 @@ import java.util.Properties;
import java.util.UUID;
import org.onap.dmaap.dbcapi.authentication.ApiPerms;
+import org.onap.dmaap.dbcapi.authentication.ApiPolicy;
import org.onap.dmaap.dbcapi.database.DatabaseClass;
import org.onap.dmaap.dbcapi.logging.*;
import org.onap.dmaap.dbcapi.model.Dmaap;
@@ -97,7 +98,8 @@ public class Main extends BaseLoggingClass {
// for fresh installs, we may come up with no dmaap name so need to have a way for Controller to talk to us
Singleton<Dmaap> dmaapholder = DatabaseClass.getDmaap();
String name = dmaapholder.get().getDmaapName();
- if ( name == null || name.isEmpty()) {
+ ApiPolicy apiPolicy = new ApiPolicy();
+ if ( apiPolicy.getUseAuthClass() && (name == null || name.isEmpty())) {
ApiPerms p = new ApiPerms();
p.setBootMap();
}
diff --git a/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java b/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
index e7d4e04..de87b00 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/service/DmaapService.java
@@ -36,6 +36,7 @@ import org.onap.dmaap.dbcapi.aaf.DmaapGrant;
import org.onap.dmaap.dbcapi.aaf.DmaapPerm;
import org.onap.dmaap.dbcapi.aaf.AafService.ServiceType;
import org.onap.dmaap.dbcapi.authentication.ApiPerms;
+import org.onap.dmaap.dbcapi.authentication.ApiPolicy;
import org.onap.dmaap.dbcapi.database.DatabaseClass;
import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
import org.onap.dmaap.dbcapi.logging.DmaapbcLogMessageEnum;
@@ -83,8 +84,11 @@ public class DmaapService extends BaseLoggingClass {
dmaapholder.update(nd);
AafService aaf = new AafService( ServiceType.AAF_Admin);
- ApiPerms p = new ApiPerms();
- p.setEnvMap();
+ ApiPolicy apiPolicy = new ApiPolicy();
+ if ( apiPolicy.getUseAuthClass() ) {
+ ApiPerms p = new ApiPerms();
+ p.setEnvMap();
+ }
boolean anythingWrong = false;
if ( multiSite ) {
@@ -122,8 +126,11 @@ public class DmaapService extends BaseLoggingClass {
if ( ! dmaap.isStatusValid() || ! nd.getDmaapName().equals(dmaap.getDmaapName()) || dmaap.getVersion().equals( "0") ) {
nd.setLastMod();
dmaapholder.update(nd); //need to set this so the following perms will pick up any new vals.
- ApiPerms p = new ApiPerms();
- p.setEnvMap();
+ ApiPolicy apiPolicy = new ApiPolicy();
+ if ( apiPolicy.getUseAuthClass()) {
+ ApiPerms p = new ApiPerms();
+ p.setEnvMap();
+ }
AafService aaf = new AafService( ServiceType.AAF_Admin);
if ( multiSite ) {
anythingWrong = setTopicMgtPerms( nd, aaf ) || createMmaTopic();
diff --git a/version.properties b/version.properties
index ec95b11..3ed3b8f 100644
--- a/version.properties
+++ b/version.properties
@@ -27,7 +27,7 @@
major=1
minor=0
-patch=12
+patch=13
base_version=${major}.${minor}.${patch}
# Release must be completed with git revision # in Jenkins