X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdmf%2Fmr%2Fservice%2Fimpl%2FEventsServiceImpl.java;h=5ce45acd90a284d8417eda64a9200d9bdfb8aa73;hb=b038e510e2389da1f09b1bc3db973c12a62aee9e;hp=2f436eca764ce16b64cc3f4af2f8993ff61558ad;hpb=fb6f2dd03e0c2e170ca47c4e67d8b098fc18358c;p=dmaap%2Fmessagerouter%2Fmsgrtr.git 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();