From 0cb3bb0b0c99a70dd31995a7dc4d06b53f6e43d0 Mon Sep 17 00:00:00 2001 From: su622b Date: Thu, 8 Aug 2019 08:21:55 -0400 Subject: revert topic exist topic check while publishing Issue-ID: DMAAP-1247 Change-Id: Ie0d50a2cecbb0c0cb26305adfb52ac65b1c8c032 Signed-off-by: su622b --- pom.xml | 2 +- .../java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImpl.java | 4 +--- version.properties | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7b3e943..2428f29 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 4.0.0 org.onap.dmaap.messagerouter.msgrtr msgrtr - 1.1.18-SNAPSHOT + 1.1.19-SNAPSHOT jar dmaap-messagerouter-msgrtr Message Router - Restful interface built for kafka 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 ec5bfc0..f3b7e54 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 @@ -324,9 +324,7 @@ public class EventsServiceImpl implements EventsService { validateIpBlacklist(errRespProvider, ctx); final Topic metaTopic = ctx.getConfigReader().getfMetaBroker().getTopic(topic); - if (metaTopic == null) { - throw new CambriaApiException(errRespProvider.getTopicNotFoundError()); - } + final boolean isAAFTopic = authorizeClientWhenNeeded(ctx, metaTopic, topic, errRespProvider, PUBLISH_ACTION); diff --git a/version.properties b/version.properties index dba8f85..9ac4233 100644 --- a/version.properties +++ b/version.properties @@ -27,7 +27,7 @@ major=1 minor=1 -patch=18 +patch=19 base_version=${major}.${minor}.${patch} -- cgit 1.2.3-korg From d12b53a7c46a151fda402f0c25120b26eef77ea5 Mon Sep 17 00:00:00 2001 From: su622b Date: Thu, 8 Aug 2019 08:34:53 -0400 Subject: revert topic exist check while publishing Issue-ID: DMAAP-1247 Change-Id: I17a289cd520d9b78a6652e05147acb7ab714cb54 Signed-off-by: su622b --- .../onap/dmaap/dmf/mr/service/impl/EventsServiceImplTest.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/test/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImplTest.java b/src/test/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImplTest.java index 4abbe89..f9178e1 100644 --- a/src/test/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImplTest.java +++ b/src/test/java/org/onap/dmaap/dmf/mr/service/impl/EventsServiceImplTest.java @@ -402,16 +402,7 @@ public class EventsServiceImplTest { } - @Test - public void pushEvents_shouldFail_whenRequestedTopicDoesNotExist() throws Exception { - when(configurationReader.getfMetaBroker()).thenReturn(dmaapKafkaMetaBroker); - when(dmaapKafkaMetaBroker.getTopic("testTopic")).thenReturn(null); - - thrown.expect(CambriaApiException.class); - thrown.expectMessage(containsString(String.valueOf(HttpStatus.SC_NOT_FOUND))); - - eventsService.pushEvents(dMaapContext, "testTopic", iStream, "5", "13:00:00"); - } + @Test public void pushEvents_shouldFailDmaapAuthorization_whenTopicOwnerIsSet_andUserHasNoWritePermissionToTopic() -- cgit 1.2.3-korg