diff --git a/NOTICE b/NOTICE index 386dd647922a81b929e446c46fb727ef1fb13656..edd5b9bdbb0d9e39612877ee5be9e547c829acd8 100644 --- a/NOTICE +++ b/NOTICE @@ -413,6 +413,7 @@ The following software have components provided under the terms of this license: - Guava: Google Core Libraries for Java (from http://code.google.com/p/guava-libraries, https://github.com/google/guava, https://repo1.maven.org/maven2/com/google/guava/guava) - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) +- Hibernate Validator (from https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator) - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) diff --git a/notification-core/pom.xml b/notification-core/pom.xml index 5950f33eadc8bc68ed6771c1e214f4d43b91b4e2..5ce4b99df0ebf167b6b7bd207e0cbd1bb9b43207 100644 --- a/notification-core/pom.xml +++ b/notification-core/pom.xml @@ -17,7 +17,6 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <artifactId>notification-core</artifactId> <name>notification-core</name> <description>Core module for the notification service</description> @@ -31,10 +30,6 @@ </parent> <properties> - <java.version>17</java.version> - <maven.compiler.target>${java.version}</maven.compiler.target> - <maven.compiler.source>${java.version}</maven.compiler.source> - <netty.version>4.1.70.Final</netty.version> <undertow.version>2.2.19.Final</undertow.version> <woodstox-core.version>5.3.0</woodstox-core.version> <log4j.version>2.17.1</log4j.version> diff --git a/pom.xml b/pom.xml index ada486812f525f7981c8e81c4c71cd70829e7532..9db092f8986ebe12c0a4a5c32a446974eddf723f 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,9 @@ <log4j2.version>2.17.1</log4j2.version> <json-smart.version>2.5.0</json-smart.version> <openapi.version>1.6.14</openapi.version> + <spring-webmvc.version>5.3.31</spring-webmvc.version> + <netty.version>4.1.106.Final</netty.version> + <snakeyaml-version>2.0</snakeyaml-version> </properties> <licenses> @@ -51,11 +54,11 @@ <scope>import</scope> </dependency> <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - <type>pom</type> - <scope>import</scope> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-dependencies</artifactId> + <version>2.7.17</version> + <type>pom</type> + <scope>import</scope> </dependency> <dependency> @@ -112,6 +115,12 @@ <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-ui</artifactId> <version>${openapi.version}</version> + <exclusions> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.springframework.plugin</groupId> diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml index 89275df71136fccad2743a019a813c89e18e7caa..7819cb2fd3d99ee716cccef332845c2f851106aa 100644 --- a/provider/notification-aws/pom.xml +++ b/provider/notification-aws/pom.xml @@ -31,9 +31,6 @@ </parent> <properties> - <java.version>17</java.version> - <maven.compiler.target>${java.version}</maven.compiler.target> - <maven.compiler.source>${java.version}</maven.compiler.source> <log4j2.version>2.17.1</log4j2.version> <jackson-databind.version>2.13.4.2</jackson-databind.version> <jackson.version>2.13.4</jackson.version> @@ -72,6 +69,16 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> + <exclusions> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + </exclusion> + </exclusions> <version>0.25.0-rc3</version> </dependency> <dependency> @@ -91,11 +98,6 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - </dependency> - <!-- unit test dependencies --> <dependency> <groupId>org.mockito</groupId> diff --git a/provider/notification-azure/pom.xml b/provider/notification-azure/pom.xml index 970ab2f27bb8ca88c0a0e6bef56758fcf6ffaca4..26cec8a66cb7b3d4f2c3e5e883dd9744838ee154 100644 --- a/provider/notification-azure/pom.xml +++ b/provider/notification-azure/pom.xml @@ -30,9 +30,6 @@ </parent> <properties> - <java.version>17</java.version> - <maven.compiler.target>${java.version}</maven.compiler.target> - <maven.compiler.source>${java.version}</maven.compiler.source> <jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version> <osdu.notification-core.version>0.26.0-SNAPSHOT</osdu.notification-core.version> <springframework.version>4.3.0.RELEASE</springframework.version> @@ -47,12 +44,9 @@ <reactor-netty.version>1.1.14</reactor-netty.version> <oauth2-oidc-sdk.version>6.0</oauth2-oidc-sdk.version> <woodstox-core.version>5.4.0</woodstox-core.version> - <spring-webmvc.version>5.3.22</spring-webmvc.version> <undertow.version>2.2.26.Final</undertow.version> <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> <xnio-api.version>3.8.8.Final</xnio-api.version> - <netty.version>4.1.101.Final</netty.version> - <snakeyaml-version>2.0</snakeyaml-version> </properties> <dependencyManagement> @@ -193,6 +187,7 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> + <version>${spring-webmvc.version}</version> </dependency> <dependency> diff --git a/provider/notification-gc/pom.xml b/provider/notification-gc/pom.xml index 5db03544771ac599bff920c3a047c32d0609860d..273626d8dc88fbb8dece396b7c57ac7374882c11 100644 --- a/provider/notification-gc/pom.xml +++ b/provider/notification-gc/pom.xml @@ -29,9 +29,6 @@ </parent> <properties> - <java.version>17</java.version> - <maven.compiler.target>${java.version}</maven.compiler.target> - <maven.compiler.source>${java.version}</maven.compiler.source> <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> </properties> @@ -62,6 +59,12 @@ <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-gc</artifactId> <version>0.24.0</version> + <exclusions> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -77,6 +80,10 @@ <groupId>com.google.oauth-client</groupId> <artifactId>google-oauth-client</artifactId> </exclusion> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> </exclusions> </dependency> @@ -116,6 +123,12 @@ <artifactId>oqm</artifactId> <version>0.24.0</version> </dependency> + + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + <version>${snakeyaml-version}</version> + </dependency> </dependencies> <build> diff --git a/provider/notification-ibm/pom.xml b/provider/notification-ibm/pom.xml index 1f18aade0a12d9ff8aaa26ae45113ae2467896f9..40e4af9896b94cf0786a05828290afae4673d038 100644 --- a/provider/notification-ibm/pom.xml +++ b/provider/notification-ibm/pom.xml @@ -102,7 +102,7 @@ <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> - <version>1.33</version> + <version>${snakeyaml-version}</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> diff --git a/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/PubsubEndpointHMACDescriptor.java b/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/PubsubEndpointHMACDescriptor.java new file mode 100644 index 0000000000000000000000000000000000000000..268fcc651b8f07f65d3fb4019c78977f6f91731c --- /dev/null +++ b/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/PubsubEndpointHMACDescriptor.java @@ -0,0 +1,51 @@ +package org.opengroup.osdu.notification.api; + +import org.opengroup.osdu.notification.util.Config; +import org.opengroup.osdu.notification.util.RestDescriptor; +import org.opengroup.osdu.notification.util.TestUtils; + +import java.util.HashMap; +import java.util.Map; + +public class PubsubEndpointHMACDescriptor extends RestDescriptor{ + + @Override + public String getPath() { + return "push-handlers/records-changed"; + } + + @Override + public String getHttpMethod() { + return "POST"; + } + + @Override + public String getValidBody() { + return "{\n" + + "\t\"Type\": \"Notification\",\n" + + "\t\"message\": {\n" + + "\t\"attributes\": {\n" + + "\t\"correlation-id\": \"39137f49-67d6-4001-a6aa-15521ef4f49e\",\n" + + "\t\"data-partition-id\": \"" + TestUtils.getOsduTenant() + "\"\n" + + "\t},\n" + + "\t\"data\": \"W3sia2luZCI6InRlc3RraW5kIiwiaWQiOiJ0ZXN0aWQiLCJvcGVyYXRpb250eXBlIjoiY3JlYXRlIn0seyJraW5kIjoidGVzdGtpbmQyIiwiaWQiOiJ0ZXN0aWQyIiwib3BlcmF0aW9udHlwZSI6InVwZGF0ZSJ9XQ\",\n" + + "\t\"messageId\": \"136969346945\"\n" + + "\t},\n" + + "\t\"subscription\": \""+ arg() +"\"\n" + + "}\n"; + } + + @Override + public Map<String,String> getOsduTenantHeaders(){ + Map<String, String> headers = new HashMap<>(); + headers.put("data-partition-id", Config.Instance().OsduTenant); + return headers; + } + + @Override + public Map<String,String> getCustomerTenantHeaders(){ + Map<String, String> headers = new HashMap<>(); + headers.put("data-partition-id", Config.Instance().ClientTenant); + return headers; + } +} diff --git a/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java b/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java index cac092dbefe95654bd8183edc6a5a996c2522d82..6644148731a40c6000aa11d7385676ea4177abf1 100644 --- a/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java +++ b/testing/notification-test-ibm/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java @@ -8,15 +8,22 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; +import org.opengroup.osdu.core.common.notification.SubscriptionAPIConfig; +import org.opengroup.osdu.core.common.notification.SubscriptionFactory; +import org.opengroup.osdu.notification.util.Config; import org.opengroup.osdu.notification.util.IBMTestUtils; import com.sun.jersey.api.client.ClientResponse; public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests { - + private static SubscriptionFactory factory; @BeforeClass public static void classSetup() throws Exception { - PubsubEndpointHMACTests.classSetup(); + descriptor = new PubsubEndpointHMACDescriptor(); + //Configure Register Service Client Library + SubscriptionAPIConfig config = SubscriptionAPIConfig.builder().rootUrl(Config.Instance().RegisterServicePath).build(); + config.setApiKey("apiKey"); + factory = new SubscriptionFactory(config); } @AfterClass @@ -36,6 +43,8 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests { } @Override + @Test + @Ignore public void should_return400_when_makingHttpRequestWithoutToken()throws Exception{ ClientResponse response = descriptor.run(getArg(), ""); assertEquals(error( response.getEntity(String.class)), 403, response.getStatus());