diff --git a/.fossa.yml b/.fossa.yml index 9062512e1b888f2aaa3f266d933b27652345da76..d88704da24ff77efe4977f1523457e64ed599b59 100644 --- a/.fossa.yml +++ b/.fossa.yml @@ -24,10 +24,6 @@ analyze: type: mvn target: provider/legal-gc/pom.xml path: . - - name: legal-byoc - type: mvn - target: provider/legal-byoc/pom.xml - path: . - name: legal-azure type: mvn target: provider/legal-azure/pom.xml diff --git a/NOTICE b/NOTICE index 5f4557dd8a2257a8ff3a44ad5e0f0bf11f28b889..2918d2e2d7cf1f3817f968f924ed19b5f1cc4c40 100644 --- a/NOTICE +++ b/NOTICE @@ -16,7 +16,6 @@ Apache-1.1 The following software have components provided under the terms of this license: - Apache Commons CLI (from https://commons.apache.org/proper/commons-cli/, https://repo1.maven.org/maven2/commons-cli/commons-cli) -- 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) - Apache Maven Invoker (from https://repo1.maven.org/maven2/org/apache/maven/shared/maven-invoker) - Apache Maven Reporting API (from https://repo1.maven.org/maven2/org/apache/maven/reporting/maven-reporting-api) @@ -42,7 +41,6 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) - Plexus Common Utilities (from http://plexus.codehaus.org/plexus-utils, https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils) - 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) - oro (from https://repo1.maven.org/maven2/oro/oro) ======================================================================== @@ -80,7 +78,6 @@ The following software have components provided under the terms of this license: - 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 Text (from http://commons.apache.org/proper/commons-text, http://commons.apache.org/proper/commons-text/, https://commons.apache.org/proper/commons-text) - 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) @@ -109,12 +106,10 @@ The following software have components provided under the terms of this license: - 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) - AutoValue Processor (from https://github.com/google/auto/tree/main/value, https://github.com/google/auto/tree/master/value) +- 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) @@ -140,7 +135,10 @@ The following software have components provided under the terms of this license: - Flapdoodle Embedded MongoDB (from http://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo, http://github.com/flapdoodle-oss/embedmongo.flapdoodle.de) - Flapdoodle Embedded MongoDB Package Resolver (from http://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo.packageresolver) - Flapdoodle Embedded Process Util (from http://github.com/flapdoodle-oss/de.flapdoodle.embed.process) -- Flapdoodle OS Detection Library (from http://github.com/flapdoodle-oss/de.flapdoodle.os) +- Flapdoodle Graph Stuff (from http://github.com/flapdoodle-oss/de.flapdoodle.graph) +- Flapdoodle Java8 Stuff (from http://github.com/flapdoodle-oss/de.flapdoodle.java8) +- Flapdoodle OS Detection Library (from http://github.com/flapdoodle-oss/de.flapdoodle.os, http://github.com/flapdoodle-oss/de.flapdoodle.os-api) +- Flapdoodle Reverse (from http://github.com/flapdoodle-oss/de.flapdoodle.reverse) - 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 (HTTP JSON) (from <https://repo1.maven.org/maven2/com/google/api/gax-httpjson>, https://repo1.maven.org/maven2/com/google/api/gax-httpjson) - 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) @@ -174,6 +172,7 @@ The following software have components provided under the terms of this license: - JBoss Marshalling River (from https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling-river) - JCIP Annotations under Apache License (from http://stephenc.github.com/jcip-annotations) - JDOM +- JHeaps (from http://www.jheaps.org) - JJWT :: Legacy Transitive Dependency Jar (from https://repo1.maven.org/maven2/io/jsonwebtoken/jjwt) - JMES Path Query library (from https://aws.amazon.com/sdkforjava) - JSON Small and Fast Parser (from https://repo1.maven.org/maven2/net/minidev/json-smart, https://urielch.github.io/) @@ -193,6 +192,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 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) - Java Native Access (from https://github.com/java-native-access/jna, https://github.com/twall/jna) @@ -203,12 +204,6 @@ The following software have components provided under the terms of this license: - Jetty :: Utilities (from http://jetty.mortbay.org, http://www.eclipse.org/jetty, https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util, https://repo1.maven.org/maven2/org/mortbay/jetty/jetty-util) - Jetty Server (from http://jetty.mortbay.org, https://repo1.maven.org/maven2/org/mortbay/jetty/jetty) - 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/) @@ -235,6 +230,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, https://github.com/mockito/mockito) - Mojo's Maven plugin for Cobertura (from http://mojo.codehaus.org/cobertura-maven-plugin/) - MongoDB Driver (from https://www.mongodb.com/) @@ -250,7 +246,6 @@ The following software have components provided under the terms of this license: - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) - Netty/Handler (from https://repo1.maven.org/maven2/io/netty/netty-handler) - Netty/Handler/Proxy (from https://repo1.maven.org/maven2/io/netty/netty-handler-proxy) -- Netty/Incubator/Codec/Classes/Quic (from <https://repo1.maven.org/maven2/io/netty/incubator/netty-incubator-codec-classes-quic>, https://repo1.maven.org/maven2/io/netty/incubator/netty-incubator-codec-classes-quic) - 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) @@ -271,7 +266,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) - Plexus Common Utilities (from http://plexus.codehaus.org/plexus-utils, https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils) - Plexus I18N Component (from https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-i18n) - Plexus Velocity Component (from https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-velocity) @@ -279,10 +273,8 @@ The following software have components provided under the terms of this license: - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) - Protocol Buffer extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-protobuf) - Proton-J (from https://repo1.maven.org/maven2/org/apache/qpid/proton-j) -- QUIC functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) - QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) -- Reactive Streams Netty driver (from https://github.com/reactor/reactor-netty) - Redisson (from http://redisson.org) - Retrofit (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/retrofit) - RxJava (from https://github.com/ReactiveX/RxJava) @@ -303,7 +295,6 @@ The following software have components provided under the terms of this license: - Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json, https://spring.io/projects/spring-boot) - Spring Boot Log4j 2 Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-log4j2, https://spring.io/projects/spring-boot) - Spring Boot Logging Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-logging, https://spring.io/projects/spring-boot) -- Spring Boot Reactor Netty Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-reactor-netty, https://spring.io/projects/spring-boot) - Spring Boot Security Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Test (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) @@ -312,7 +303,6 @@ The following software have components provided under the terms of this license: - Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat, https://spring.io/projects/spring-boot) - Spring Boot Validation Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Web Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) -- Spring Boot WebFlux Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-webflux, https://spring.io/projects/spring-boot) - Spring Commons Logging Bridge (from https://github.com/spring-projects/spring-framework) - Spring Context (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-context) - Spring Core (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-core) @@ -329,16 +319,11 @@ The following software have components provided under the terms of this license: - Spring Transaction (from https://github.com/SpringSource/spring-framework, https://github.com/spring-projects/spring-framework) - Spring Web (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-web) - Spring Web MVC (from https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-webmvc) -- Spring WebFlux (from https://github.com/spring-projects/spring-framework) - Swagger UI (from <http://webjars.org>, http://webjars.org) - Vavr (from http://vavr.io, https://www.vavr.io) - Vavr Match (from http://vavr.io) - Woodstox (from https://github.com/FasterXML/woodstox) - Xerces2-j (from https://repo1.maven.org/maven2/xerces/xercesImpl, https://xerces.apache.org/xerces2-j/) -- 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) - datastore-v1-proto-client (from https://repo1.maven.org/maven2/com/google/cloud/datastore/datastore-v1-proto-client) - error-prone annotations (from https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations) - gapic-google-cloud-storage-v2 (from https://repo1.maven.org/maven2/com/google/api/grpc/gapic-google-cloud-storage-v2) @@ -366,7 +351,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) - minio (from https://github.com/minio/minio-java) - org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian) @@ -389,14 +377,16 @@ The following software have components provided under the terms of this license: - spring-security-oauth2-core (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-oauth2-jose (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-test (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) -- 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) -- tomcat-annotations-api (from http://tomcat.apache.org/, https://tomcat.apache.org/) +- swagger-models-jakarta (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-models-jakarta) - tomcat-embed-core (from http://tomcat.apache.org/) - tomcat-embed-el (from http://tomcat.apache.org/, https://tomcat.apache.org/) - tomcat-embed-websocket (from http://tomcat.apache.org/, https://tomcat.apache.org/) @@ -418,7 +408,6 @@ The following software have components provided under the terms of this license: - Plexus Common Utilities (from http://plexus.codehaus.org/plexus-utils, https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils) - PostgreSQL JDBC Driver - Stax2 API (from http://github.com/FasterXML/stax2-api) -- jaxen (from http://jaxen.codehaus.org/, https://repo1.maven.org/maven2/jaxen/jaxen) ======================================================================== BSD-3-Clause @@ -446,6 +435,7 @@ The following software have components provided under the terms of this license: - JSch (from http://www.jcraft.com/jsch/) - 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 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) - 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) @@ -463,6 +453,13 @@ The following software have components provided under the terms of this license: - ThreeTen backport (from https://github.com/ThreeTen/threetenbp, https://www.threeten.org/threetenbp) - jaxen (from http://jaxen.codehaus.org/, https://repo1.maven.org/maven2/jaxen/jaxen) +======================================================================== +BSL-1.0 +======================================================================== +The following software have components provided under the terms of this license: + +- Jackson-core (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-core) + ======================================================================== Beerware ======================================================================== @@ -479,6 +476,7 @@ BouncyCastle The following software have components provided under the terms of this license: - Bouncy Castle Provider (from http://www.bouncycastle.org/java.html, https://www.bouncycastle.org/java.html) +- Microsoft Azure client library for Identity (from https://github.com/Azure/azure-sdk-for-java) ======================================================================== CC-BY-2.5 @@ -507,7 +505,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) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) - reactive-streams (from http://www.reactive-streams.org/) @@ -518,7 +515,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) - Servlet Specification 2.5 API (from http://jetty.mortbay.org, https://repo1.maven.org/maven2/org/mortbay/jetty/servlet-api-2.5) @@ -529,7 +525,6 @@ CDDL-1.1 ======================================================================== The following software have components provided under the terms of this license: -- Jakarta Servlet (from https://javaee.github.io/servlet-spec/, https://projects.eclipse.org/projects/ee4j.servlet) - 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) @@ -555,10 +550,7 @@ 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/) +- JGraphT - Core (from https://repo1.maven.org/maven2/org/jgrapht/jgrapht-core) - Jetty :: Utilities (from http://jetty.mortbay.org, http://www.eclipse.org/jetty, https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util, https://repo1.maven.org/maven2/org/mortbay/jetty/jetty-util) - Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic) - Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core) @@ -575,6 +567,7 @@ EPL-2.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/) +- JGraphT - Core (from https://repo1.maven.org/maven2/org/jgrapht/jgrapht-core) - JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) - JUnit Jupiter API (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Jupiter Engine (from http://junit.org/junit5/, https://junit.org/junit5/) @@ -583,6 +576,8 @@ The following software have components provided under the terms of this license: - JUnit Platform Engine API (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 Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Jakarta Validation API (from https://beanvalidation.org) - 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) @@ -599,6 +594,7 @@ GPL-2.0-only The following software have components provided under the terms of this license: - Cobertura (from http://cobertura.sourceforge.net) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) - tomcat-embed-core (from http://tomcat.apache.org/) ======================================================================== @@ -615,6 +611,8 @@ The following software have components provided under the terms of this license: - 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 Servlet (from https://projects.eclipse.org/projects/ee4j.servlet) - Jakarta Validation API (from https://beanvalidation.org) - 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) @@ -622,6 +620,13 @@ The following software have components provided under the terms of this license: - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) - tomcat-embed-core (from http://tomcat.apache.org/) +======================================================================== +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) + ======================================================================== GPL-3.0-or-later ======================================================================== @@ -643,13 +648,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) - ======================================================================== Info-ZIP ======================================================================== @@ -670,6 +668,7 @@ LGPL-2.1-only The following software have components provided under the terms of this license: - Cobertura (from http://cobertura.sourceforge.net) +- JGraphT - Core (from https://repo1.maven.org/maven2/org/jgrapht/jgrapht-core) - Logback Classic Module (from http://logback.qos.ch, https://repo1.maven.org/maven2/ch/qos/logback/logback-classic) - Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic) - Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core) @@ -696,27 +695,30 @@ 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) - Azure Java Client Runtime for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) -- 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) - Default Plexus Container (from https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-container-default) +- JGraphT - Core (from https://repo1.maven.org/maven2/org/jgrapht/jgrapht-core) - JSch (from http://www.jcraft.com/jsch/) - JTidy (from http://jtidy.sourceforge.net) - 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) - Java JWT (from http://www.jwt.io, https://github.com/auth0/java-jwt) - 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) +- Microsoft Azure Java Core AMQP Library (from https://github.com/Azure/azure-sdk-for-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 Management 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 annotations (from https://github.com/Microsoft/java-api-annotations) - Microsoft Azure SDK for EventGrid Management (from https://github.com/Azure/azure-sdk-for-java) @@ -735,18 +737,20 @@ The following software have components provided under the terms of this license: - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) - Plexus Default Interactivity Handler (from https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-interactivity-api) - 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 Cloud Azure AutoConfigure (from https://microsoft.github.io/spring-cloud-azure) +- Spring Cloud Azure Core (from https://microsoft.github.io/spring-cloud-azure) +- Spring Cloud Azure Service (from https://microsoft.github.io/spring-cloud-azure) +- Spring Cloud Azure Starter (from https://microsoft.github.io/spring-cloud-azure) +- Spring Cloud Azure Starter Active Directory (from https://microsoft.github.io/spring-cloud-azure) - 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) - 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 @@ -837,7 +841,6 @@ 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) @@ -848,6 +851,10 @@ 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/) - System Rules (from http://stefanbirkner.github.com/system-rules/, http://stefanbirkner.github.io/system-rules/) - xml-apis (from https://repo1.maven.org/maven2/xml-apis/xml-apis) diff --git a/legal-core-plus/pom.xml b/legal-core-plus/pom.xml index 479b8d846c9d55615b63b21e2c4b7d79f24abc74..10b765e10edd367ac6d9898ea70780a82a56f41f 100644 --- a/legal-core-plus/pom.xml +++ b/legal-core-plus/pom.xml @@ -32,43 +32,10 @@ <name>legal-core-plus</name> <description>Legal service for Hybrid Cloud</description> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - <type>pom</type> - <scope>import</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>2.13.4</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.13.4.2</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>2.13.4</version> - </dependency> - </dependencies> - </dependencyManagement> - <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-loader</artifactId> - <version>2.7.15</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> @@ -90,14 +57,20 @@ <groupId>org.opengroup.osdu</groupId> <artifactId>core-plus-common-lib</artifactId> <version>0.24.0-rc2</version> + <exclusions> + <exclusion> + <groupId>org.opengroup.osdu</groupId> + <artifactId>os-core-common</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>4.0.1</version> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <version>6.0.0</version> <scope>provided</scope> </dependency> - <dependency> + <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> <version>6.1.23</version> @@ -107,11 +80,11 @@ <artifactId>google-cloud-datastore</artifactId> <version>2.13.5</version> </dependency> - <!-- https://mvnrepository.com/artifact/javax.inject/javax.inject --> + <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <version>2.0.1</version> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> @@ -224,7 +197,12 @@ <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> - + <!-- Fix for NoClassDefFoundError: kotlin/reflect/KParameter --> + <dependency> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-stdlib-jdk8</artifactId> + <version>1.9.22</version> + </dependency> <!-- Mapper\Driver core dependencies --> <dependency> <groupId>org.opengroup.osdu</groupId> @@ -248,7 +226,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>3.2.2</version> <executions> <execution> <goals> @@ -257,7 +235,7 @@ <configuration> <classifier>spring-boot</classifier> <mainClass> - org.springframework.boot.loader.PropertiesLauncher + org.springframework.boot.loader.launch.PropertiesLauncher </mainClass> </configuration> </execution> diff --git a/legal-core-plus/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java b/legal-core-plus/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java index fc92ddaccf0ac79da125344af40259d8382f4e49..7e4acbede96a2ba9125ddbf688727019ffdbaf5d 100644 --- a/legal-core-plus/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java +++ b/legal-core-plus/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java @@ -24,7 +24,7 @@ import com.google.gson.JsonElement; import java.time.Instant; import java.util.HashMap; import java.util.Map; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.legal.StatusChangedTags; diff --git a/legal-core-plus/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java b/legal-core-plus/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java deleted file mode 100644 index 14d050e61a6068db7834f15d0bb004a3c79fa378..0000000000000000000000000000000000000000 --- a/legal-core-plus/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2020-2023 Google LLC - * Copyright 2020-2023 EPAM Systems, Inc - * - * 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 - * - * 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.legal.security; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class GSuiteSecurityConfiguration extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.httpBasic().disable() - .csrf().disable(); //disable default authN. AuthN handled by endpoints proxy - } - - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/api-docs") - .antMatchers("/index") - .antMatchers("/info") - .antMatchers("/swagger"); - } -} diff --git a/legal-core-plus/src/main/java/org/opengroup/osdu/legal/security/SecurityConfiguration.java b/legal-core-plus/src/main/java/org/opengroup/osdu/legal/security/SecurityConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..093222e2f6f32caf82d06ff16c66d023f12fcb38 --- /dev/null +++ b/legal-core-plus/src/main/java/org/opengroup/osdu/legal/security/SecurityConfiguration.java @@ -0,0 +1,69 @@ +/* + * Copyright 2020-2023 Google LLC + * Copyright 2020-2023 EPAM Systems, Inc + * + * 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 + * + * 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.legal.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.EnableMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; + + +@Configuration +@EnableWebSecurity +@EnableMethodSecurity +public class SecurityConfiguration { + + private static final String[] AUTH_ALLOWLIST = { + "/", + "/index.html", + "/api-docs.yaml", + "/api-docs/swagger-config", + "/api-docs/**", + "/swagger", + "/swagger-ui.html", + "/swagger-ui/**", + "/legaltags", + "/legaltags/**", + "/legaltags:batchRetrieve", + "/legaltags:validate", + "/legaltags:properties", + "/updateLegalTagStatus", + "/info", + "/_ah/liveness_check", + "/_ah/readiness_check" + }; + + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http + .cors(AbstractHttpConfigurer::disable) + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize + .requestMatchers(AUTH_ALLOWLIST).permitAll() + .anyRequest().denyAll() + ) + .httpBasic(withDefaults()); + return http.build(); + } +} diff --git a/legal-core-plus/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java b/legal-core-plus/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java index 9e851174fa78ee2b9df8b4fa00e82e84f416e0a3..24dcd7d09478aca991fff92808d8921b5e6b3a0f 100644 --- a/legal-core-plus/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java +++ b/legal-core-plus/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java @@ -22,7 +22,7 @@ import org.opengroup.osdu.core.common.model.http.RequestInfo; import org.opengroup.osdu.core.common.model.legal.validation.rules.Rule; import org.opengroup.osdu.legal.tags.LegalTagConstraintValidator; -import javax.validation.*; +import jakarta.validation.*; import java.util.*; diff --git a/legal-core/pom.xml b/legal-core/pom.xml index f38dd69df0d249ffa7a07176c03e96a155cbd8ad..bd67ffe2dd00765faee7f20397463165d07e90ea 100644 --- a/legal-core/pom.xml +++ b/legal-core/pom.xml @@ -8,26 +8,20 @@ <version>0.26.0-SNAPSHOT</version> </parent> - <groupId>org.opengroup.osdu.legal</groupId> <artifactId>legal-core</artifactId> <version>0.26.0-SNAPSHOT</version> <packaging>jar</packaging> <name>legal-core</name> <description>Legal service core</description> - <properties> - <spring-webmvc.version>5.3.22</spring-webmvc.version> - </properties> - <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> - <version>${spring-webmvc.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -55,17 +49,10 @@ <artifactId>snakeyaml</artifactId> <version>2.0</version> </dependency> - - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-core</artifactId> - <version>9.0.68</version> - </dependency> - <!-- https://mvnrepository.com/artifact/javax.inject/javax.inject --> <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <version>2.0.1</version> </dependency> <!-- https://mvnrepository.com/artifact/com.google.api.grpc/proto-google-common-protos --> @@ -131,7 +118,6 @@ <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> - <version>5.7.5</version> <scope>test</scope> </dependency> diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/RulesetProvider.java b/legal-core/src/main/java/org/opengroup/osdu/legal/RulesetProvider.java index 3d282c8b6e265440150119a523658d1459f0ea7d..392b8a128384da2b7ae734c7ad825a5d4dcb3639 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/RulesetProvider.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/RulesetProvider.java @@ -9,8 +9,8 @@ import org.opengroup.osdu.legal.tags.validation.rules.ExpiredContractRule; import org.opengroup.osdu.legal.tags.validation.rules.UnownedDataRule; import org.springframework.stereotype.Component; -import javax.inject.Inject; -import javax.inject.Provider; +import jakarta.inject.Inject; +import jakarta.inject.Provider; import java.util.ArrayList; import java.util.List; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/api/HealthCheckApi.java b/legal-core/src/main/java/org/opengroup/osdu/legal/api/HealthCheckApi.java index d5bae8605a2edaeb14fbad4d0adddd77a67eb9ee..860a929d37914f51e532b0e2006bdafc9787e886 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/api/HealthCheckApi.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/api/HealthCheckApi.java @@ -10,7 +10,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; -import javax.annotation.security.PermitAll; +import jakarta.annotation.security.PermitAll; @RequestMapping("/_ah") @Tag(name = "health", description = "Health related endpoints") diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagController.java b/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagController.java index 81b5fc4de044e9f050d819ccab2f3516779d54f9..26b418760ea64f191b975f45d710861a476590de 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagController.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagController.java @@ -17,8 +17,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import javax.inject.Inject; -import javax.validation.ValidationException; +import jakarta.inject.Inject; +import jakarta.validation.ValidationException; import java.util.Collections; import java.util.HashMap; import java.util.Map; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagStatusJobController.java b/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagStatusJobController.java index bd8c67ca1c83e449ed527450e70721bcf0807124..9baa844253cdcb476b31c05ba6c920d30b0bd31e 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagStatusJobController.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/controller/LegalTagStatusJobController.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.Collection; import static java.util.Collections.singletonList; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesService.java b/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesService.java index f25ad3573462c955da0a943662c655a09c9ca8de..e87d3f09ffe799cae6d3ef19be47aa6339281758 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesService.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesService.java @@ -10,8 +10,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.PostConstruct; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.inject.Inject; @Service @RequestScope diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesTenantRepositories.java b/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesTenantRepositories.java index 025980b18283c9af59976a28066afbf27f63c9ba..d846df979f90837fdeb038044af6f7ad89d97799 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesTenantRepositories.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/countries/LegalTagCountriesTenantRepositories.java @@ -13,7 +13,7 @@ import org.apache.commons.lang3.StringUtils; import java.util.HashMap; import java.util.Map; -import javax.inject.Inject; +import jakarta.inject.Inject; @Repository @Log diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagStatusJob.java b/legal-core/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagStatusJob.java index 9b1d79d04c14635e8f99877156f2b9e77180c9fc..436c90278bd0c73edcbe568d616680d153237b11 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagStatusJob.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagStatusJob.java @@ -11,7 +11,7 @@ import org.opengroup.osdu.core.common.model.legal.LegalTag; import org.springframework.stereotype.Component; import java.util.Collection; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component public class LegalTagStatusJob { diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/logging/AuditLogger.java b/legal-core/src/main/java/org/opengroup/osdu/legal/logging/AuditLogger.java index 939b2cdd614a354ba70003a200c38c39d0ade8b9..4f612438afa02cd890caddaf25b111d381d7baae 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/logging/AuditLogger.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/logging/AuditLogger.java @@ -1,7 +1,7 @@ package org.opengroup.osdu.legal.logging; import java.util.List; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.model.http.RequestInfo; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/AuthorizationFilter.java b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/AuthorizationFilter.java index 14f4ca3e15e6fd64ec899f6bf57c67921633178f..82fd957b732f64b58f67efa6e306b54d6c66d477 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/AuthorizationFilter.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/AuthorizationFilter.java @@ -6,7 +6,7 @@ import org.opengroup.osdu.core.common.provider.interfaces.IAuthorizationService; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component @RequestScope diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalErrorHandler.java b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalErrorHandler.java index d20504fe2c7dc325815996d7a012b9800d826194..eee17cfa44c1707102ed66eb7d147e45b4e7be8a 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalErrorHandler.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalErrorHandler.java @@ -8,8 +8,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; @Hidden @RestController @@ -21,9 +21,9 @@ public class GlobalErrorHandler implements ErrorController { public ResponseEntity<Object> handleError(final HttpServletRequest request, final HttpServletResponse response) { - Object exception = request.getAttribute("javax.servlet.error.exception"); - Object statusCode = request.getAttribute("javax.servlet.error.status_code"); - Object servletMessage = request.getAttribute("javax.servlet.error.message"); + Object exception = request.getAttribute("jakarta.servlet.error.exception"); + Object statusCode = request.getAttribute("jakarta.servlet.error.status_code"); + Object servletMessage = request.getAttribute("jakarta.servlet.error.message"); if(exception instanceof AppException){ AppException appException = (AppException)exception; String message = appException.getError().getMessage(); diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapper.java b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapper.java index d34aa0bbd03f299148323eeac2190de7b438ca64..4357cb68cca4ffcb1f88588f30e7e295b74d115a 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapper.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapper.java @@ -25,10 +25,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import javassist.NotFoundException; -import javax.inject.Inject; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.ValidationException; +import jakarta.inject.Inject; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.ValidationException; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; @@ -38,6 +38,7 @@ import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import org.springframework.lang.NonNull; import org.springframework.security.access.AccessDeniedException; @@ -133,7 +134,7 @@ public class GlobalExceptionMapper extends ResponseEntityExceptionHandler { @NonNull protected ResponseEntity<Object> handleHttpRequestMethodNotSupported(@NonNull HttpRequestMethodNotSupportedException e, @NonNull HttpHeaders headers, - @NonNull HttpStatus status, + @NonNull HttpStatusCode status, @NonNull WebRequest request) { return this.getErrorResponse( new AppException(HttpStatus.METHOD_NOT_ALLOWED.value(), "Method not found.", @@ -144,7 +145,7 @@ public class GlobalExceptionMapper extends ResponseEntityExceptionHandler { @NonNull protected ResponseEntity<Object> handleMethodArgumentNotValid(@NonNull MethodArgumentNotValidException e, @NonNull HttpHeaders headers, - @NonNull HttpStatus status, + @NonNull HttpStatusCode status, @NonNull WebRequest request) { return this.getErrorResponse( new AppException(HttpStatus.BAD_REQUEST.value(), "Validation failed.", diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/LegalFilter.java b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/LegalFilter.java index 768edfbfea70d592a304431ae863a925e9dd293b..91020e8c9daa447c74bf15cd319b8512dcc9860c 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/LegalFilter.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/middleware/LegalFilter.java @@ -3,14 +3,14 @@ package org.opengroup.osdu.legal.middleware; import java.io.IOException; import java.time.Duration; import java.util.Map; -import javax.inject.Inject; -import javax.servlet.Filter; -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.inject.Inject; +import jakarta.servlet.Filter; +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 org.opengroup.osdu.core.common.http.ResponseHeadersFactory; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.DpsHeaders; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagConstraintValidator.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagConstraintValidator.java index 069684d3fcb4d8b2f7dd07a2be0a6ea1a97ad8b2..6401816893882803fffcf4ba9b2a1d06001c8fe0 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagConstraintValidator.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagConstraintValidator.java @@ -1,5 +1,16 @@ package org.opengroup.osdu.legal.tags; +import jakarta.inject.Inject; +import jakarta.validation.Configuration; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorFactory; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; +import java.security.AccessController; +import java.util.Set; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.legal.RulesetProvider; import org.opengroup.osdu.legal.countries.LegalTagCountriesService; @@ -11,14 +22,9 @@ import org.opengroup.osdu.core.common.model.http.RequestInfo; import org.springframework.stereotype.Service; import org.hibernate.validator.internal.util.privilegedactions.NewInstance; -import javax.validation.*; -import javax.inject.Inject; - -import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.List; -import java.util.Set; @Service public class LegalTagConstraintValidator implements ConstraintValidatorFactory { diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java index 3a205d69cb52dab8928b1fba4e0f6e0912b394b3..f029028ee9c7d6b0b326d378544985cb8de87574 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.inject.Inject; +import jakarta.inject.Inject; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImpl.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImpl.java index e006075b34ee18d0e9d937f15977248252afb785..049e8e6f0e97408d83422324bb08f8d74e2a55a7 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImpl.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImpl.java @@ -20,7 +20,7 @@ import org.opengroup.osdu.legal.provider.interfaces.ILegalTagRepository; import org.opengroup.osdu.legal.provider.interfaces.ILegalTagRepositoryFactory; import org.springframework.stereotype.Repository; -import javax.inject.Inject; +import jakarta.inject.Inject; @Repository public class LegalTagRepositoryFactoryImpl implements ILegalTagRepositoryFactory { diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/LegalTagDto.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/LegalTagDto.java index a0a7a7f814c7a6b48ab7324c59e5978957cfada6..c8fa6f463a44a238da0ac7114287e2401a8904ef 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/LegalTagDto.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/LegalTagDto.java @@ -14,8 +14,8 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import javax.validation.Valid; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.validation.Valid; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /* * Read only version of LegalTag model that are sent to the user diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTags.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTags.java index 021060939b2c9593cf3dc7e016f91d6928cea627..1531ff5caf8614ca72cb295cb50d66920e95c280 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTags.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTags.java @@ -6,9 +6,9 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.util.ArrayList; import java.util.List; diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/util/PersistenceExceptionToAppExceptionMapper.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/util/PersistenceExceptionToAppExceptionMapper.java index e1d1d13b12d5bf513afa586ef30dc0f5948ac2fa..0bb9c99193ea201cd46c6b3ae6016a89c3ab3492 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/util/PersistenceExceptionToAppExceptionMapper.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/util/PersistenceExceptionToAppExceptionMapper.java @@ -9,7 +9,7 @@ import org.springframework.stereotype.Component; import java.util.function.Function; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component public class PersistenceExceptionToAppExceptionMapper { diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/OtherRelevantDataCountriesValidator.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/OtherRelevantDataCountriesValidator.java index 0d6e76e5d98976e2073d432a52a2745bbc552ec1..3976b61085c14967529adf6330949c51e47eaf5c 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/OtherRelevantDataCountriesValidator.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/OtherRelevantDataCountriesValidator.java @@ -3,8 +3,8 @@ package org.opengroup.osdu.legal.tags.validation; import com.google.common.base.Strings; import org.opengroup.osdu.legal.countries.LegalTagCountriesService; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; import java.util.List; public class OtherRelevantDataCountriesValidator implements ConstraintValidator<ValidOtherRelevantDataCountries, List<String>> { diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/ValidOtherRelevantDataCountries.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/ValidOtherRelevantDataCountries.java index b58c18581e05330416c7572dea722aa6db5772e9..5f66a8b42d0e2e0a02fe4a3cd649b42de3053dc4 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/ValidOtherRelevantDataCountries.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/ValidOtherRelevantDataCountries.java @@ -1,8 +1,8 @@ package org.opengroup.osdu.legal.tags.validation; -import javax.validation.Constraint; +import jakarta.validation.Constraint; import java.lang.annotation.*; -import javax.validation.Payload; +import jakarta.validation.Payload; @Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.PARAMETER }) @Retention(RetentionPolicy.RUNTIME) diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/rules/DefaultRule.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/rules/DefaultRule.java index 6b1083dde25226bce387dcf46933f75318ee6ca3..64512cf36035c036f189e32012f809aaa1cfa41a 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/rules/DefaultRule.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/validation/rules/DefaultRule.java @@ -9,7 +9,7 @@ import org.springframework.stereotype.Component; import java.util.Map; -import javax.inject.Inject; +import jakarta.inject.Inject; //This should be the last rule used as a catch all when specific rules have not been found to handle validation diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/util/HtmlEncodeAdapter.java b/legal-core/src/main/java/org/opengroup/osdu/legal/util/HtmlEncodeAdapter.java index ef2ab469247a4622f55340c085e9ee54f8999a4e..3e8dfa41c7fe500c85efb710dbd782a8d46d93d3 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/util/HtmlEncodeAdapter.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/util/HtmlEncodeAdapter.java @@ -3,7 +3,7 @@ package org.opengroup.osdu.legal.util; import org.apache.commons.text.StringEscapeUtils; import com.google.common.base.Strings; -import javax.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; public class HtmlEncodeAdapter extends XmlAdapter<String, String> { diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java b/legal-core/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java index fb801f858c68ff06dfb5a075eb7fa0c861f65f05..f31653375bbeb08271d5e1ef63fbbac4951b7b06 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java @@ -5,7 +5,7 @@ import org.opengroup.osdu.legal.tags.LegalTagConstraintValidator; import org.opengroup.osdu.core.common.model.legal.validation.rules.Rule; import org.opengroup.osdu.core.common.model.http.RequestInfo; -import javax.validation.*; +import jakarta.validation.*; import java.util.*; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/controller/LegalTagControllerTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/controller/LegalTagControllerTests.java index 97df3b0d94b001c0d67acad0443cba7c5ae24540..5d6edae9a86965ed4bba7e901adedcfb9b1c8d30 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/controller/LegalTagControllerTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/controller/LegalTagControllerTests.java @@ -25,7 +25,7 @@ import org.opengroup.osdu.legal.tags.dto.UpdateLegalTag; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import javax.validation.ValidationException; +import jakarta.validation.ValidationException; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapperTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapperTests.java index 92ca85badc9ab5ec2ff4869dee78a0b08da84747..5669db9e049118cfdfbd16c7ae926835bccac330 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapperTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/GlobalExceptionMapperTests.java @@ -19,9 +19,9 @@ import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.context.request.WebRequest; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.ValidationException; import java.io.IOException; import java.util.Collections; import java.util.HashSet; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/LegalFilterTest.java b/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/LegalFilterTest.java index f7574fe8a6e243ae76eb74761a528180779fa788..6fccf79bbce386d83ba1282cf519941e124f5db4 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/LegalFilterTest.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/middleware/LegalFilterTest.java @@ -11,10 +11,10 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.http.Request; import org.opengroup.osdu.core.common.model.http.RequestInfo; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Collections; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImplTest.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImplTest.java index 90fd53a02fd99641d7d8e9e3f6b7d74967ad71b2..5939c70c834e18091a5ba7bc039da5d7269ae627 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImplTest.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dataaccess/LegalTagRepositoryFactoryImplTest.java @@ -9,7 +9,7 @@ import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory; import org.opengroup.osdu.legal.provider.interfaces.ILegalTagRepository; -import javax.inject.Inject; +import jakarta.inject.Inject; import static org.junit.Assert.*; import static org.mockito.Mockito.when; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTagsTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTagsTests.java index a6a3d9acf458c05547f9ea0094e1b498d4f36b6a..193a4e3d817dab5d645ce03607569687ad12f5ec 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTagsTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/dto/RequestLegalTagsTests.java @@ -3,10 +3,10 @@ package org.opengroup.osdu.legal.tags.dto; import org.junit.BeforeClass; import org.junit.Test; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java index 1226db0b80ed81d276f79ed66bf2161fc373837e..c96bf32d51331d62f95fef14271595975219fedf 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java @@ -8,7 +8,7 @@ import org.opengroup.osdu.legal.MockRule; import org.opengroup.osdu.legal.MockValidationValidator; import org.opengroup.osdu.legal.tags.validation.rules.UnownedDataRule; -import javax.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolation; import java.time.LocalDate; import java.util.*; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java index b5ec0de0cb078f82f40f41a4890d2810dda091ef..7ef1418ed6df7350b9764d0c37dc52dda5189edd 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java @@ -14,8 +14,8 @@ import org.junit.Test; import java.util.*; -import javax.validation.ConstraintViolation; -import javax.validation.Validator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertTrue; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java index 0309e823b4db6e69f83f0c9af477400312c45a1a..536dbfdda7dadb05d3c9c92a4eec54875f109b24 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java @@ -8,7 +8,7 @@ import org.opengroup.osdu.core.common.model.legal.Properties; import org.junit.BeforeClass; import org.junit.Test; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import java.sql.Date; import java.time.LocalDate; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/SecurityClassificationValidatorTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/SecurityClassificationValidatorTests.java index 46996c5711d6bf56426605398ca2f201bc428648..0e25f8aaf5c1eb93d96c72c60325cafabf63cbb7 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/SecurityClassificationValidatorTests.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/SecurityClassificationValidatorTests.java @@ -5,7 +5,7 @@ import org.opengroup.osdu.core.common.model.legal.AllowedLegaltagPropertyValues; import org.junit.BeforeClass; import org.junit.Test; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/util/RequestInfoTest.java b/legal-core/src/test/java/org/opengroup/osdu/legal/util/RequestInfoTest.java index 643e93eceab806525688226a68fde0cc99694a1e..02be9c59d55925a95416f9da9568486e81dd1a31 100644 --- a/legal-core/src/test/java/org/opengroup/osdu/legal/util/RequestInfoTest.java +++ b/legal-core/src/test/java/org/opengroup/osdu/legal/util/RequestInfoTest.java @@ -13,7 +13,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 java.util.ArrayList; import java.util.Collections; diff --git a/pom.xml b/pom.xml index f876a4bdbd012bff0e578efb993f81f3db07d791..ea514d0dbfa3c146622184cc26258d4fdd03323a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,14 +8,15 @@ <maven.compiler.source>17</maven.compiler.source> <docker.image.prefix>opendes</docker.image.prefix> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <os-core-common.version>0.25.0</os-core-common.version> + <os-core-common.version>0.26.0-rc2</os-core-common.version> <snakeyaml.version>2.0</snakeyaml.version> <resilience4jVersion>1.7.0</resilience4jVersion> <openapi.version>1.6.14</openapi.version> - <log4j.version>2.17.1</log4j.version> <json-smart.version>2.5.0</json-smart.version> - <jackson-databind.version>2.14.0</jackson-databind.version> - <jackson.version>2.14.0</jackson.version> + <jackson.version>2.16.1</jackson.version> + <spring-framework-version>6.1.4</spring-framework-version> + <spring-boot.version>3.2.3</spring-boot.version> + <spring-security.version>6.2.2</spring-security.version> </properties> <licenses> @@ -37,7 +38,6 @@ <module>legal-core</module> <module>legal-core-plus</module> <module>provider/legal-gc</module> - <module>provider/legal-byoc</module> <module>provider/legal-azure</module> <module>provider/legal-aws</module> <module>provider/legal-ibm</module> @@ -62,54 +62,41 @@ </distributionManagement> <dependencyManagement> - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - <type>pom</type> - <scope>import</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-config</artifactId> - <version>5.7.11</version> - </dependency> + <dependencies> <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-crypto</artifactId> - <version>5.7.11</version> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>2.10.1</version> </dependency> <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-web</artifactId> - <version>5.7.11</version> + <groupId>org.springframework</groupId> + <artifactId>spring-framework-bom</artifactId> + <version>${spring-framework-version}</version> + <type>pom</type> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-dependencies</artifactId> + <version>${spring-boot.version}</version> + <type>pom</type> + <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core</artifactId> - <version>5.7.11</version> + <artifactId>spring-security-bom</artifactId> + <version>${spring-security.version}</version> + <type>pom</type> </dependency> <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> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${os-core-common.version}</version> <exclusions> <exclusion> @@ -132,35 +119,16 @@ <artifactId>snakeyaml</artifactId> <version>${snakeyaml.version}</version> </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${log4j.version}</version> - </dependency> <dependency> <groupId>net.minidev</groupId> <artifactId>json-smart</artifactId> <version>${json-smart.version}</version> </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-annotations</artifactId> - <version>${jackson.version}</version> - </dependency> <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>${jackson-databind.version}</version> + <groupId>com.fasterxml.jackson</groupId> + <artifactId>jackson-bom</artifactId> + <version>${jackson.version}</version> + <type>pom</type> </dependency> <dependency> <groupId>commons-beanutils</groupId> @@ -169,13 +137,13 @@ </dependency> </dependencies> </dependencyManagement> - + <dependencies> <!--Swagger--> <dependency> <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-ui</artifactId> - <version>${openapi.version}</version> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>2.3.0</version> </dependency> </dependencies> @@ -204,7 +172,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>3.2.2</version> <executions> <execution> <id>build-info</id> diff --git a/provider/legal-aws/pom.xml b/provider/legal-aws/pom.xml index 1044fd391637fa289834b8381b4355663afd2efc..3382fa158334f14b91d07c529a10213da853d0c3 100644 --- a/provider/legal-aws/pom.xml +++ b/provider/legal-aws/pom.xml @@ -35,7 +35,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.26.0-rc2</version> + <version>0.26.0-spring6-rc1</version> </dependency> <dependency> <groupId>org.opengroup.osdu.legal</groupId> @@ -55,16 +55,15 @@ <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-oauth2-client</artifactId> - <version>5.8.2</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-oauth2-jose</artifactId> </dependency> <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <version>2.0.1</version> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -92,14 +91,10 @@ <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-inline</artifactId> - <scope>test</scope> - </dependency> <dependency> <groupId>de.flapdoodle.embed</groupId> <artifactId>de.flapdoodle.embed.mongo</artifactId> + <version>4.12.2</version> <scope>test</scope> </dependency> </dependencies> @@ -109,7 +104,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>3.2.2</version> <executions> <execution> <goals> diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderFactoryImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderFactoryImpl.java index 5a8c1b11ac1f0219c273712bc7c6bc0878fb6033..210e971f15b2ba2de2fc360ce287ddb6c53796da 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderFactoryImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderFactoryImpl.java @@ -20,7 +20,7 @@ import org.opengroup.osdu.legal.provider.interfaces.IStorageReader; import org.opengroup.osdu.legal.provider.interfaces.IStorageReaderFactory; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component public class StorageReaderFactoryImpl implements IStorageReaderFactory { diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderImpl.java index 4430fdf0d05adf67189961d185ef06ce2603a166..695317e97defd4b3a3ed942a8348d952326a02a3 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/countries/StorageReaderImpl.java @@ -28,7 +28,7 @@ import org.opengroup.osdu.legal.provider.interfaces.IStorageReader; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component public class StorageReaderImpl implements IStorageReader { diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/entitlements/AWSAuthorizationServiceImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/entitlements/AWSAuthorizationServiceImpl.java index 5256b4907b122bdf212c4f7ee4a41dbd1e35fbef..0eb3f8471e1af8844d044ae5f215593dc97e7ca7 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/entitlements/AWSAuthorizationServiceImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/entitlements/AWSAuthorizationServiceImpl.java @@ -35,7 +35,7 @@ import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/jobs/LegalTagPublisherImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/jobs/LegalTagPublisherImpl.java index b7f119367190bc8b123650b8cdb82f198c6b24a7..f549a842731db9623d5d8ecfea1f842d46a4d957 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/jobs/LegalTagPublisherImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/jobs/LegalTagPublisherImpl.java @@ -31,8 +31,8 @@ import org.opengroup.osdu.legal.provider.interfaces.ILegalTagPublisher; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.inject.Inject; import java.util.List; import java.util.stream.Collectors; diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryFactoryAwsImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryFactoryAwsImpl.java index 0dada3ddfc6a6714cb2c39ad42cac50ca04b7e4e..cf62a9534dbd40b075cd471fed5631822ab750d0 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryFactoryAwsImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryFactoryAwsImpl.java @@ -29,7 +29,7 @@ import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import org.springframework.web.context.annotation.RequestScope; -import javax.inject.Inject; +import jakarta.inject.Inject; @ConditionalOnProperty(prefix = "repository", name = "implementation",havingValue = "dynamodb", diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryImpl.java index 17663cab336b3444ddee2e697b9a41caa9ba9e85..905b6fd0a8639fc49f2ccf5bc71ab49d937074ed 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/LegalTagRepositoryImpl.java @@ -34,7 +34,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Repository; import org.springframework.web.context.annotation.RequestScope; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.io.UnsupportedEncodingException; import java.util.*; diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryFactoryMongoDBImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryFactoryMongoDBImpl.java index 6b87c667a12f8542bf6bc095e5a2da0a5e518d9b..00583ef17cd00e71f2de4e07eb37eabac14354af 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryFactoryMongoDBImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryFactoryMongoDBImpl.java @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; -import javax.inject.Inject; +import jakarta.inject.Inject; /** * The type Legal tag repository factory MongoDb. diff --git a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryMongoDBImpl.java b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryMongoDBImpl.java index 0f20d07e4542f622a655c9cb09c97f6e8fbbc285..6c8c6de19d95dab9fbcc5eb24d6230ec69b4e74e 100644 --- a/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryMongoDBImpl.java +++ b/provider/legal-aws/src/main/java/org/opengroup/osdu/legal/aws/tags/dataaccess/mongodb/repository/LegalTagRepositoryMongoDBImpl.java @@ -30,7 +30,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.Arrays; import java.util.Collection; import java.util.List; diff --git a/provider/legal-azure/pom.xml b/provider/legal-azure/pom.xml index 672dbe16a2f664d4529224f9b291e1d55790016c..5b530858f77a52305326578bb77d54c3452a4ad0 100644 --- a/provider/legal-azure/pom.xml +++ b/provider/legal-azure/pom.xml @@ -31,14 +31,13 @@ <azure.appservice.plan /> <azure.appservice.appname /> <azure.appservice.subscription /> - <osdu.corelibazure.version>0.26.0-rc5</osdu.corelibazure.version> + <osdu.corelibazure.version>0.26.0-rc6</osdu.corelibazure.version> <osdu.legal-core.version>0.26.0-SNAPSHOT</osdu.legal-core.version> - <javax.inject.version>1</javax.inject.version> - <javax.servlet-api.version>4.0.1</javax.servlet-api.version> <woodstox-core.version>6.4.0</woodstox-core.version> <netty.version>4.1.101.Final</netty.version> <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine> <reactor-netty-http.version>1.1.13</reactor-netty-http.version> + <azure-active-directory.version>5.10.0</azure-active-directory.version> </properties> <dependencyManagement> @@ -52,39 +51,13 @@ <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> - <version>${osdu.corelibazure.version}</version> + <groupId>com.azure.spring</groupId> + <artifactId>spring-cloud-azure-starter-active-directory</artifactId> + <version>${azure-active-directory.version}</version> <type>pom</type> <scope>import</scope> </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jul</artifactId> - <version>${log4j.version}</version> - </dependency> </dependencies> </dependencyManagement> @@ -95,26 +68,20 @@ <version>${osdu.legal-core.version}</version> </dependency> <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>${javax.inject.version}</version> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <version>2.0.1</version> </dependency> <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>${javax.servlet-api.version}</version> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <version>6.0.0</version> <scope>provided</scope> </dependency> - <dependency> <groupId>com.azure.spring</groupId> - <artifactId>azure-spring-boot-starter-active-directory</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-logging</artifactId> - </exclusion> - </exclusions> + <artifactId>spring-cloud-azure-starter-active-directory</artifactId> + <version>${azure-active-directory.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -123,21 +90,10 @@ <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>org.springframework.security</groupId> <artifactId>spring-security-oauth2-client</artifactId> - <version>5.8.2</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> @@ -145,7 +101,7 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-azure</artifactId> + <artifactId>core-lib-azure-spring6</artifactId> <version>${osdu.corelibazure.version}</version> </dependency> <dependency> @@ -160,11 +116,6 @@ <artifactId>woodstox-core</artifactId> <version>${woodstox-core.version}</version> </dependency> - <dependency> - <groupId>io.projectreactor.netty</groupId> - <artifactId>reactor-netty-http</artifactId> - <version>${reactor-netty-http.version}</version> - </dependency> <!-- test --> <dependency> diff --git a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/countries/StorageReaderFactoryImpl.java b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/countries/StorageReaderFactoryImpl.java index 48789eba272e6571e47ac211eb6cbdf35be0fcb7..83593e4d81af4654d8a30003f1d657e38c3eb6f8 100644 --- a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/countries/StorageReaderFactoryImpl.java +++ b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/countries/StorageReaderFactoryImpl.java @@ -14,8 +14,8 @@ package org.opengroup.osdu.legal.azure.countries; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.inject.Inject; +import jakarta.inject.Named; import org.opengroup.osdu.azure.blobstorage.BlobStore; import org.opengroup.osdu.core.common.model.http.DpsHeaders; diff --git a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/di/AzureBootstrapConfig.java b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/di/AzureBootstrapConfig.java index c87b4be82ce11d81bf3f496987387157e081a37a..51e1238ec984738cdbe11a2a2a4fef5e468103cd 100644 --- a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/di/AzureBootstrapConfig.java +++ b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/di/AzureBootstrapConfig.java @@ -18,7 +18,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 AzureBootstrapConfig { diff --git a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/jobs/LegalTagPublisherImpl.java b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/jobs/LegalTagPublisherImpl.java index dfd1cd860d4d6133e2ef1272e494c2b8af8cc887..48ffbca20bcd373a884b38a82b6f2043f9e08056 100644 --- a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/jobs/LegalTagPublisherImpl.java +++ b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/jobs/LegalTagPublisherImpl.java @@ -29,8 +29,8 @@ import org.opengroup.osdu.legal.provider.interfaces.ILegalTagPublisher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.inject.Inject; -import javax.inject.Named; +import jakarta.inject.Inject; +import jakarta.inject.Named; import java.nio.charset.StandardCharsets; import java.util.UUID; import java.util.Map; diff --git a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AADSecurityConfig.java b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AADSecurityConfig.java index 5ef65f881e462011846e5f4d327c9e7c469d639d..d022774a64e16503dc35bc470d698cd475200108 100644 --- a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AADSecurityConfig.java +++ b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AADSecurityConfig.java @@ -14,21 +14,23 @@ package org.opengroup.osdu.legal.azure.security; -import com.azure.spring.autoconfigure.aad.AADAppRoleStatelessAuthenticationFilter; + +import com.azure.spring.cloud.autoconfigure.implementation.aad.filter.AadAppRoleStatelessAuthenticationFilter; +import jakarta.inject.Inject; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.context.annotation.Bean; +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.EnableWebSecurity; -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; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import javax.inject.Inject; - @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) +@EnableMethodSecurity @ConditionalOnProperty(value = "azure.istio.auth.enabled", havingValue = "false", matchIfMissing = false) -public class AADSecurityConfig extends WebSecurityConfigurerAdapter { +public class AADSecurityConfig{ private static final String[] AUTH_ALLOWLIST = {"/", "/index.html", "/api-docs.yaml", @@ -39,18 +41,15 @@ public class AADSecurityConfig extends WebSecurityConfigurerAdapter { "/swagger-ui/**" }; @Inject - private AADAppRoleStatelessAuthenticationFilter appRoleAuthFilter; + private AadAppRoleStatelessAuthenticationFilter appRoleAuthFilter; - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .csrf().disable() - .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER) - .and() - .authorizeRequests() - .antMatchers(AUTH_ALLOWLIST).permitAll() - .anyRequest().authenticated() - .and() - .addFilterBefore(appRoleAuthFilter, UsernamePasswordAuthenticationFilter.class); + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + return http + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement((sess) -> sess.sessionCreationPolicy(SessionCreationPolicy.NEVER)) + .authorizeHttpRequests(request -> request.requestMatchers(AUTH_ALLOWLIST).permitAll()) + .addFilterBefore(appRoleAuthFilter, UsernamePasswordAuthenticationFilter.class) + .build(); } } diff --git a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AzureIstioSecurityConfig.java b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AzureIstioSecurityConfig.java index 2de6575c262f49d71fa75ae25a1466e762275b66..2219083e7abecd3d7aac7cde3256d1b4606b0e86 100644 --- a/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AzureIstioSecurityConfig.java +++ b/provider/legal-azure/src/main/java/org/opengroup/osdu/legal/azure/security/AzureIstioSecurityConfig.java @@ -15,21 +15,33 @@ package org.opengroup.osdu.legal.azure.security; +import static org.springframework.security.config.Customizer.withDefaults; + import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +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.EnableWebSecurity; -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 @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) +@EnableMethodSecurity @ConditionalOnProperty(value = "azure.istio.auth.enabled", havingValue = "true", matchIfMissing = true) -public class AzureIstioSecurityConfig extends WebSecurityConfigurerAdapter { +public class AzureIstioSecurityConfig{ + - @Override - protected void configure(HttpSecurity http) throws Exception { - http.httpBasic().disable() - .csrf().disable(); //AuthN is disabled. AuthN is handled by sidecar 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(); } } diff --git a/provider/legal-byoc/pom.xml b/provider/legal-byoc/pom.xml deleted file mode 100644 index ecf7414817e78e51d6d7297e354cc57370e37ed6..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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"> - <parent> - <artifactId>legal-service</artifactId> - <groupId>org.opengroup.osdu.legal</groupId> - <version>0.26.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>legal-byoc</artifactId> - <packaging>jar</packaging> - - <dependencies> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - </dependency> - <dependency> - <groupId>org.opengroup.osdu.legal</groupId> - <artifactId>legal-core</artifactId> - <version>0.26.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-security</artifactId> - </dependency> - - <!-- https://mvnrepository.com/artifact/javax.inject/javax.inject --> - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <version>2.0.2</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-test</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> - <executions> - <execution> - <goals> - <goal>repackage</goal> - </goals> - <configuration> - <classifier>spring-boot</classifier> - <mainClass> - org.opengroup.osdu.legal.byoc.LegalApplication - </mainClass> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/LegalApplication.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/LegalApplication.java deleted file mode 100644 index f3d2bf9ac7b6927650e556948c68198cf4e88911..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/LegalApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.PropertySource; - -@ComponentScan({"org.opengroup.osdu.legal","org.opengroup.osdu.core.common"}) -@PropertySource("classpath:swagger.properties") -@SpringBootApplication -public class LegalApplication { - public static void main(String[] args) - { - SpringApplication.run(LegalApplication.class, args); - } -} diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/countries/StorageReaderFactoryImpl.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/countries/StorageReaderFactoryImpl.java deleted file mode 100644 index 31e6582ad8456bc48cbdd7b2f8635f80e0e19369..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/countries/StorageReaderFactoryImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.countries; - -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.legal.provider.interfaces.IStorageReader; -import org.opengroup.osdu.legal.provider.interfaces.IStorageReaderFactory; -import org.springframework.stereotype.Component; - -@Component -public class StorageReaderFactoryImpl implements IStorageReaderFactory { - - @Override - public IStorageReader getReader(TenantInfo tenant, String projectRegion) { - return new StorageReaderImpl(tenant, projectRegion); - } -} diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/countries/StorageReaderImpl.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/countries/StorageReaderImpl.java deleted file mode 100644 index ab182ddd7f6a1454517a85b98506e942a343f6b9..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/countries/StorageReaderImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.countries; - -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.legal.provider.interfaces.IStorageReader; - -public class StorageReaderImpl implements IStorageReader { - private final TenantInfo tenantInfo; - private final String cloudRegion; - - public StorageReaderImpl(TenantInfo tenantInfo, String cloudRegion) { - this.tenantInfo = tenantInfo; - this.cloudRegion = cloudRegion; - } - - @Override - public byte[] readAllBytes() { - return ("").getBytes(); //should return a json format of an array of Country class - } -} diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/EntitlementsFactoryByoc.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/EntitlementsFactoryByoc.java deleted file mode 100644 index c47bf7ef5fb034a8f515223bad33b7bf0f3e8dc0..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/EntitlementsFactoryByoc.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.di; - -import org.opengroup.osdu.core.common.model.http.DpsHeaders; -import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; -import org.opengroup.osdu.core.common.entitlements.IEntitlementsService; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Component; - -@Component -@Primary -public class EntitlementsFactoryByoc implements IEntitlementsFactory { - @Override - public IEntitlementsService create(DpsHeaders headers) { - return new EntitlementsServiceByoc(headers); - } -} - diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/EntitlementsServiceByoc.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/EntitlementsServiceByoc.java deleted file mode 100644 index 04a886880e504a1281b8a8eff76131b9a64052de..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/EntitlementsServiceByoc.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.di; - -import org.apache.http.HttpStatus; -import org.opengroup.osdu.core.common.model.entitlements.*; -import org.opengroup.osdu.core.common.model.http.DpsHeaders; -import org.opengroup.osdu.core.common.entitlements.IEntitlementsService; -import org.opengroup.osdu.core.common.model.legal.ServiceConfig; -import org.opengroup.osdu.core.common.http.HttpResponse; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.context.SecurityContextHolder; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class EntitlementsServiceByoc implements IEntitlementsService { - DpsHeaders headers; - - public EntitlementsServiceByoc(DpsHeaders headers) { - this.headers = headers; - } - - @Override - public MemberInfo addMember(GroupEmail groupEmail, MemberInfo memberInfo) throws EntitlementsException { - return null; - } - - @Override - public Members getMembers(GroupEmail groupEmail, GetMembers getMembers) throws EntitlementsException { - return null; - } - - @Override - public Groups getGroups() throws EntitlementsException { - Authentication auth = SecurityContextHolder.getContext().getAuthentication(); - String email = auth.getName(); - List<GroupInfo> giList = new ArrayList(); - Collection<? extends GrantedAuthority> authorities = auth.getAuthorities(); - for (GrantedAuthority authority : authorities) { - GroupInfo gi = new GroupInfo(); - String role = authority.getAuthority(); - if (role.startsWith(ServiceConfig.PREFIX)) { - role = role.substring(ServiceConfig.PREFIX.length()); - } - gi.setName(role); - gi.setEmail(email); - giList.add(gi); - } - if (giList.size() > 0) { - Groups groups = new Groups(); - groups.setGroups(giList); - groups.setDesId(email); - return groups; - } - - HttpResponse response = new HttpResponse(); - response.setResponseCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); - throw new EntitlementsException("no authorities found", response); - } - - @Override - public GroupInfo createGroup(CreateGroup createGroup) throws EntitlementsException { - return null; - } - - @Override - public void deleteMember(String s, String s1) throws EntitlementsException { - } - - @Override - public Groups authorizeAny(String... strings) throws EntitlementsException { - return null; - } - - @Override - public void authenticate() throws EntitlementsException { - } -} diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/TenantFactoryImpl.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/TenantFactoryImpl.java deleted file mode 100644 index 0d6b85203fef66e07dfb311804fa5e8e3227746f..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/di/TenantFactoryImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.di; - -import org.opengroup.osdu.core.common.cache.ICache; -import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory; -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.springframework.stereotype.Component; - -import java.util.*; - -@Component -public class TenantFactoryImpl implements ITenantFactory { - public static final String[] REGISTERED_TENANTS = new String[] {"common", "opendes"}; - private Map<String, TenantInfo> tenants; - - public TenantFactoryImpl() - { - this.tenants = new HashMap<>(); - for (String tenantName : REGISTERED_TENANTS) { - TenantInfo ti = new TenantInfo(); - ti.setName(tenantName); - ti.setComplianceRuleSet(tenantName.equals("common") ? - TenantInfo.ComplianceRuleSets.SHARED : TenantInfo.ComplianceRuleSets.CUSTOMER); - this.tenants.put(tenantName, ti); - } - } - - public boolean exists(String tenantName) - { - return this.tenants.containsKey(tenantName); - } - - public TenantInfo getTenantInfo(String tenantName) { - return this.tenants.get(tenantName); - } - - public Collection<TenantInfo> listTenantInfo() { - return this.tenants.values(); - } - - public <V> ICache<String, V> createCache(String tenantName, String host, int port, int expireTimeSeconds, Class<V> classOfV) - { - return null; - } - - public void flushCache() {} -} - diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/jobs/LegalTagPublisherImpl.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/jobs/LegalTagPublisherImpl.java deleted file mode 100644 index 24fbcbb4cbadfcb7c3f8fa343c89b7962397203b..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/jobs/LegalTagPublisherImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.jobs; - -import org.opengroup.osdu.core.common.model.http.DpsHeaders; -import org.opengroup.osdu.core.common.model.legal.StatusChangedTags; -import org.opengroup.osdu.legal.provider.interfaces.ILegalTagPublisher; -import org.springframework.stereotype.Service; - -@Service -public class LegalTagPublisherImpl implements ILegalTagPublisher { - @Override - public void publish(String projectId, DpsHeaders headers, StatusChangedTags tags) throws Exception { - - } -} diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/security/BasicAuthSecurityConfig.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/security/BasicAuthSecurityConfig.java deleted file mode 100644 index 061d998edcf5ad87abd3099b275668db4a0a588f..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/security/BasicAuthSecurityConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.security; - -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class BasicAuthSecurityConfig extends WebSecurityConfigurerAdapter { - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .csrf().disable() - .authorizeRequests() - //.antMatchers("/v2/api-docs", - // "/configuration/ui", - // "/swagger-resources/**", - // "/configuration/security", - // "/swagger-ui.html", - // "/webjars/**").permitAll() - .anyRequest().authenticated() - .and() - .httpBasic(); - } -} diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/security/WhoamiController.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/security/WhoamiController.java deleted file mode 100644 index f280503217074c3373dbbceba4e9170546e7f3ef..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/security/WhoamiController.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.security; - -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class WhoamiController { - @RequestMapping(value = {"/", "/whoami"}) - @ResponseBody - public String whoami() { - final Authentication auth = SecurityContextHolder.getContext().getAuthentication(); - - String userName = auth.getName(); - String roles = String.valueOf(auth.getAuthorities()); - String details = String.valueOf(auth.getPrincipal()); - - return "user: " + userName + "<BR>" + - "roles: " + roles + "<BR>" + - "details: " + details; - } -} - diff --git a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/tags/dataaccess/LegalTagRepositoryImpl.java b/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/tags/dataaccess/LegalTagRepositoryImpl.java deleted file mode 100644 index 02c04cf0f063259d794fb790b5d38389f41431d3..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/java/org/opengroup/osdu/legal/byoc/tags/dataaccess/LegalTagRepositoryImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright © Microsoft Corporation -// -// 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 -// -// 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.legal.byoc.tags.dataaccess; - -import org.opengroup.osdu.core.common.model.legal.LegalTag; -import org.opengroup.osdu.core.common.model.legal.ListLegalTagArgs; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.legal.provider.interfaces.ILegalTagRepository; - -import org.springframework.stereotype.Repository; - -import java.util.*; - -@Repository -public class LegalTagRepositoryImpl implements ILegalTagRepository { - private Map<Long, LegalTag> memMap = new HashMap<>(); - - @Override - public Long create(LegalTag legalTag) { - Long id = -1L; - - if(legalTag != null) { - memMap.put(legalTag.getId(), legalTag); - id = legalTag.getId(); - } - return id; - } - - @Override - public Collection<LegalTag> get(long[] ids) { - List<LegalTag> output = new ArrayList<>(); - - if(ids != null && ids.length > 0) { - for(long id : ids) - { - if (memMap.containsKey(id)) - output.add(memMap.get(id)); - } - } - return output; - } - - @Override - public Boolean delete(LegalTag legalTag) { - boolean removed = false; - - Long id = legalTag.getId(); - if (memMap.containsKey(id)) { - memMap.remove(id); - removed = true; - } - - return removed; - } - - @Override - public LegalTag update(LegalTag newLegalTag) { - if(newLegalTag == null) - return null; - - Long id = newLegalTag.getId(); - LegalTag currentLegalTag = memMap.get(id); - if (currentLegalTag == null) - throw AppException.legalTagDoesNotExistError(newLegalTag.getName()); - - memMap.remove(id); - memMap.put(id, newLegalTag); - - return newLegalTag; - } - - @Override - public Collection<LegalTag> list(ListLegalTagArgs args) { - List<LegalTag> output = new ArrayList<>(); - - for (LegalTag legalTag : memMap.values()) { - if (legalTag.getIsValid() == args.getIsValid()) - output.add(legalTag); - } - - return output; - } -} diff --git a/provider/legal-byoc/src/main/resources/application.properties b/provider/legal-byoc/src/main/resources/application.properties deleted file mode 100644 index 0a9ce95386db6a086c53e1a92e2fc6601e4eb3a8..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/main/resources/application.properties +++ /dev/null @@ -1,12 +0,0 @@ -LOG_PREFIX=legal - -server.servlet.contextPath=/api/legal/v1/ - -spring.security.user.name=opendes@byoc.local -spring.security.user.password=123 -spring.security.user.roles=service.legal.admin - -REGION=us-central -AUTHORIZE_API=notused -LEGAL_HOSTNAME=notused -CRON_JOB_IP=10.0.0.1 \ No newline at end of file diff --git a/provider/legal-byoc/src/test/java/org/opengroup/osdu/legal/byoc/controller/LegalTagControllerTest.java b/provider/legal-byoc/src/test/java/org/opengroup/osdu/legal/byoc/controller/LegalTagControllerTest.java deleted file mode 100644 index 0740f6d233c3a86d266702a702e25ed4bbaaf3c1..0000000000000000000000000000000000000000 --- a/provider/legal-byoc/src/test/java/org/opengroup/osdu/legal/byoc/controller/LegalTagControllerTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.opengroup.osdu.legal.byoc.controller; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.MethodSorters; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.core.common.model.http.RequestInfo; -import org.opengroup.osdu.legal.controller.LegalTagController; -import org.opengroup.osdu.legal.byoc.LegalApplication; -import org.opengroup.osdu.legal.tags.LegalTagService; -import org.opengroup.osdu.legal.tags.dto.LegalTagDto; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.core.common.model.legal.ServiceConfig; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.HttpStatus; -import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.inject.Inject; - -import static org.mockito.Mockito.when; -import static org.mockito.MockitoAnnotations.initMocks; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes={LegalApplication.class}) -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class LegalTagControllerTest { - @Mock - TenantInfo tenantInfo; - - @Mock - LegalTagService legalTagService; - - @Mock - RequestInfo requestInfo; - - @InjectMocks - @Inject - private LegalTagController sut; - - @Before - public void Setup() { - initMocks(this); - when(requestInfo.getTenantInfo()).thenReturn(tenantInfo); - } - - @Test(expected = AuthenticationCredentialsNotFoundException.class) - public void givenUnauthenticated_whenCallCreateLegalTag_thenThrowsException(){ - LegalTagDto legalTag = new LegalTagDto(); - this.sut.createLegalTag(legalTag); - } - - @WithMockUser(username="admin", roles={ServiceConfig.LEGAL_ADMIN}) - @Test - public void given1AuthenticatedAdmin_whenCallCreateLegalTag_thenOk() { - LegalTagDto legalTag = new LegalTagDto(); - Assert.assertEquals(HttpStatus.CREATED, this.sut.createLegalTag(legalTag).getStatusCode()); - } - - @WithMockUser(username="viewer", roles={ServiceConfig.LEGAL_USER}) - @Test - public void givenAuthenticatedViewer_whenCallCreateLegalTag_thenForbidden() { - try { - LegalTagDto legalTag = new LegalTagDto(); - this.sut.createLegalTag(legalTag); - } catch (AppException e) { - Assert.assertEquals(HttpStatus.UNAUTHORIZED.value(), e.getError().getCode()); - } - } - - @WithMockUser(username="viewer", roles={ServiceConfig.LEGAL_USER}) - @Test - public void given2AuthenticatedViewer_whenCallGetLegalTag_thenOK() { - Assert.assertEquals(HttpStatus.OK, this.sut.listLegalTags(true).getStatusCode()); - } -} diff --git a/provider/legal-gc/pom.xml b/provider/legal-gc/pom.xml index 531555a943a6170fc1db46d344e3a4227320dd46..c089ab10cfb66d77992add678ffbf4b7d5189b92 100644 --- a/provider/legal-gc/pom.xml +++ b/provider/legal-gc/pom.xml @@ -9,7 +9,6 @@ <relativePath>../../pom.xml</relativePath> </parent> - <groupId>org.opengroup.osdu.legal</groupId> <artifactId>legal-gc</artifactId> <version>0.26.0-SNAPSHOT</version> <packaging>jar</packaging> @@ -18,19 +17,6 @@ <dependencyManagement> <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - <type>pom</type> - <scope>import</scope> - </dependency> - <dependency> <groupId>com.google.cloud</groupId> <artifactId>libraries-bom</artifactId> @@ -57,21 +43,6 @@ <version>4.9.2</version> <scope>compile</scope> </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>2.13.4</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.13.4.2</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - <version>2.13.4</version> - </dependency> </dependencies> </dependencyManagement> @@ -94,26 +65,25 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-gc</artifactId> - <version>0.25.0</version> + <artifactId>core-lib-gc-spring6</artifactId> + <version>0.26.0-rc4</version> </dependency> <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>4.0.1</version> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <version>6.0.0</version> <scope>provided</scope> </dependency> - <dependency> + <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> <version>6.1.23</version> </dependency> - <!-- https://mvnrepository.com/artifact/javax.inject/javax.inject --> <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <version>2.0.1</version> </dependency> <dependency> diff --git a/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/LegalApplication.java b/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/LegalApplication.java index b8e1b0bbd63f746529c3af843ff9308b38876016..820211b15bfd9b06ea74a15c514eb8c4453fed42 100644 --- a/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/LegalApplication.java +++ b/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/LegalApplication.java @@ -23,18 +23,18 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; -@ComponentScan({"org.opengroup.osdu"}) +@ComponentScan(value = {"org.opengroup.osdu"}) @PropertySource("classpath:swagger.properties") @SpringBootApplication public class LegalApplication extends SpringBootServletInitializer { - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(LegalApplication.class); - } + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(LegalApplication.class); + } - public static void main(String[] args) { - SpringApplication.run(LegalApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(LegalApplication.class, args); + } } diff --git a/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java b/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java index 6520ee7bd4f809ef8258aa0cbb6759f019808abe..0ef72160906a8369ce4605cfe35a0b02797b6609 100644 --- a/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java +++ b/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/jobs/LegalTagPublisherImpl.java @@ -24,7 +24,7 @@ import com.google.gson.JsonElement; import java.time.Instant; import java.util.HashMap; import java.util.Map; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.legal.StatusChangedTags; diff --git a/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java b/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java index 1a44d40b6069d0031825b7eabeabe844c848256b..e08b22f69b833c1fbd443b629f0162f1a134a378 100644 --- a/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java +++ b/provider/legal-gc/src/main/java/org/opengroup/osdu/legal/security/GSuiteSecurityConfiguration.java @@ -1,44 +1,68 @@ /* - * Copyright 2021 Google LLC - * Copyright 2021 EPAM Systems, Inc + * Copyright 2020-2023 Google LLC + * Copyright 2020-2023 EPAM Systems, Inc * - * 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 * - * https://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.legal.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.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -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 @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class GSuiteSecurityConfiguration extends WebSecurityConfigurerAdapter { +@EnableMethodSecurity +public class GSuiteSecurityConfiguration { - @Override - protected void configure(HttpSecurity http) throws Exception { - http.httpBasic().disable() - .csrf().disable(); //disable default authN. AuthN handled by endpoints proxy - } + private static final String[] AUTH_ALLOWLIST = { + "/", + "/index.html", + "/api-docs.yaml", + "/api-docs/swagger-config", + "/api-docs/**", + "/swagger", + "/swagger-ui.html", + "/swagger-ui/**", + "/legaltags", + "/legaltags/**", + "/legaltags:batchRetrieve", + "/legaltags:validate", + "/legaltags:properties", + "/updateLegalTagStatus", + "/info", + "/_ah/liveness_check", + "/_ah/readiness_check" + }; - @Override - public void configure(WebSecurity web) throws Exception { - web.ignoring().antMatchers("/api-docs") - .antMatchers("/index") - .antMatchers("/info") - .antMatchers("/swagger"); + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http + .cors(AbstractHttpConfigurer::disable) + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize + .requestMatchers(AUTH_ALLOWLIST).permitAll() + .anyRequest().denyAll() + ) + .httpBasic(withDefaults()); + return http.build(); } } diff --git a/provider/legal-gc/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java b/provider/legal-gc/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java deleted file mode 100644 index 324a4feaf457889aeacaf3022afb98149d9af23f..0000000000000000000000000000000000000000 --- a/provider/legal-gc/src/test/java/org/opengroup/osdu/legal/MockValidationValidator.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.opengroup.osdu.legal; - -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.core.common.model.http.RequestInfo; -import org.opengroup.osdu.core.common.model.legal.validation.rules.Rule; -import org.opengroup.osdu.legal.tags.LegalTagConstraintValidator; - -import javax.validation.*; - -import java.util.*; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class MockValidationValidator extends LegalTagConstraintValidator { - - private final String rulesetName; - - public MockValidationValidator(String ruleSet, RulesetProvider rsp){ - this.rulesetName = ruleSet; - this.ruleSetProvider = rsp; - } - public MockValidationValidator(){ - this.rulesetName = TenantInfo.ComplianceRuleSets.SHARED; - this.ruleSetProvider = CreateRsp(new MockRule()); - } - - @Override - public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> key) { - this.requestInfo = mock(RequestInfo.class); - when(requestInfo.getComplianceRuleSet()).thenReturn(rulesetName); - return super.getInstance(key); - } - - @Override - public void releaseInstance(ConstraintValidator<?, ?> instance) { - - } - - public static Validator GetValidator(String rulesetName, RulesetProvider rsp){ - Configuration<?> config = Validation.byDefaultProvider().configure(); - config.constraintValidatorFactory(new MockValidationValidator(rulesetName, rsp)); - ValidatorFactory factory = config.buildValidatorFactory(); - return factory.getValidator(); - } - - public static Validator GetValidator(String rulesetName){ - Configuration<?> config = Validation.byDefaultProvider().configure(); - config.constraintValidatorFactory(new MockValidationValidator(rulesetName, CreateRsp(new MockRule()))); - ValidatorFactory factory = config.buildValidatorFactory(); - return factory.getValidator(); - } - public static Validator GetValidator(){ - Configuration<?> config = Validation.byDefaultProvider().configure(); - return GetValidator(TenantInfo.ComplianceRuleSets.SHARED); - } - - public static RulesetProvider CreateRsp(Rule... rules){ - RulesetProvider rsp = mock(RulesetProvider.class); - when(rsp.get()).thenReturn(Arrays.asList(rules)); - return rsp; - } -} diff --git a/provider/legal-ibm/pom.xml b/provider/legal-ibm/pom.xml index ea4a3821a6c4017633c3c08a427cbd985a9b31ba..7803330dc50e957adae1992e87a0e8d79d48b5bc 100644 --- a/provider/legal-ibm/pom.xml +++ b/provider/legal-ibm/pom.xml @@ -11,7 +11,7 @@ <artifactId>legal-ibm</artifactId> <packaging>jar</packaging> <properties> - <os-core-lib-ibm.version>0.25.1</os-core-lib-ibm.version> + <os-core-lib-ibm.version>0.26.0-rc8</os-core-lib-ibm.version> </properties> <dependencies> @@ -19,17 +19,6 @@ <groupId>org.opengroup.osdu.legal</groupId> <artifactId>legal-core</artifactId> <version>0.26.0-SNAPSHOT</version> - <exclusions> - <exclusion> - <groupId>com.google.protobuf</groupId> - <artifactId>protobuf-java</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.google.protobuf</groupId> - <artifactId>protobuf-java</artifactId> - <version>3.19.6</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> @@ -70,14 +59,14 @@ <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy</artifactId> - <version>2.5.8</version> + <version>3.0.20</version> <type>pom</type> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-jsr223</artifactId> - <version>2.5.8</version> + <version>3.0.16</version> <type>pom</type> </dependency> @@ -88,7 +77,6 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot</artifactId> - <version>2.7.17</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -105,11 +93,6 @@ <artifactId>netty-codec</artifactId> <version>4.1.86.Final</version> </dependency> - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-core</artifactId> - <version>9.0.69</version> - </dependency> </dependencies> <build> diff --git a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderFactoryImpl.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderFactoryImpl.java index 9fea3299cd269759999d1b34a24d5fc865b5f368..4b20b5efedce8af83699805a6d6902abdedd11da 100644 --- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderFactoryImpl.java +++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderFactoryImpl.java @@ -10,7 +10,7 @@ import java.io.InputStreamReader; import java.net.MalformedURLException; import java.util.concurrent.ConcurrentHashMap; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; diff --git a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderImpl.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderImpl.java index d35a1808351f092bc500f899ce52ef7e4b6158ec..6bd69b53b8ebf74da89dfa7ccbc1a9c57368f1d4 100644 --- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderImpl.java +++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/countries/StorageReaderImpl.java @@ -11,7 +11,7 @@ import java.lang.ref.WeakReference; import java.net.MalformedURLException; import java.util.concurrent.atomic.AtomicLong; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; diff --git a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/jobs/LegalTagPublisherImpl.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/jobs/LegalTagPublisherImpl.java index 0c498329dac10f38a33757c3dd3b7c6362c9d700..ce85f8fcedc31af9283f87531bfe03d33d9ff1df 100644 --- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/jobs/LegalTagPublisherImpl.java +++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/jobs/LegalTagPublisherImpl.java @@ -7,7 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.core.common.model.legal.StatusChangedTag; diff --git a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/security/SecurityConfig.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/security/SecurityConfig.java index 9d5cb29ce62f5a153f92967aeda6ce8ae4cf2470..4ed129821703c2faafe511a1c9f0f3b37ab26310 100644 --- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/security/SecurityConfig.java +++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/security/SecurityConfig.java @@ -1,31 +1,31 @@ /* Licensed Materials - Property of IBM */ /* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/ - package org.opengroup.osdu.legal.ibm.security; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +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.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -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 @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter { - @Override - protected void configure(HttpSecurity http) throws Exception { +@EnableMethodSecurity +public class SecurityConfig { + @Bean + public SecurityFilterChain defaultFilterChain(HttpSecurity http) throws Exception { http - .csrf().disable(); - // .authorizeRequests() - // .antMatchers("/_ah/liveness_check","/_ah/readiness_check", - // "/v2/api-docs", - // "/configuration/ui", - // "/swagger-resources/**", - // "/actuator/**", - // "/configuration/security", - // "/swagger-ui.html", - // "/info", - // "/webjars/**").permitAll() - // .anyRequest().authenticated().and().oauth2ResourceServer().jwt(); + .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/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantBackedLegalTag.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantBackedLegalTag.java index ba96f018389dab04eef98fd422547c4d0e39a2f7..ab6e27445af8ebab646bc861e8a00381de3e7f02 100644 --- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantBackedLegalTag.java +++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantBackedLegalTag.java @@ -6,7 +6,7 @@ import java.lang.reflect.Type; import java.sql.Date; import java.util.Optional; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.model.legal.LegalTag; import org.opengroup.osdu.core.common.model.legal.Properties; diff --git a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java index eda4c62f25ba3e7caf9e2efb33535cf0a806134a..4a32e3977bd5d7af294e5122f5b29edae5d9dc23 100644 --- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java +++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java @@ -15,8 +15,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import javax.annotation.PostConstruct; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.legal.LegalTag; diff --git a/provider/legal-ibm/src/test/java/org/opengroup/osdu/legal/ibm/controller/LegalTagControllerTest.java b/provider/legal-ibm/src/test/java/org/opengroup/osdu/legal/ibm/controller/LegalTagControllerTest.java index 01fa6e684ad67b4bb13a872063f4027cfd3716f6..af00f30a5535131c9c5e84518d45148556ca1f95 100644 --- a/provider/legal-ibm/src/test/java/org/opengroup/osdu/legal/ibm/controller/LegalTagControllerTest.java +++ b/provider/legal-ibm/src/test/java/org/opengroup/osdu/legal/ibm/controller/LegalTagControllerTest.java @@ -7,7 +7,7 @@ package org.opengroup.osdu.legal.ibm.controller; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.junit.Assert; import org.junit.Before; diff --git a/testing/legal-test-aws/pom.xml b/testing/legal-test-aws/pom.xml index 30050b1d7bb6e27b96f727bd4c2581b47aec6f00..def5dfdb9c07dd0195aa0c16e495f4b9885df397 100644 --- a/testing/legal-test-aws/pom.xml +++ b/testing/legal-test-aws/pom.xml @@ -52,14 +52,14 @@ <!-- third party Apache 2.0 license packages --> <dependency> - <groupId>javax.json</groupId> - <artifactId>javax.json-api</artifactId> - <version>1.1.2</version> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <version>2.1.3</version> </dependency> <dependency> <groupId>org.glassfish</groupId> - <artifactId>javax.json</artifactId> - <version>1.1.2</version> + <artifactId>jakarta.json</artifactId> + <version>2.0.1</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> diff --git a/testing/legal-test-gc/pom.xml b/testing/legal-test-gc/pom.xml index 45d5a1359ac73e9e7edad64080b9484ce5f8e9b1..b20271c96947f2572bb602d3d299b5865e9b9856 100644 --- a/testing/legal-test-gc/pom.xml +++ b/testing/legal-test-gc/pom.xml @@ -39,9 +39,9 @@ <dependencies> <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - <version>2.3.0</version> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>4.0.1</version> </dependency> <dependency> <groupId>org.glassfish.jaxb</groupId> @@ -49,14 +49,14 @@ <version>2.3.0</version> </dependency> <dependency> - <groupId>javax.json</groupId> - <artifactId>javax.json-api</artifactId> - <version>1.1.2</version> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <version>2.1.3</version> </dependency> <dependency> <groupId>org.glassfish</groupId> - <artifactId>javax.json</artifactId> - <version>1.1.2</version> + <artifactId>jakarta.json</artifactId> + <version>2.0.1</version> </dependency> <dependency> <groupId>com.google.oauth-client</groupId>