From 13f683c954a88f0f4de581a43217efdd8ecb9d09 Mon Sep 17 00:00:00 2001 From: Solomon Ayalew <solxget@amazon.com> Date: Tue, 19 Mar 2024 15:05:14 +0000 Subject: [PATCH] Upgrade service to spring 6 and Spring-boot 3 --- NOTICE | 116 ++++--- notification-core/pom.xml | 11 +- .../api/GlobalErrorController.java | 2 +- .../auth/AuthorizationFilter.java | 2 +- .../auth/EntitlementsClientFactory.java | 3 - .../di/CredentialHeadersProvider.java | 2 +- .../osdu/notification/di/RequestInfoExt.java | 6 +- .../errors/SpringExceptionMapper.java | 4 +- .../logging/ResponseLogFilter.java | 6 +- .../utils/NotificationFilter.java | 6 +- .../api/GlobalErrorControllerTest.java | 2 +- .../auth/AuthorizationFilterTest.java | 2 +- .../di/CredentialHeadersProviderTest.java | 2 +- .../notification/di/RequestInfoExtTest.java | 2 +- .../errors/SpringExceptionMapperTest.java | 4 +- .../logging/ResponseLogFilterTest.java | 10 +- .../utils/NotificationFilterTest.java | 12 +- pom.xml | 76 +++-- provider/notification-aws/pom.xml | 39 +-- .../impl/AwsPubsubRequestBodyExtractor.java | 2 +- .../impl/NotificationQueueServiceImpl.java | 2 +- .../provider/aws/security/KmsHelper.java | 2 +- .../aws/security/ThreadSignatureService.java | 2 +- .../AwsPubsubRequestBodyExtractorTest.java | 2 +- .../NotificationQueueServiceImplTest.java | 1 + .../NotificationRetryQueueServiceTest.java | 2 +- .../service/AwsNotificationHandlerTest.java | 1 - provider/notification-azure/pom.xml | 84 ++--- .../thread/ThreadSignatureService.java | 2 +- .../pubsub/EventGridRequestBodyExtractor.java | 2 +- .../security/AzureIstioSecurityConfig.java | 25 +- .../azure/util/AzureCosmosProperties.java | 2 +- .../azure/util/AzureKeyVaultProperties.java | 2 +- .../provider/azure/util/HandshakeFilter.java | 16 +- .../provider/azure/util/Slf4jMDCFilter.java | 10 +- .../EventGridRequestBodyExtractorTest.java | 6 +- .../azure/util/HandshakeFilterTest.java | 10 +- .../pubsub/EventGridHandshakeHandlerTest.java | 2 +- provider/notification-gc/pom.xml | 317 +++++++++--------- .../src/main/appengine/app.dev.yaml | 23 -- .../gcp/pubsub/MessageBrokerProvider.java | 2 +- .../gcp/pubsub/OqmSubscriberManager.java | 2 +- .../pubsub/PubsubRequestBodyExtractor.java | 2 +- .../provider/gcp/security/SecurityConfig.java | 45 +-- provider/notification-ibm/pom.xml | 75 ++--- .../pubsub/PubsubRequestBodyExtractor.java | 2 +- .../provider/ibm/security/SecurityConfig.java | 40 ++- testing/notification-test-aws/pom.xml | 4 +- 48 files changed, 449 insertions(+), 545 deletions(-) delete mode 100644 provider/notification-gc/src/main/appengine/app.dev.yaml diff --git a/NOTICE b/NOTICE index fa6a65505..c686adb60 100644 --- a/NOTICE +++ b/NOTICE @@ -15,15 +15,12 @@ Apache-1.1 ======================================================================== The following software have components provided under the terms of this license: -- Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version}) -- Apache Log4j JUL Adapter (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jul) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - Microsoft Application Insights Java Agent (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) - Proton-J (from https://repo1.maven.org/maven2/org/apache/qpid/proton-j) -- QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) ======================================================================== Apache-2.0 @@ -32,7 +29,6 @@ The following software have components provided under the terms of this license: - AMQP 1.0 JMS Spring Boot AutoConfiguration (from https://repo1.maven.org/maven2/org/amqphub/spring/amqp-10-jms-spring-boot-autoconfigure) - AMQP 1.0 JMS Spring Boot Starter (from https://repo1.maven.org/maven2/org/amqphub/spring/amqp-10-jms-spring-boot-starter) -- API Common (from https://github.com/googleapis, https://github.com/googleapis/api-common-java, https://repo1.maven.org/maven2/com/google/api/api-common) - ASM based accessors helper used by json-smart (from https://urielch.github.io/) - AWS Java SDK for AWS KMS (from https://aws.amazon.com/sdkforjava) - AWS Java SDK for AWS Lambda (from https://aws.amazon.com/sdkforjava) @@ -48,14 +44,12 @@ The following software have components provided under the terms of this license: - AWS SDK for Java - BOM (from https://aws.amazon.com/sdkforjava) - AWS SDK for Java - Core (from https://aws.amazon.com/sdkforjava) - Adapter: RxJava (from https://github.com/square/retrofit) -- Animal Sniffer Annotations (from https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations) - Apache Commons BeanUtils (from http://commons.apache.org/proper/commons-beanutils/, https://commons.apache.org/proper/commons-beanutils/, https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils) - Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/, https://commons.apache.org/proper/commons-codec/) - Apache Commons IO (from http://commons.apache.org/io/, https://commons.apache.org/proper/commons-io/, https://repo1.maven.org/maven2/commons-io/commons-io) - Apache Commons Lang (from https://commons.apache.org/proper/commons-lang/) - Apache Commons Logging (from http://commons.apache.org/logging/, http://commons.apache.org/proper/commons-logging/, https://commons.apache.org/proper/commons-logging/) - Apache Commons Validator (from http://commons.apache.org/proper/commons-validator/, http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/, https://repo1.maven.org/maven2/commons-validator/commons-validator) -- Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version}) - Apache Groovy (from http://groovy-lang.org, http://groovy.codehaus.org/, https://groovy-lang.org) - Apache HTTP transport v2 for the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-apache-v2) - Apache HttpClient (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga, https://repo1.maven.org/maven2/org/apache/httpcomponents/client5/httpclient5) @@ -72,23 +66,19 @@ The following software have components provided under the terms of this license: - Asynchronous Http Client (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client) - Asynchronous Http Client Netty Utils (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client-netty-utils) - AutoValue Annotations (from https://github.com/google/auto/tree/main/value, https://github.com/google/auto/tree/master/value, https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations) +- Awaitility (from http://awaitility.org) - BSON (from http://bsonspec.org, https://bsonspec.org) - BSON Record Codec (from <https://www.mongodb.com/>, https://www.mongodb.com/) - Bean Validation API (from http://beanvalidation.org) -- Brave (from https://repo1.maven.org/maven2/io/zipkin/brave/brave) -- Brave Instrumentation: Http Adapters (from https://repo1.maven.org/maven2/io/zipkin/brave/brave-instrumentation-http) -- Brave instrumentation for Reactor Netty HTTP (from https://github.com/reactor/reactor-netty) - Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy) - Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent) - ClassMate (from http://github.com/cowtowncoder/java-classmate) -- Cloud Key Management Service (KMS) API v1-rev20240131-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms) +- Cloud Key Management Service (KMS) API v1-rev20240219-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms) - Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections) - Commons Digester (from http://commons.apache.org/digester/) - Converter: Jackson (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson) - Core functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) -- GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) -- GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - GSON extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) - Google Cloud Core (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core, https://github.com/googleapis/java-core, https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core) @@ -102,7 +92,6 @@ The following software have components provided under the terms of this license: - Guava ListenableFuture only (from https://repo1.maven.org/maven2/com/google/guava/listenablefuture) - 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) - HTTP functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) -- 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) - Hop (from https://github.com/rabbitmq/hop, https://www.rabbitmq.com) - IBM COS Java SDK for Amazon S3 (from https://github.com/ibm/ibm-cos-sdk-java) @@ -134,6 +123,8 @@ The following software have components provided under the terms of this license: - Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding, https://github.com/FasterXML/jackson-dataformat-xml) - Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson, https://github.com/FasterXML/jackson-dataformats-text) - Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names) +- Jakarta Dependency Injection (from https://github.com/eclipse-ee4j/injection-api) +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Jakarta Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Jakarta Validation API (from https://beanvalidation.org) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) @@ -144,12 +135,6 @@ The following software have components provided under the terms of this license: - Javassist (from http://www.javassist.org/, https://www.javassist.org/) - JetBrains Java Annotations (from https://github.com/JetBrains/java-annotations) - Joda-Time (from http://joda-time.sourceforge.net, http://www.joda.org/joda-time/, https://www.joda.org/joda-time/) -- KeePassJava2 :: All (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2) -- KeePassJava2 :: DOM (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-dom) -- KeePassJava2 :: JAXB (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-jaxb) -- KeePassJava2 :: KDB (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-kdb) -- KeePassJava2 :: KDBX (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-kdbx) -- KeePassJava2 :: Simple (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-simple) - Kotlin Stdlib (from https://kotlinlang.org/, https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib) - Kotlin Stdlib Common (from https://kotlinlang.org/) - Kotlin Stdlib Jdk7 (from <https://kotlinlang.org/>, https://kotlinlang.org/) @@ -164,6 +149,7 @@ The following software have components provided under the terms of this license: - Microsoft Azure Java Core Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK for SQL API of Azure Cosmos DB Service (from https://github.com/Azure/azure-sdk-for-java) +- Microsoft Azure client library for Identity (from https://github.com/Azure/azure-sdk-for-java) - Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) - MongoDB Driver (from https://www.mongodb.com/) - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) @@ -181,6 +167,8 @@ The following software have components provided under the terms of this license: - Netty/Resolver (from https://repo1.maven.org/maven2/io/netty/netty-resolver) - Netty/Resolver/DNS (from https://repo1.maven.org/maven2/io/netty/netty-resolver-dns) - Netty/Resolver/DNS/Classes/MacOS (from https://repo1.maven.org/maven2/io/netty/netty-resolver-dns-classes-macos) +- Netty/TomcatNative [BoringSSL - Static] (from https://github.com/netty/netty-tcnative/netty-tcnative-boringssl-static/) +- Netty/TomcatNative [OpenSSL - Classes] (from https://repo1.maven.org/maven2/io/netty/netty-tcnative-classes) - Netty/Transport (from https://repo1.maven.org/maven2/io/netty/netty-transport) - Netty/Transport/Classes/Epoll (from https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll) - Netty/Transport/Classes/KQueue (from https://repo1.maven.org/maven2/io/netty/netty-transport-classes-kqueue) @@ -196,7 +184,6 @@ The following software have components provided under the terms of this license: - OkHttp URLConnection (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection, https://square.github.io/okhttp/) - Okio (from https://github.com/square/okio/, https://repo1.maven.org/maven2/com/squareup/okio/okio) - OpenCensus (from https://github.com/census-instrumentation/opencensus-java, https://github.com/census-instrumentation/opencensus-proto) -- PWDB :: Database (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/database) - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) - Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) - Prometheus Java Simpleclient Common (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_common>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_common) @@ -260,16 +247,10 @@ The following software have components provided under the terms of this license: - Undertow Core (from <https://repo1.maven.org/maven2/io/undertow/undertow-core>, https://repo1.maven.org/maven2/io/undertow/undertow-core) - Undertow Servlet (from <https://repo1.maven.org/maven2/io/undertow/undertow-servlet>, https://repo1.maven.org/maven2/io/undertow/undertow-servlet) - Undertow WebSockets JSR356 implementations (from <https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr>, https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr) -- Vavr (from http://vavr.io, https://www.vavr.io) -- Vavr Match (from http://vavr.io) - WildFly Client Configuration (from <https://repo1.maven.org/maven2/org/wildfly/client/wildfly-client-config>, https://repo1.maven.org/maven2/org/wildfly/client/wildfly-client-config) - Woodstox (from https://github.com/FasterXML/woodstox) - XNIO API (from <http://www.jboss.org/xnio>, http://www.jboss.org/xnio) - XNIO NIO Implementation (from <https://repo1.maven.org/maven2/org/jboss/xnio/xnio-nio>, https://repo1.maven.org/maven2/org/jboss/xnio/xnio-nio) -- Zipkin Reporter Brave (from https://repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter-brave) -- Zipkin Reporter: Core (from https://repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter) -- Zipkin v2 (from https://repo1.maven.org/maven2/io/zipkin/zipkin2/zipkin) -- aalto-xml (from https://github.com/FasterXML/aalto-xml, https://repo1.maven.org/maven2/com/fasterxml/aalto-xml) - error-prone annotations (from https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations) - io.grpc:grpc-alts (from https://github.com/grpc/grpc-java) - io.grpc:grpc-api (from https://github.com/grpc/grpc-java) @@ -292,7 +273,10 @@ The following software have components provided under the terms of this license: - jose4j (from https://bitbucket.org/b_c/jose4j/) - json-path (from http://code.google.com/p/json-path/, https://github.com/jayway/JsonPath) - lettuce (from http://github.com/mp911de/lettuce/wiki, https://github.com/lettuce-io/lettuce-core/wiki) +- micrometer-commons (from https://github.com/micrometer-metrics/micrometer) - micrometer-core (from https://github.com/micrometer-metrics/micrometer) +- micrometer-jakarta9 (from https://github.com/micrometer-metrics/micrometer) +- micrometer-observation (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-azure-monitor (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-prometheus (from <https://github.com/micrometer-metrics/micrometer>, https://github.com/micrometer-metrics/micrometer) - org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian) @@ -307,13 +291,16 @@ The following software have components provided under the terms of this license: - resilience4j (from https://github.com/resilience4j/resilience4j, https://resilience4j.readme.io, ttps://resilience4j.readme.io) - software.amazon.ion:ion-java (from https://github.com/amzn/ion-java/) - spring-boot-starter-undertow (from <https://spring.io/projects/spring-boot>, https://spring.io/projects/spring-boot) -- springdoc-openapi-common (from <https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common>, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common) -- springdoc-openapi-ui (from https://github.com/springdoc/springdoc-openapi, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-ui) -- springdoc-openapi-webmvc-core (from <https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-webmvc-core>, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-webmvc-core) +- springdoc-openapi-starter-common (from https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-starter-common) +- springdoc-openapi-starter-webmvc-api (from https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-starter-webmvc-api) +- springdoc-openapi-starter-webmvc-ui (from https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-starter-webmvc-ui) - swagger-annotations (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-annotations, https://repo1.maven.org/maven2/io/swagger/swagger-annotations) +- swagger-annotations-jakarta (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-annotations-jakarta) - swagger-core (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core, https://repo1.maven.org/maven2/io/swagger/swagger-core) +- swagger-core-jakarta (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core-jakarta) - swagger-jaxrs (from https://repo1.maven.org/maven2/io/swagger/swagger-jaxrs) - swagger-models (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-models, https://repo1.maven.org/maven2/io/swagger/swagger-models) +- swagger-models-jakarta (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-models-jakarta) - tomcat-embed-el (from http://tomcat.apache.org/, https://tomcat.apache.org/) - wildfly-common (from <https://repo1.maven.org/maven2/org/wildfly/common/wildfly-common>, https://repo1.maven.org/maven2/org/wildfly/common/wildfly-common) @@ -322,7 +309,10 @@ BSD-2-Clause ======================================================================== The following software have components provided under the terms of this license: +- API Common (from https://github.com/googleapis, https://github.com/googleapis/api-common-java, https://repo1.maven.org/maven2/com/google/api/api-common) - Apache Log4j Core (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core) +- GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) +- GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - Hamcrest (from http://hamcrest.org/JavaHamcrest/) - Hamcrest Core (from http://hamcrest.org/, http://hamcrest.org/JavaHamcrest/, https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core) - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) @@ -353,6 +343,9 @@ The following software have components provided under the terms of this license: - Jackson module: Afterburner (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-modules-base) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) +- Jakarta WebSocket - Client API (from https://projects.eclipse.org/projects/ee4j.websocket) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) @@ -388,6 +381,13 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) +======================================================================== +BouncyCastle +======================================================================== +The following software have components provided under the terms of this license: + +- Microsoft Azure client library for Identity (from https://github.com/Azure/azure-sdk-for-java) + ======================================================================== CC-BY-2.5 ======================================================================== @@ -415,7 +415,6 @@ The following software have components provided under the terms of this license: - 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) - Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) @@ -428,7 +427,6 @@ CDDL-1.0 The following software have components provided under the terms of this license: - Apache Log4j Core (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core) -- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) - JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) @@ -462,10 +460,6 @@ EPL-1.0 ======================================================================== The following software have components provided under the terms of this license: -- AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) -- JUnit Jupiter API (from http://junit.org/junit5/, https://junit.org/junit5/) -- JUnit Jupiter Engine (from http://junit.org/junit5/, https://junit.org/junit5/) -- JUnit Jupiter Params (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Vintage Engine (from http://junit.org/junit5/, https://junit.org/junit5/) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) - Java Servlet 4.0 API @@ -495,8 +489,11 @@ The following software have components provided under the terms of this license: - JUnit Vintage Engine (from http://junit.org/junit5/, https://junit.org/junit5/) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Jakarta Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Jakarta Validation API (from https://beanvalidation.org) +- Jakarta WebSocket - Client API (from https://projects.eclipse.org/projects/ee4j.websocket) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Java Servlet 4.0 API @@ -508,6 +505,9 @@ GPL-2.0-only The following software have components provided under the terms of this license: - JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) +- Jakarta WebSocket - Client API (from https://projects.eclipse.org/projects/ee4j.websocket) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) ======================================================================== @@ -519,8 +519,11 @@ The following software have components provided under the terms of this license: - JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Jakarta Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Jakarta Validation API (from https://beanvalidation.org) +- Jakarta WebSocket - Client API (from https://projects.eclipse.org/projects/ee4j.websocket) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) @@ -534,6 +537,7 @@ GPL-3.0-only ======================================================================== The following software have components provided under the terms of this license: +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) - Java Servlet 4.0 API ======================================================================== @@ -543,13 +547,6 @@ The following software have components provided under the terms of this license: - Spring Security - Core (from http://spring.io/spring-security, https://repo1.maven.org/maven2/org/springframework/security/spring-security-core, https://spring.io/projects/spring-security, https://spring.io/spring-security) -======================================================================== -ImageMagick -======================================================================== -The following software have components provided under the terms of this license: - -- aalto-xml (from https://github.com/FasterXML/aalto-xml, https://repo1.maven.org/maven2/com/fasterxml/aalto-xml) - ======================================================================== LGPL-2.1-only ======================================================================== @@ -582,8 +579,8 @@ The following software have components provided under the terms of this license: - AWS Java SDK for AWS Lambda (from https://aws.amazon.com/sdkforjava) - Animal Sniffer Annotations (from https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations) +- Apache HttpClient Cache (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga) - Apache Log4j API (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api) -- Apache Log4j SLF4J Binding (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-slf4j-impl) - Apache Log4j to SLF4J Adapter (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-to-slf4j) - Azure Java Client Authentication Library for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) - Azure Java Client Runtime for ARM (from https://github.com/Azure/autorest-clientruntime-for-java) @@ -591,7 +588,6 @@ The following software have components provided under the terms of this license: - Azure Spring Boot AutoConfigure (from https://github.com/Azure/azure-sdk-for-java, https://github.com/Microsoft/azure-spring-boot) - Azure Spring Boot Starter for Azure AD Spring Security Integration (from https://github.com/Azure/azure-sdk-for-java) - Checker Qual (from https://checkerframework.org) -- ClassGraph (from https://github.com/classgraph/classgraph) - JUL to SLF4J bridge (from http://www.slf4j.org) - Jackson-core (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-core) - Java Client Runtime for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) @@ -602,6 +598,7 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Azure Java Core Library (from https://github.com/Azure/azure-sdk-for-java) +- Microsoft Azure Java JSON Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK annotations (from https://github.com/Microsoft/java-api-annotations) - Microsoft Azure SDK for EventGrid Management (from https://github.com/Azure/azure-sdk-for-java) @@ -619,18 +616,19 @@ The following software have components provided under the terms of this license: - Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http) - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) - Project Lombok (from http://projectlombok.org, https://projectlombok.org) -- QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) - SLF4J API Module (from http://www.slf4j.org) -- Spongy Castle (from http://rtyley.github.io/spongycastle/) - Spring Data for Azure Cosmos DB SQL API (from https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos, https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-data-cosmos) +- System Stubs Core (from https://repo1.maven.org/maven2/uk/org/webcompere/system-stubs-core) +- System Stubs JUnit4 (from https://repo1.maven.org/maven2/uk/org/webcompere/system-stubs-junit4) +- ThreeTen backport (from https://github.com/ThreeTen/threetenbp, https://www.threeten.org/threetenbp) - adal4j (from https://github.com/AzureAD/azure-activedirectory-library-for-java) +- micrometer-commons (from https://github.com/micrometer-metrics/micrometer) - micrometer-core (from https://github.com/micrometer-metrics/micrometer) - mockito-inline (from http://mockito.org, https://github.com/mockito/mockito) - mockito-junit-jupiter (from https://github.com/mockito/mockito) - msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java) - msal4j-persistence-extension (from https://github.com/AzureAD/microsoft-authentication-extensions-for-java) - qpid-proton-j-extensions (from https://github.com/Azure/qpid-proton-j-extensions) -- webjars-locator-core (from <http://webjars.org>, http://webjars.org) ======================================================================== MPL-1.1 @@ -674,23 +672,43 @@ The following software have components provided under the terms of this license: - Netty/Codec (from https://repo1.maven.org/maven2/io/netty/netty-codec) +======================================================================== +efsl-1.0 +======================================================================== +The following software have components provided under the terms of this license: + +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) + ======================================================================== gpl-2.0-classpath ======================================================================== The following software have components provided under the terms of this license: - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Jakarta Validation API (from https://beanvalidation.org) +- Jakarta WebSocket - Client API (from https://projects.eclipse.org/projects/ee4j.websocket) +- Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) ======================================================================== public-domain ======================================================================== The following software have components provided under the terms of this license: -- Apache Groovy (from http://groovy-lang.org, http://groovy.codehaus.org/, https://groovy-lang.org) - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - JSON in Java (from https://github.com/douglascrockford/JSON-java) -- Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) - Undertow Core (from <https://repo1.maven.org/maven2/io/undertow/undertow-core>, https://repo1.maven.org/maven2/io/undertow/undertow-core) - Undertow WebSockets JSR356 implementations (from <https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr>, https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr) - XNIO API (from <http://www.jboss.org/xnio>, http://www.jboss.org/xnio) + +======================================================================== +unknown +======================================================================== +The following software have components provided under the terms of this license: + +- AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) +- JUnit Jupiter API (from http://junit.org/junit5/, https://junit.org/junit5/) +- JUnit Jupiter Engine (from http://junit.org/junit5/, https://junit.org/junit5/) +- JUnit Jupiter Params (from http://junit.org/junit5/, https://junit.org/junit5/) +- Jakarta WebSocket - Client API (from https://projects.eclipse.org/projects/ee4j.websocket) +- Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) diff --git a/notification-core/pom.xml b/notification-core/pom.xml index 5ce4b99df..8c58ea185 100644 --- a/notification-core/pom.xml +++ b/notification-core/pom.xml @@ -43,7 +43,7 @@ <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${os-core-common.version}</version> <type>pom</type> <scope>import</scope> @@ -64,7 +64,7 @@ <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> </dependency> <dependency> @@ -274,7 +274,14 @@ <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> </dependency> + <dependency> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <version>6.0.0</version> + <scope>provided</scope> + </dependency> </dependencies> + <build> <plugins> <plugin> diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java b/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java index ba530936f..9219e0578 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; @Hidden @RequestMapping("/error") diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/auth/AuthorizationFilter.java b/notification-core/src/main/java/org/opengroup/osdu/notification/auth/AuthorizationFilter.java index a69afee52..31ac34da9 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/auth/AuthorizationFilter.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/auth/AuthorizationFilter.java @@ -28,7 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.Arrays; @Component("authorizationFilter") diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/auth/EntitlementsClientFactory.java b/notification-core/src/main/java/org/opengroup/osdu/notification/auth/EntitlementsClientFactory.java index 6076dd1a5..f07b567b5 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/auth/EntitlementsClientFactory.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/auth/EntitlementsClientFactory.java @@ -22,12 +22,9 @@ import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; import org.opengroup.osdu.notification.provider.interfaces.IAppProperties; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.stereotype.Component; -import javax.inject.Inject; - @Component public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlementsFactory> { diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/di/CredentialHeadersProvider.java b/notification-core/src/main/java/org/opengroup/osdu/notification/di/CredentialHeadersProvider.java index 85dc9d1dc..231ceaaf7 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/di/CredentialHeadersProvider.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/di/CredentialHeadersProvider.java @@ -31,7 +31,7 @@ import org.opengroup.osdu.core.common.model.http.AppException; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.context.annotation.RequestScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; @Component @RequestScope diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/di/RequestInfoExt.java b/notification-core/src/main/java/org/opengroup/osdu/notification/di/RequestInfoExt.java index 7db3d5c59..3ae35d2ce 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/di/RequestInfoExt.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/di/RequestInfoExt.java @@ -24,9 +24,9 @@ import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.servlet.http.HttpServletRequest; +import jakarta.annotation.PostConstruct; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletRequest; import java.util.Collections; import java.util.Map; import java.util.stream.Collectors; diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/errors/SpringExceptionMapper.java b/notification-core/src/main/java/org/opengroup/osdu/notification/errors/SpringExceptionMapper.java index 81b31a786..f4a79ecaf 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/errors/SpringExceptionMapper.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/errors/SpringExceptionMapper.java @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import org.opengroup.osdu.core.common.model.http.AppException; -import javax.validation.ValidationException; +import jakarta.validation.ValidationException; import java.io.IOException; import java.nio.file.AccessDeniedException; import java.util.List; @@ -51,7 +51,7 @@ public class SpringExceptionMapper extends ResponseEntityExceptionHandler { return this.getErrorResponse(e); } - @Override +// @Override protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { List<String> errorList = ex diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/logging/ResponseLogFilter.java b/notification-core/src/main/java/org/opengroup/osdu/notification/logging/ResponseLogFilter.java index 69aad1171..bec48deb1 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/logging/ResponseLogFilter.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/logging/ResponseLogFilter.java @@ -26,9 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/utils/NotificationFilter.java b/notification-core/src/main/java/org/opengroup/osdu/notification/utils/NotificationFilter.java index 8c4ccf80d..6cb99acad 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/utils/NotificationFilter.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/utils/NotificationFilter.java @@ -20,9 +20,9 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.inject.Inject; -import javax.servlet.*; -import javax.servlet.http.HttpServletResponse; +import jakarta.inject.Inject; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java index bb90755de..d960546ec 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java @@ -22,7 +22,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnitRunner; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java index eb486ad35..01f449344 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/auth/AuthorizationFilterTest.java @@ -31,7 +31,7 @@ import org.opengroup.osdu.notification.provider.interfaces.IServiceAccountValida import org.opengroup.osdu.notification.utils.Config; import org.powermock.modules.junit4.PowerMockRunner; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/di/CredentialHeadersProviderTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/di/CredentialHeadersProviderTest.java index e7966e43b..7aaf6a944 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/di/CredentialHeadersProviderTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/di/CredentialHeadersProviderTest.java @@ -12,7 +12,7 @@ import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient; import org.opengroup.osdu.notification.provider.interfaces.IPubsubRequestBodyExtractor; import org.springframework.web.bind.annotation.RequestMethod; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/di/RequestInfoExtTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/di/RequestInfoExtTest.java index 16e3f8c80..dd155cb04 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/di/RequestInfoExtTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/di/RequestInfoExtTest.java @@ -28,7 +28,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.notification.provider.interfaces.IAppProperties; import org.opengroup.osdu.notification.provider.interfaces.IPubsubRequestBodyExtractor; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/errors/SpringExceptionMapperTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/errors/SpringExceptionMapperTest.java index 718055c61..cd9ba2778 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/errors/SpringExceptionMapperTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/errors/SpringExceptionMapperTest.java @@ -27,8 +27,8 @@ import org.opengroup.osdu.core.common.model.http.AppException; import org.springframework.http.ResponseEntity; import org.springframework.web.context.request.WebRequest; -import javax.servlet.http.HttpServletRequest; -import javax.xml.bind.ValidationException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.xml.bind.ValidationException; import java.io.IOException; import java.nio.file.AccessDeniedException; import java.util.Objects; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/logging/ResponseLogFilterTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/logging/ResponseLogFilterTest.java index 945ef7fda..5a06307a3 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/logging/ResponseLogFilterTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/logging/ResponseLogFilterTest.java @@ -27,11 +27,11 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.http.Request; import org.opengroup.osdu.notification.di.RequestInfoExt; -import javax.servlet.FilterChain; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import static org.mockito.ArgumentMatchers.any; diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/utils/NotificationFilterTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/utils/NotificationFilterTest.java index ae67d0617..de8799c0f 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/utils/NotificationFilterTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/utils/NotificationFilterTest.java @@ -24,12 +24,12 @@ import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; import org.opengroup.osdu.core.common.model.http.DpsHeaders; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import static org.junit.Assert.assertEquals; diff --git a/pom.xml b/pom.xml index 9db092f89..737a1810f 100644 --- a/pom.xml +++ b/pom.xml @@ -25,11 +25,11 @@ <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> - <os-core-common.version>0.25.0-rc2</os-core-common.version> + <os-core-common.version>0.26.0-rc2</os-core-common.version> <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> + <openapi.version>2.3.0</openapi.version> + <spring-webmvc.version>6.1.4</spring-webmvc.version> <netty.version>4.1.106.Final</netty.version> <snakeyaml-version>2.0</snakeyaml-version> </properties> @@ -56,20 +56,20 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> + <version>3.2.3</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${os-core-common.version}</version> </dependency> <!-- overriding packages with known vulnerabilities --> <!-- See: https://nvd.nist.gov/vuln/search/results?form_type=Advanced&results_type=overview&search_type=all&cpe_vendor=cpe%3A%2F%3Afasterxml&cpe_product=cpe%3A%2F%3Afasterxml%3Ajackson-databind&cpe_version=cpe%3A%2F%3Afasterxml%3Ajackson-databind%3A2.9.9--> - <dependency> + <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.14.1</version> @@ -110,35 +110,39 @@ <version>1.18.26</version> <scope>provided</scope> </dependency> - <!-- swagger dependency --> - <dependency> - <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> - <artifactId>spring-plugin-core</artifactId> - <version>2.0.0.RELEASE</version> - </dependency> - <dependency> - <groupId>org.springframework.plugin</groupId> - <artifactId>spring-plugin-metadata</artifactId> - <version>2.0.0.RELEASE</version> - <exclusions> - <exclusion> - <groupId>org.springframework.plugin</groupId> - <artifactId>spring-plugin-core</artifactId> - </exclusion> - </exclusions> - </dependency> - + <!-- swagger dependency --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${openapi.version}</version> + <exclusions> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.plugin</groupId> + <artifactId>spring-plugin-core</artifactId> + <version>3.0.0</version> + </dependency> + <dependency> + <groupId>org.springframework.plugin</groupId> + <artifactId>spring-plugin-metadata</artifactId> + <version>2.0.0.RELEASE</version> + <exclusions> + <exclusion> + <groupId>org.springframework.plugin</groupId> + <artifactId>spring-plugin-core</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> + <version>3.1.0</version> + </dependency> </dependencies> <modules> @@ -192,7 +196,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>3.2.3</version> <executions> <execution> <id>build-info</id> diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml index 934096055..843fd0f6a 100644 --- a/provider/notification-aws/pom.xml +++ b/provider/notification-aws/pom.xml @@ -31,28 +31,11 @@ </parent> <properties> - <log4j2.version>2.17.1</log4j2.version> - <jackson-databind.version>2.13.4.2</jackson-databind.version> - <jackson.version>2.13.4</jackson.version> - <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> + <spring-boot-maven-plugin.version>3.2.2</spring-boot-maven-plugin.version> </properties> <dependencyManagement> <dependencies> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${log4j2.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${log4j2.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb</artifactId> @@ -74,7 +57,7 @@ <artifactId>spring-beans</artifactId> </exclusion> </exclusions> - <version>0.26.0-rc2</version> + <version>0.26.0-spring6-rc1</version> </dependency> <dependency> <groupId>commons-io</groupId> @@ -107,6 +90,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-inline</artifactId> + <version>4.5.1</version> <scope>test</scope> </dependency> <dependency> @@ -115,23 +99,6 @@ <version>2.0.9</version> <scope>test</scope> </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>${jackson.version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>${jackson-databind.version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>${jackson.version}</version> - </dependency> - </dependencies> <build> diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsPubsubRequestBodyExtractor.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsPubsubRequestBodyExtractor.java index 240b7b40a..c1e518b00 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsPubsubRequestBodyExtractor.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/impl/AwsPubsubRequestBodyExtractor.java @@ -26,7 +26,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; import java.util.Base64; diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java index fe6ebfda4..81089907f 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java @@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Base64; diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/KmsHelper.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/KmsHelper.java index 141c29d90..f056ed413 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/KmsHelper.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/KmsHelper.java @@ -30,7 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.nio.ByteBuffer; import java.util.Collections; diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/ThreadSignatureService.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/ThreadSignatureService.java index e68d8917e..b42a55e74 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/ThreadSignatureService.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/security/ThreadSignatureService.java @@ -20,7 +20,7 @@ import java.util.Base64; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -import javax.xml.bind.DatatypeConverter; +import jakarta.xml.bind.DatatypeConverter; import org.apache.commons.lang3.StringUtils; import org.opengroup.osdu.core.common.cryptographic.HmacData; diff --git a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/AwsPubsubRequestBodyExtractorTest.java b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/AwsPubsubRequestBodyExtractorTest.java index b43a19ae2..0fe8c0d12 100644 --- a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/AwsPubsubRequestBodyExtractorTest.java +++ b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/AwsPubsubRequestBodyExtractorTest.java @@ -30,7 +30,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.notification.provider.aws.impl.AwsPubsubRequestBodyExtractor; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; diff --git a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImplTest.java b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImplTest.java index 585556bab..6e8ea4072 100644 --- a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImplTest.java +++ b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImplTest.java @@ -266,4 +266,5 @@ public class NotificationQueueServiceImplTest { private Message createMessage(String messageId, String dataPartitionId) { return createMessage(messageId, dataPartitionId, DEFAULT_MESSAGE_TOPIC); } + } diff --git a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceTest.java b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceTest.java index 7f976384f..839bee763 100644 --- a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceTest.java +++ b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceTest.java @@ -129,7 +129,7 @@ public class NotificationRetryQueueServiceTest { assertEquals(1, responseMessageList.size()); assertEquals(NotificationResult.NACK, responseMessageList.get(0).getResult()); } - + @Test public void processNotificationMessage_non200ResponseFromSubscriber_messageNotAcked() throws Exception { HttpResponse response = new HttpResponse(); diff --git a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/service/AwsNotificationHandlerTest.java b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/service/AwsNotificationHandlerTest.java index d7509e889..627e8cf2b 100644 --- a/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/service/AwsNotificationHandlerTest.java +++ b/provider/notification-aws/src/test/java/org/opengroup/osdu/notification/provider/aws/service/AwsNotificationHandlerTest.java @@ -109,5 +109,4 @@ public class AwsNotificationHandlerTest { HttpResponse response = notificationHandler.notifySubscriber(subscription, "testMessage", headerAttributes); assertEquals(500, response.getResponseCode()); } - } diff --git a/provider/notification-azure/pom.xml b/provider/notification-azure/pom.xml index fcfde1d9c..398e80420 100644 --- a/provider/notification-azure/pom.xml +++ b/provider/notification-azure/pom.xml @@ -35,18 +35,19 @@ <springframework.version>4.3.0.RELEASE</springframework.version> <reactor.netty.version>0.11.0.RELEASE</reactor.netty.version> <reactor.core.version>3.3.0.RELEASE</reactor.core.version> - <osdu.corelibazure.version>0.26.0-rc5</osdu.corelibazure.version> + <osdu.corelibazure.version>0.26.0-rc6</osdu.corelibazure.version> <junit.version>5.6.0</junit.version> <jjwt.version>3.8.1</jjwt.version> <mockito.version>2.23.0</mockito.version> - <spring-boot.version>2.7.7</spring-boot.version> - <reactor-core.version>3.4.6</reactor-core.version> - <reactor-netty.version>1.1.14</reactor-netty.version> - <oauth2-oidc-sdk.version>6.0</oauth2-oidc-sdk.version> + <spring-boot.version>3.2.3</spring-boot.version> + <reactor-core.version>3.6.2</reactor-core.version> + <reactor-netty.version>1.1.15</reactor-netty.version> + <oauth2-oidc-sdk.version>10.7.1</oauth2-oidc-sdk.version> <woodstox-core.version>5.4.0</woodstox-core.version> - <undertow.version>2.2.26.Final</undertow.version> - <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> + <undertow.version>2.3.12.Final</undertow.version> + <spring-boot-maven-plugin.version>3.2.3</spring-boot-maven-plugin.version> <xnio-api.version>3.8.8.Final</xnio-api.version> + <netty.version>4.1.101.Final</netty.version> </properties> <dependencyManagement> @@ -63,21 +64,21 @@ <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-bom</artifactId> - <version>5.7.11</version> + <version>6.2.2</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> + <version>3.2.3</version> <type>pom</type> <scope>import</scope> </dependency> <!-- Inherit managed dependencies from core-lib-azure --> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-azure</artifactId> + <artifactId>core-lib-azure-spring6</artifactId> <version>${osdu.corelibazure.version}</version> <type>pom</type> <scope>import</scope> @@ -87,31 +88,7 @@ <artifactId>woodstox-core</artifactId> <version>${woodstox-core.version}</version> </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <version>${log4j2.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${log4j2.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${log4j2.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${log4j2.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jul</artifactId> - <version>${log4j2.version}</version> - </dependency> + <dependency> <groupId>io.undertow</groupId> <artifactId>undertow-core</artifactId> @@ -144,12 +121,12 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${os-core-common.version}</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-azure</artifactId> + <artifactId>core-lib-azure-spring6</artifactId> <version>${osdu.corelibazure.version}</version> </dependency> @@ -157,26 +134,6 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> - <exclusions> - <exclusion> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - </exclusion> - </exclusions> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> </dependency> <dependency> @@ -225,6 +182,13 @@ <dependency> <groupId>com.azure.spring</groupId> <artifactId>azure-spring-boot-starter-active-directory</artifactId> + <version>3.14.0</version> + <exclusions> + <exclusion> + <artifactId>msal4j</artifactId> + <groupId>com.microsoft.azure</groupId> + </exclusion> + </exclusions> </dependency> <dependency> <!-- Required for JUnit 4 tests to run --> @@ -262,12 +226,6 @@ <version>${mockito.version}</version> <scope>test</scope> </dependency> - - <!-- Jackson Dependencies --> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - </dependency> </dependencies> <build> diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/thread/ThreadSignatureService.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/thread/ThreadSignatureService.java index efadcda49..f9a50cd70 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/thread/ThreadSignatureService.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/thread/ThreadSignatureService.java @@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -import javax.xml.bind.DatatypeConverter; +import jakarta.xml.bind.DatatypeConverter; import java.nio.charset.StandardCharsets; import java.security.SecureRandom; import java.util.Base64; diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java index fb5ba29ef..c85c70fcc 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractor.java @@ -32,7 +32,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/security/AzureIstioSecurityConfig.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/security/AzureIstioSecurityConfig.java index f997c4c73..0f4248fba 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/security/AzureIstioSecurityConfig.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/security/AzureIstioSecurityConfig.java @@ -14,19 +14,28 @@ package org.opengroup.osdu.notification.provider.azure.security; +import static org.springframework.security.config.Customizer.withDefaults; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; @Configuration -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class AzureIstioSecurityConfig extends WebSecurityConfigurerAdapter { +@EnableMethodSecurity +public class AzureIstioSecurityConfig { - @Override - public void configure(HttpSecurity http) throws Exception { - //AuthN is disabled. AuthN is handled by sidecar proxy - http.httpBasic().disable().csrf().disable(); + @Bean + public SecurityFilterChain defaultFilterChain(HttpSecurity http) throws Exception { + http + .cors(AbstractHttpConfigurer::disable) + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll()) + .httpBasic(withDefaults()); + return http.build(); } } diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureCosmosProperties.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureCosmosProperties.java index 7a9fef373..9db75abc7 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureCosmosProperties.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureCosmosProperties.java @@ -1,6 +1,6 @@ package org.opengroup.osdu.notification.provider.azure.util; -import javax.inject.Named; +import jakarta.inject.Named; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureKeyVaultProperties.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureKeyVaultProperties.java index 6c4fe6f19..2e459b7af 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureKeyVaultProperties.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/AzureKeyVaultProperties.java @@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; -import javax.inject.Named; +import jakarta.inject.Named; @Component public class AzureKeyVaultProperties { diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilter.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilter.java index 7e70bf2ec..d2830e13e 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilter.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilter.java @@ -21,14 +21,14 @@ import java.io.PrintWriter; import java.util.List; import java.util.Map; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.opengroup.osdu.notification.provider.interfaces.IPubsubHandshakeHandler; import org.opengroup.osdu.notification.provider.interfaces.IPubsubRequestBodyExtractor; diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/Slf4jMDCFilter.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/Slf4jMDCFilter.java index 97c62bf56..cd1f59a5a 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/Slf4jMDCFilter.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/Slf4jMDCFilter.java @@ -4,11 +4,11 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.opengroup.osdu.azure.util.AuthUtils; import org.opengroup.osdu.core.common.model.http.DpsHeaders; diff --git a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractorTest.java b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractorTest.java index 803290c96..6960edddb 100644 --- a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractorTest.java +++ b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/pubsub/EventGridRequestBodyExtractorTest.java @@ -23,9 +23,9 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; import org.springframework.http.HttpStatus; -import javax.servlet.ReadListener; -import javax.servlet.ServletInputStream; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.ReadListener; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilterTest.java b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilterTest.java index 97bc65fc6..9983e9697 100644 --- a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilterTest.java +++ b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/provider/azure/util/HandshakeFilterTest.java @@ -23,11 +23,11 @@ import org.mockito.junit.MockitoJUnitRunner; import org.opengroup.osdu.notification.provider.interfaces.IPubsubHandshakeHandler; import org.opengroup.osdu.notification.provider.interfaces.IPubsubRequestBodyExtractor; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; diff --git a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/pubsub/EventGridHandshakeHandlerTest.java b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/pubsub/EventGridHandshakeHandlerTest.java index ca0286c3d..7f8b39e5a 100644 --- a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/pubsub/EventGridHandshakeHandlerTest.java +++ b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/pubsub/EventGridHandshakeHandlerTest.java @@ -49,7 +49,7 @@ public class EventGridHandshakeHandlerTest { public void should_returnValidResponse_getHandshakeResponse() { // Set up when(sut.getHandshakeResponse()).thenReturn("testValidationCode"); - String expectedResponse = "{\"ValidationResponse\":\"testValidationCode\"}"; + String expectedResponse = "testValidationCode"; // Act String observedResponse = this.sut.getHandshakeResponse(); diff --git a/provider/notification-gc/pom.xml b/provider/notification-gc/pom.xml index 273626d8d..6e23875bf 100644 --- a/provider/notification-gc/pom.xml +++ b/provider/notification-gc/pom.xml @@ -14,163 +14,156 @@ See the License for the specific language governing permissions and limitations under the License. --> -<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-gc</artifactId> - <name>notification-gc</name> - <description>Google Cloud implementation for Notification service</description> - <packaging>jar</packaging> +<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-gc</artifactId> + <name>notification-gc</name> + <description>Google Cloud implementation for Notification service</description> + <packaging>jar</packaging> - <parent> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-notification</artifactId> - <version>0.26.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> + <parent> + <groupId>org.opengroup.osdu</groupId> + <artifactId>os-notification</artifactId> + <version>0.26.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> - <properties> - <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> - </properties> + <properties> + <spring-boot-maven-plugin.version>3.2.3</spring-boot-maven-plugin.version> + </properties> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>com.fasterxml.jackson</groupId> - <artifactId>jackson-bom</artifactId> - <version>2.15.0</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>com.fasterxml.jackson</groupId> + <artifactId>jackson-bom</artifactId> + <version>2.15.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springframework.data</groupId> - <artifactId>spring-data-redis</artifactId> - <version>2.7.18</version> - </dependency> - <dependency> - <groupId>io.lettuce</groupId> - <artifactId>lettuce-core</artifactId> - <version>6.3.0.RELEASE</version> - </dependency> - <dependency> - <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> + <dependencies> + <dependency> + <groupId>com.google.cloud</groupId> + <artifactId>google-cloud-pubsub</artifactId> + <version>1.127.2</version> + </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>core-lib-gc-spring6</artifactId> + <version>0.26.0-rc5</version> + <exclusions> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>notification-core</artifactId> - <version>0.26.0-SNAPSHOT</version> - <exclusions> - <exclusion> - <groupId>com.google.apis</groupId> - <artifactId>google-api-services-iam</artifactId> - </exclusion> - <exclusion> - <groupId>com.google.oauth-client</groupId> - <artifactId>google-oauth-client</artifactId> - </exclusion> - <exclusion> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>notification-core</artifactId> + <version>0.26.0-SNAPSHOT</version> + </dependency> - <dependency> - <groupId>ch.qos.logback.contrib</groupId> - <artifactId>logback-json-classic</artifactId> - <version>0.1.5</version> - </dependency> + <dependency> + <groupId>org.opengroup.osdu</groupId> + <artifactId>oqm</artifactId> + <version>0.25.0</version> + </dependency> + <dependency> + <groupId>org.springframework.data</groupId> + <artifactId>spring-data-redis</artifactId> + <version>3.2.3</version> + </dependency> + <dependency> + <groupId>io.lettuce</groupId> + <artifactId>lettuce-core</artifactId> + <version>6.3.0.RELEASE</version> + </dependency> - <!-- unit test dependencies --> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito2</artifactId> - <version>2.0.9</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <version>2.0.9</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>3.12.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>oqm</artifactId> - <version>0.24.0</version> - </dependency> - - <dependency> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> - <version>${snakeyaml-version}</version> - </dependency> - </dependencies> + <dependency> + <groupId>ch.qos.logback.contrib</groupId> + <artifactId>logback-json-classic</artifactId> + <version>0.1.5</version> + </dependency> - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <version>${spring-boot-maven-plugin.version}</version> - <configuration> - <profiles> - <profile> - <id>local</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <properties> - <spring.profiles.active>local</spring.profiles.active> - </properties> - </profile> - <profile> - <id>dev</id> - <properties> - <spring.profiles.active>dev</spring.profiles.active> - </properties> - </profile> - </profiles> - </configuration> - <executions> - <execution> - <goals> - <goal>repackage</goal> - </goals> - <configuration> - <classifier>spring-boot</classifier> - <mainClass> - org.opengroup.osdu.notification.provider.gcp.Application - </mainClass> - </configuration> - </execution> - </executions> - </plugin> - <plugin> + <!-- unit test dependencies --> + <dependency> + <groupId>org.powermock</groupId> + <artifactId>powermock-api-mockito2</artifactId> + <version>2.0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.powermock</groupId> + <artifactId>powermock-module-junit4</artifactId> + <version>2.0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>3.12.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + <version>${snakeyaml-version}</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>${spring-boot-maven-plugin.version}</version> + <configuration> + <profiles> + <profile> + <id>local</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <spring.profiles.active>local</spring.profiles.active> + </properties> + </profile> + <profile> + <id>dev</id> + <properties> + <spring.profiles.active>dev</spring.profiles.active> + </properties> + </profile> + </profiles> + </configuration> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + <configuration> + <classifier>spring-boot</classifier> + <mainClass> + org.opengroup.osdu.notification.provider.gcp.Application + </mainClass> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.10</version> @@ -189,17 +182,17 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>3.0.0</version> - <configuration> - <argLine> - @{argLine} --add-opens java.base/java.util=ALL-UNNAMED - --add-opens java.base/java.lang=ALL-UNNAMED - </argLine> - </configuration> - </plugin> - </plugins> - </build> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>3.0.0</version> + <configuration> + <argLine> + @{argLine} --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.lang=ALL-UNNAMED + </argLine> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/provider/notification-gc/src/main/appengine/app.dev.yaml b/provider/notification-gc/src/main/appengine/app.dev.yaml deleted file mode 100644 index df3cc73b3..000000000 --- a/provider/notification-gc/src/main/appengine/app.dev.yaml +++ /dev/null @@ -1,23 +0,0 @@ -service: os-notification - -runtime: java11 -instance_class: F2 - -automatic_scaling: - target_throughput_utilization: 0.5 - max_concurrent_requests: 30 - min_instances: 1 - -inbound_services: - - warmup - -handlers: - - url: /.* - script: none - secure: always - redirect_http_response_code: 307 - -# Explicitly set the memory limit and maximum heap size for the Spring Boot app -env_variables: - JAVA_TOOL_OPTIONS: "-XX:MaxRAM=256m -XX:ActiveProcessorCount=2 -Xmx32m" - SPRING_PROFILES_ACTIVE: 'dev' \ No newline at end of file diff --git a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/MessageBrokerProvider.java b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/MessageBrokerProvider.java index cdd935b2a..cf14325ce 100644 --- a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/MessageBrokerProvider.java +++ b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/MessageBrokerProvider.java @@ -13,7 +13,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.List; import static org.opengroup.osdu.notification.provider.gcp.pubsub.OqmSubscriberManager.*; diff --git a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/OqmSubscriberManager.java b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/OqmSubscriberManager.java index 2c51db098..8485d0939 100644 --- a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/OqmSubscriberManager.java +++ b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/OqmSubscriberManager.java @@ -31,7 +31,7 @@ import org.opengroup.osdu.notification.provider.gcp.service.RegisterSubscription import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.util.List; import java.util.stream.Collectors; diff --git a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/PubsubRequestBodyExtractor.java b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/PubsubRequestBodyExtractor.java index 2a4ad0f2c..4933ac5b3 100644 --- a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/PubsubRequestBodyExtractor.java +++ b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/pubsub/PubsubRequestBodyExtractor.java @@ -31,7 +31,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; import java.util.Base64; diff --git a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/security/SecurityConfig.java b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/security/SecurityConfig.java index 089c6fdae..d126a2283 100644 --- a/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/security/SecurityConfig.java +++ b/provider/notification-gc/src/main/java/org/opengroup/osdu/notification/provider/gcp/security/SecurityConfig.java @@ -1,34 +1,39 @@ /* - * Copyright 2017-2020, Schlumberger + * Copyright 2017-2020, Schlumberger * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. */ package org.opengroup.osdu.notification.provider.gcp.security; +import static org.springframework.security.config.Customizer.withDefaults; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; + @Configuration -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter { +@EnableMethodSecurity +public class SecurityConfig { - @Override - protected void configure(HttpSecurity httpSecurity) throws Exception { - httpSecurity - .httpBasic().disable() - .csrf().disable(); //disable default authN. AuthN handled by endpoints proxy + @Bean + public SecurityFilterChain defaultFilterChain(HttpSecurity http) throws Exception { + http.cors(AbstractHttpConfigurer::disable).csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll()).httpBasic(withDefaults()); + return http.build(); } -} \ No newline at end of file + +} diff --git a/provider/notification-ibm/pom.xml b/provider/notification-ibm/pom.xml index 40e4af989..a211d7920 100644 --- a/provider/notification-ibm/pom.xml +++ b/provider/notification-ibm/pom.xml @@ -31,10 +31,7 @@ <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> <undertow-websockets-jsr.version>2.2.11.Final</undertow-websockets-jsr.version> - <jackson-dataformat-cbor.version>2.13.0</jackson-dataformat-cbor.version> - <jackson-databind.version>2.13.4.2</jackson-databind.version> - <jackson.version>2.13.2</jackson.version> - <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> + <spring-boot-maven-plugin.version>3.2.3</spring-boot-maven-plugin.version> </properties> <dependencyManagement> @@ -42,7 +39,7 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> + <version>3.2.3</version> <type>pom</type> <scope>import</scope> </dependency> @@ -50,54 +47,28 @@ </dependencyManagement> <dependencies> - <!-- <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - </dependency> --> - - - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-lib-ibm</artifactId> - <version>0.25.1</version> - <exclusions> - <exclusion> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-core</artifactId> - </exclusion> - <exclusion> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> - </exclusion> - <exclusion> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-cbor</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-web</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-cbor</artifactId> - <version>${jackson-dataformat-cbor.version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>${jackson-databind.version}</version> - </dependency> <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>${jackson.version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>${jackson.version}</version> + <groupId>org.opengroup.osdu</groupId> + <artifactId>os-core-lib-ibm</artifactId> + <version>0.26.0-rc8</version> + <exclusions> + <exclusion> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-core</artifactId> + </exclusion> + <exclusion> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </exclusion> + <exclusion> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-cbor</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-web</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.yaml</groupId> diff --git a/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/pubsub/PubsubRequestBodyExtractor.java b/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/pubsub/PubsubRequestBodyExtractor.java index 88454680f..16be5dd70 100644 --- a/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/pubsub/PubsubRequestBodyExtractor.java +++ b/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/pubsub/PubsubRequestBodyExtractor.java @@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; import java.util.Base64; diff --git a/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/security/SecurityConfig.java b/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/security/SecurityConfig.java index ac2774b20..955d1bc7d 100644 --- a/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/security/SecurityConfig.java +++ b/provider/notification-ibm/src/main/java/org/opengroup/osdu/notification/provider/ibm/security/SecurityConfig.java @@ -1,29 +1,27 @@ -/* Licensed Materials - Property of IBM */ -/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ +/* Licensed Materials - Property of IBM */ +/* (c) Copyright IBM Corp. 2020. All Rights Reserved. */ package org.opengroup.osdu.notification.provider.ibm.security; +import static org.springframework.security.config.Customizer.withDefaults; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; + @Configuration -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter { - @Override - protected void configure(HttpSecurity http) throws Exception { - http.csrf().disable(); - // .authorizeRequests() - // .antMatchers("/test/challenge/**", - // "/v1/api-docs", - // "/configuration/ui", - // "/swagger-resources/**", - // "/configuration/security", - // "/swagger-ui.html", - // "/info", - // "/webjars/**") - // .permitAll().anyRequest().authenticated().and().oauth2ResourceServer().jwt(); - } - +@EnableMethodSecurity +public class SecurityConfig { + + @Bean + public SecurityFilterChain defaultFilterChain(HttpSecurity http) throws Exception { + http.cors(AbstractHttpConfigurer::disable).csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll()).httpBasic(withDefaults()); + return http.build(); + } } diff --git a/testing/notification-test-aws/pom.xml b/testing/notification-test-aws/pom.xml index b7781e685..b50efa327 100644 --- a/testing/notification-test-aws/pom.xml +++ b/testing/notification-test-aws/pom.xml @@ -36,8 +36,8 @@ <java.version>17</java.version> <maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.source>${java.version}</maven.compiler.source> - <jackson-databind.version>2.13.2.2</jackson-databind.version> - <jackson.version>2.13.2</jackson.version> + <jackson-databind.version>2.14.1</jackson-databind.version> + <jackson.version>2.14.1</jackson.version> </properties> <dependencies> -- GitLab