diff options
author | varun gudisena <varuneshwar.gudisena@att.com> | 2019-04-11 16:26:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-11 16:26:45 +0000 |
commit | 905861aff9a9bc3c428688f69576f48ce0e08162 (patch) | |
tree | 440a9a0172b27a2622181daed45c43853d5973b4 /src/main | |
parent | d52bb5226c5b9d92f9af25fb1458fa0723152154 (diff) | |
parent | b038e510e2389da1f09b1bc3db973c12a62aee9e (diff) |
Merge "authorization check for auth topics"1.1.16
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java | 10 |
1 files changed, 9 insertions, 1 deletions
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(); |