summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsunil.unnava <sunil.unnava@att.com>2019-04-11 12:13:15 -0400
committersunil.unnava <sunil.unnava@att.com>2019-04-11 12:13:55 -0400
commitb038e510e2389da1f09b1bc3db973c12a62aee9e (patch)
tree379f3b15aac1e3699c08668f2c0df31d7a610cd1
parent34615204bca86d54ebfbedb15e8976515688c56c (diff)
authorization check for auth topics
Issue-ID: DMAAP-1160 Change-Id: Icdbaefecf8f07a2b0ad3fcc9b243df1072dd8579 Signed-off-by: sunil.unnava <sunil.unnava@att.com>
-rw-r--r--pom.xml2
-rw-r--r--src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java10
-rw-r--r--version.properties2
3 files changed, 11 insertions, 3 deletions
diff --git a/pom.xml b/pom.xml
index cb47037..2a18ecc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.onap.dmaap.messagerouter.msgrtr</groupId>
<artifactId>msgrtr</artifactId>
- <version>1.1.15-SNAPSHOT</version>
+ <version>1.1.16-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dmaap-messagerouter-msgrtr</name>
<description>Message Router - Restful interface built for kafka</description>
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java b/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java
index 2f436ec..5ce45ac 100644
--- a/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java
+++ b/src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java
@@ -204,6 +204,14 @@ public class EventsServiceImpl implements EventsService {
"metrics.send.cambria.topic");
if (null == metricTopicname)
metricTopicname = "msgrtr.apinode.metrics.dmaap";
+
+ boolean topicNameEnforced = false;
+ String topicNameStd = null;
+ topicNameStd = com.att.ajsc.beans.PropertiesMapBean.getProperty(CambriaConstants.msgRtr_prop,
+ "enforced.topic.name.AAF");
+ if (null != topicNameStd && topic.startsWith(topicNameStd)) {
+ topicNameEnforced = true;
+ }
if (null == ctx.getRequest().getHeader("Authorization") && !topic.equalsIgnoreCase(metricTopicname)) {
if (null != metatopic.getOwner() && !("".equals(metatopic.getOwner()))) {
@@ -212,7 +220,7 @@ public class EventsServiceImpl implements EventsService {
}
}
// if headers are not provided then user will be null
- if (user == null && null != ctx.getRequest().getHeader("Authorization")) {
+ if (topicNameEnforced&&user == null && null != ctx.getRequest().getHeader("Authorization")) {
// the topic name will be sent by the client
DMaaPAAFAuthenticator aaf = new DMaaPAAFAuthenticatorImpl();
diff --git a/version.properties b/version.properties
index aabaad9..2740ee4 100644
--- a/version.properties
+++ b/version.properties
@@ -27,7 +27,7 @@
major=1
minor=1
-patch=15
+patch=16
base_version=${major}.${minor}.${patch}