From 5d9f6b6a8ccdcc5770e8638deac38edb3e9503c5 Mon Sep 17 00:00:00 2001 From: Deepa Kumari <deepa_kumari@epam.com> Date: Mon, 15 Jul 2024 12:10:57 +0000 Subject: [PATCH] Spring-6, Spring-Boot-3 Upgrade --- .fossa.yml | 4 - .gitlab-ci.yml | 2 +- NOTICE | 215 ++++------- devops/azure/development-pipeline.yml | 1 - devops/azure/pipeline.yml | 1 - devops/service-pipeline.yml | 1 - docs/docs/running.md | 30 -- pom.xml | 139 +++---- provider/search-aws/pom.xml | 40 +- .../aws/di/EntitlementsFactoryAws.java | 4 +- .../AWSAuthorizationServiceImpl.java | 2 +- .../persistence/ElasticRepositoryImpl.java | 4 +- .../impl/CrossTenantInfoServiceAwsImpl.java | 2 +- .../service/ElasticSettingServiceImpl.java | 4 +- .../UnsafeX509ExtendedTrustManager.java | 2 +- provider/search-azure/pom.xml | 134 +++---- ...ation.java => SearchAzureApplication.java} | 4 +- .../azure/cache/impl/CursorCacheImpl.java | 4 +- .../impl/ElasticCredentialsCacheImpl.java | 2 +- .../azure/cache/impl/IndexAliasCacheImpl.java | 2 +- .../azure/config/AzureBootstrapConfig.java | 9 +- .../impl/CrossTenantInfoServiceImpl.java | 2 +- .../azure/security/AADSecurityConfig.java | 35 +- .../security/AzureIstioSecurityConfig.java | 24 +- .../RequestRejectedExceptionFilter.java | 14 +- .../impl/FieldTypeMappingCacheImplTest.java | 18 +- .../azure/cache/impl/IndexAliasCacheTest.java | 2 +- .../AzureAuthorizationServiceTest.java | 9 +- provider/search-byoc/pom.xml | 145 -------- .../provider/byoc/SearchApplication.java | 22 -- .../byoc/di/EntitlementsFactoryByoc.java | 31 -- .../byoc/di/EntitlementsServiceByoc.java | 94 ----- .../provider/byoc/model/RedisProperties.java | 0 .../impl/CrossTenantInfoServiceImpl.java | 68 ---- .../byoc/provider/impl/CursorCacheImpl.java | 39 -- .../byoc/provider/impl/QueryBase.java | 346 ------------------ .../byoc/provider/impl/QueryServiceImpl.java | 112 ------ .../provider/impl/ScrollQueryServiceImpl.java | 196 ---------- .../persistence/ByocDatastoreFactory.java | 37 -- .../persistence/ElasticCredentialsCache.java | 41 --- .../ElasticRepositoryDatastore.java | 53 --- .../persistence/RedisConfiguration.java | 0 .../provider/persistence/RedisRepository.java | 0 .../persistence/RedisRepositoryImpl.java | 0 .../security/BasicAuthSecurityConfig.java | 40 -- .../byoc/security/WhoamiController.java | 40 -- .../service/ElasticSettingServiceImpl.java | 71 ---- .../byoc/service/TenantFactoryImpl.java | 63 ---- .../byoc/utils/ByocElasticSearchServer.java | 64 ---- .../provider/byoc/utils/ConfigModule.java | 17 - .../src/main/resources/application.properties | 26 -- .../src/main/resources/tenant-mappings.json | 7 - provider/search-gc/pom.xml | 29 +- .../gcp/security/GcpSecurityConfig.java | 26 +- .../service/ElasticSettingServiceImpl.java | 2 +- .../RedirectHttpRequestsHandlerTest.java | 8 +- .../gcp/smart/filters/AllFiltersTest.java | 2 +- .../smart/filters/AttributeFilterTest.java | 2 +- .../gcp/smart/filters/SourceFilterTest.java | 2 +- .../gcp/smart/filters/TypeFilterTest.java | 2 +- provider/search-ibm/pom.xml | 12 +- .../ibm/di/EntitlementsFactoryIbm.java | 2 +- .../ibm/model/ElasticSettingSchema.java | 2 +- .../ibm/persistence/ElasticRepositoryIBM.java | 2 +- .../ElasticSettingSchemaRepositoryImpl.java | 4 +- .../impl/CrossTenantInfoServiceImpl.java | 2 +- .../provider/ibm/security/SecurityConfig.java | 36 +- .../service/ElasticSettingServiceImpl.java | 6 +- search-core-plus/pom.xml | 51 +-- .../security/CorePlusSecurityConfig.java | 24 +- .../service/ElasticSettingServiceImpl.java | 2 +- .../osdu/search/utils/ConfigModule.java | 2 +- .../RedirectHttpRequestsHandlerTest.java | 8 +- .../search/smart/filters/AllFiltersTest.java | 2 +- .../smart/filters/AttributeFilterTest.java | 2 +- .../smart/filters/SourceFilterTest.java | 2 +- .../search/smart/filters/TypeFilterTest.java | 2 +- search-core/pom.xml | 83 ++--- .../osdu/search/api/HealthCheckApi.java | 2 +- .../opengroup/osdu/search/api/SearchApi.java | 8 +- .../osdu/search/logging/AuditLogger.java | 4 +- .../middleware/AuthorizationFilter.java | 6 +- .../CorrelationIDRequestFilter.java | 8 +- .../middleware/GlobalExceptionMapper.java | 7 +- .../RedirectHttpRequestsHandler.java | 8 +- .../osdu/search/model/InnerQueryNode.java | 2 +- .../osdu/search/model/NestedQueryNode.java | 2 +- .../osdu/search/model/QueryNode.java | 2 +- .../osdu/search/model/SmartParsedQuery.java | 2 +- .../osdu/search/policy/cache/PolicyCache.java | 2 +- .../policy/di/PolicyCacheConfiguration.java | 2 +- .../search/provider/impl/CoreQueryBase.java | 4 +- .../provider/impl/CoreQueryServiceImpl.java | 2 +- .../impl/ScrollCoreQueryServiceImpl.java | 6 +- .../search/service/IndexAliasServiceImpl.java | 2 +- .../attributes/AttributeMappingReader.java | 2 +- .../osdu/search/smart/filters/AllFilters.java | 4 +- .../search/smart/filters/AttributeFilter.java | 4 +- .../search/smart/filters/SourceFilter.java | 4 +- .../osdu/search/smart/filters/TypeFilter.java | 4 +- .../SyncFilterValuesServiceImpl.java | 4 +- .../smart/models/AttributeCollection.java | 4 +- .../osdu/search/smart/models/Filter.java | 6 +- .../search/smart/models/FilterCollection.java | 2 +- .../osdu/search/smart/models/Kinds.java | 2 +- .../search/smart/parser/ParseToQuery.java | 2 +- .../osdu/search/util/CrossTenantUtils.java | 3 +- .../util/DetailedBadRequestMessageUtil.java | 2 +- .../search/util/ElasticClientHandler.java | 2 +- .../osdu/search/util/GeoQueryBuilder.java | 2 +- .../search/util/SuggestionsQueryUtil.java | 2 +- .../QueryRequestConstraintValidator.java | 14 +- .../osdu/search/api/SearchApiTest.java | 2 +- .../AuthorizationRequestFilterTest.java | 12 +- .../CorrelationIDRequestFilterTest.java | 10 +- .../middleware/GlobalExceptionMapperTest.java | 2 +- .../middleware/RequestHeadersTestUtil.java | 2 +- .../impl/CoreQueryServiceImplTest.java | 3 + .../search/smart/models/AttributesTest.java | 4 +- .../osdu/search/smart/models/FilterTest.java | 6 +- .../validation/OffsetValidatorTest.java | 2 +- .../QueryRequestConstraintValidatorTest.java | 2 +- .../validation/SortOrderValidatorTest.java | 2 +- .../search-test-azure/pom.xml | 6 + .../singlecluster/SingleClusterQuery.feature | 8 +- .../org/opengroup/osdu/common/TestsBase.java | 32 +- .../osdu/util/SchemaServiceClient.java | 8 +- 127 files changed, 533 insertions(+), 2239 deletions(-) rename provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/{SearchApplication.java => SearchAzureApplication.java} (92%) delete mode 100644 provider/search-byoc/pom.xml delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/SearchApplication.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsFactoryByoc.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsServiceByoc.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/model/RedisProperties.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CrossTenantInfoServiceImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CursorCacheImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryBase.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryServiceImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/ScrollQueryServiceImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ByocDatastoreFactory.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticCredentialsCache.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticRepositoryDatastore.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisConfiguration.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisRepository.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisRepositoryImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/BasicAuthSecurityConfig.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/WhoamiController.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/ElasticSettingServiceImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/TenantFactoryImpl.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ByocElasticSearchServer.java delete mode 100644 provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ConfigModule.java delete mode 100644 provider/search-byoc/src/main/resources/application.properties delete mode 100644 provider/search-byoc/src/main/resources/tenant-mappings.json diff --git a/.fossa.yml b/.fossa.yml index d2c280f23..60d4620ff 100644 --- a/.fossa.yml +++ b/.fossa.yml @@ -20,10 +20,6 @@ analyze: type: mvn target: search-core-plus/pom.xml path: . - - name: search-byoc - type: mvn - target: provider/search-byoc/pom.xml - path: . - name: search-gc type: mvn target: provider/search-gc/pom.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e71db64e5..b2b12f8d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ variables: AZURE_TEST_SUBDIR: testing/integration-tests/search-test-azure SERVICE_JAVA_VERSION: "17" - CORE_BUILD_SUBDIR: provider/search-aws + #CORE_BUILD_SUBDIR: search-core include: - project: "osdu/platform/ci-cd-pipelines" diff --git a/NOTICE b/NOTICE index 03c6809d1..2b780f8c1 100644 --- a/NOTICE +++ b/NOTICE @@ -15,14 +15,11 @@ Apache-1.1 ======================================================================== The following software have components provided under the terms of this license: -- Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version}) -- Apache Log4j JUL Adapter (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jul) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - Microsoft Application Insights Java Agent (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) - Proton-J (from https://repo1.maven.org/maven2/org/apache/qpid/proton-j) -- QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) ======================================================================== Apache-2.0 @@ -38,7 +35,6 @@ The following software have components provided under the terms of this license: - ASM Util (from http://asm.ow2.io/) - ASM based accessors helper used by json-smart (from https://urielch.github.io/) - AWS Java SDK for AWS KMS (from https://aws.amazon.com/sdkforjava) -- AWS Java SDK for AWS Lambda (from https://aws.amazon.com/sdkforjava) - AWS Java SDK for AWS STS (from https://aws.amazon.com/sdkforjava) - AWS Java SDK for AWS Secrets Manager (from https://aws.amazon.com/sdkforjava) - AWS Java SDK for Amazon CloudWatch Logs (from https://aws.amazon.com/sdkforjava) @@ -48,7 +44,6 @@ The following software have components provided under the terms of this license: - AWS Java SDK for Amazon SNS (from https://aws.amazon.com/sdkforjava) - AWS Java SDK for Amazon SQS (from https://aws.amazon.com/sdkforjava) - AWS Java SDK for the AWS Simple Systems Management (SSM) Service (from https://aws.amazon.com/sdkforjava) -- AWS SDK for Java - BOM (from https://aws.amazon.com/sdkforjava) - AWS SDK for Java - Core (from https://aws.amazon.com/sdkforjava) - Adapter: RxJava (from https://github.com/square/retrofit) - Animal Sniffer Annotations (from https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations) @@ -59,13 +54,10 @@ The following software have components provided under the terms of this license: - Apache Commons Lang (from https://commons.apache.org/proper/commons-lang/) - Apache Commons Logging (from http://commons.apache.org/logging/, http://commons.apache.org/proper/commons-logging/, https://commons.apache.org/proper/commons-logging/) - Apache Commons Validator (from http://commons.apache.org/proper/commons-validator/, http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/, https://repo1.maven.org/maven2/commons-validator/commons-validator) -- Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version}) - Apache 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 HttpAsyncClient (from http://hc.apache.org/httpcomponents-asyncclient) -- 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) +- Apache HttpClient (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga) - Apache HttpClient Cache (from http://hc.apache.org/httpcomponents-client, http://hc.apache.org/httpcomponents-client-ga) -- Apache HttpComponents Core HTTP/1.1 (from https://repo1.maven.org/maven2/org/apache/httpcomponents/core5/httpcore5) -- Apache HttpComponents Core HTTP/2 (from https://repo1.maven.org/maven2/org/apache/httpcomponents/core5/httpcore5-h2) - Apache HttpCore (from http://hc.apache.org/httpcomponents-core-ga, http://hc.apache.org/httpcomponents-core-ga/, http://hc.apache.org/httpcomponents-core/) - Apache HttpCore NIO (from http://hc.apache.org/httpcomponents-core-ga, http://hc.apache.org/httpcomponents-core/) - Apache Log4j API (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api) @@ -81,6 +73,7 @@ The following software have components provided under the terms of this license: - Asynchronous Http Client (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client) - Asynchronous Http Client Netty Utils (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client-netty-utils) - AutoValue Annotations (from https://github.com/google/auto/tree/main/value, https://github.com/google/auto/tree/master/value, https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations) +- Awaitility (from http://awaitility.org) - BSON (from http://bsonspec.org, https://bsonspec.org) - BSON Record Codec (from <https://www.mongodb.com/>, https://www.mongodb.com/) - Bean Validation API (from http://beanvalidation.org) @@ -94,13 +87,13 @@ The following software have components provided under the terms of this license: - Core functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) - Data Mapper for Jackson (from http://jackson.codehaus.org) - Elastic JNA Distribution (from https://github.com/java-native-access/jna) -- Expression Language 3.0 (from http://el-spec.java.net, http://uel.java.net, https://projects.eclipse.org/projects/ee4j.el) -- Expression Language 3.0 API (from http://uel-spec.java.net, http://uel.java.net) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) - GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) - GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - GSON extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) +- Google Auth Library for Java - Credentials (from https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials) +- Google Auth Library for Java - OAuth2 HTTP (from https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http) - Google Cloud Core (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core, https://github.com/googleapis/java-core, https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core) - Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc, https://github.com/googleapis/java-core, https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-grpc) - Google Cloud Logging (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-logging, https://github.com/googleapis/java-logging) @@ -115,13 +108,13 @@ The following software have components provided under the terms of this license: - Hibernate Validator (from https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator) - High Performance Primitive Collections (from https://github.com/carrotsearch/hppc) - J2ObjC Annotations (from https://github.com/google/j2objc/) -- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - JBoss Logging 3 (from http://www.jboss.org) - JBoss Marshalling API (from https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling) - 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) -- JCL 1.2 implemented over SLF4J (from http://www.slf4j.org) +- JJWT :: API (from https://repo1.maven.org/maven2/io/jsonwebtoken/jjwt-api) +- JJWT :: Extensions :: Jackson (from https://repo1.maven.org/maven2/io/jsonwebtoken/jjwt-jackson) +- JJWT :: Impl (from https://repo1.maven.org/maven2/io/jsonwebtoken/jjwt-impl) - JJWT :: Legacy Transitive Dependency Jar (from https://repo1.maven.org/maven2/io/jsonwebtoken/jjwt) - JMES Path Query library (from https://aws.amazon.com/sdkforjava) - JOpt Simple (from http://jopt-simple.github.io/jopt-simple, http://pholser.github.io/jopt-simple) @@ -131,9 +124,10 @@ The following software have components provided under the terms of this license: - JSONassert (from http://github.com/skyscreamer/yoga, https://github.com/skyscreamer/JSONassert) - JSR 311 API (from https://jsr311.dev.java.net, https://jsr311.dev.java.net/) - JSR107 API and SPI (from https://github.com/jsr107/jsr107spec) -- JSpecify annotations (from http://jspecify.org/) - Jackson (from http://jackson.codehaus.org) - Jackson 2 extensions to the Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client-jackson2) +- Jackson Jakarta-RS: JSON (from https://repo1.maven.org/maven2/com/fasterxml/jackson/jakarta/rs/jackson-jakarta-rs-json-provider) +- Jackson Jakarta-RS: base (from https://repo1.maven.org/maven2/com/fasterxml/jackson/jakarta/rs/jackson-jakarta-rs-base) - Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary) - Jackson dataformat: Smile (from http://github.com/FasterXML/jackson-dataformat-smile, http://github.com/FasterXML/jackson-dataformats-binary) - Jackson datatype: JSR310 (from http://wiki.fasterxml.com/JacksonModuleJSR310, https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310) @@ -141,6 +135,7 @@ The following software have components provided under the terms of this license: - Jackson datatype: jdk8 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8) - Jackson module: Afterburner (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-modules-base) - Jackson module: JAXB Annotations (from http://github.com/FasterXML/jackson-module-jaxb-annotations, http://wiki.fasterxml.com/JacksonJAXBAnnotations, https://github.com/FasterXML/jackson-modules-base) +- Jackson module: Jakarta XML Bind Annotations (jakarta.xml.bind) (from https://github.com/FasterXML/jackson-modules-base) - Jackson-JAXRS: JSON (from http://wiki.fasterxml.com/JacksonHome, https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider) - Jackson-JAXRS: base (from https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-base) - Jackson-annotations (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson) @@ -148,10 +143,9 @@ The following software have components provided under the terms of this license: - Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding, https://github.com/FasterXML/jackson-dataformat-xml) - Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson, https://github.com/FasterXML/jackson-dataformats-text) - Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names) +- Jakarta Dependency Injection (from https://github.com/eclipse-ee4j/injection-api) - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api, https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api) - 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) - Java Native Access (from https://github.com/java-native-access/jna, https://github.com/twall/jna) - Java Native Access Platform (from https://github.com/java-native-access/jna) - Java archiving library (from http://rauschig.org/jarchivelib) @@ -159,12 +153,6 @@ The following software have components provided under the terms of this license: - Javassist (from http://www.javassist.org/, https://www.javassist.org/) - JetBrains Java Annotations (from https://github.com/JetBrains/java-annotations) - Joda-Time (from http://joda-time.sourceforge.net, http://www.joda.org/joda-time/, https://www.joda.org/joda-time/) -- KeePassJava2 :: All (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2) -- KeePassJava2 :: DOM (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-dom) -- KeePassJava2 :: JAXB (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-jaxb) -- KeePassJava2 :: KDB (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-kdb) -- KeePassJava2 :: KDBX (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-kdbx) -- KeePassJava2 :: Simple (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-simple) - Kotlin Stdlib (from https://kotlinlang.org/, https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib) - Kotlin Stdlib Common (from https://kotlinlang.org/) - Kotlin Stdlib Jdk7 (from <https://kotlinlang.org/>, https://kotlinlang.org/) @@ -187,7 +175,8 @@ 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) -- Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) +- 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) - MongoDB Driver (from https://www.mongodb.com/) - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) - Netty Reactive Streams Implementation (from https://repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams) @@ -224,7 +213,6 @@ The following software have components provided under the terms of this license: - OpenCensus (from https://github.com/census-instrumentation/opencensus-java, https://github.com/census-instrumentation/opencensus-proto) - OpenTelemetry Java (from https://github.com/open-telemetry/opentelemetry-java) - OpenTelemetry Semantic Conventions Java (from https://github.com/open-telemetry/semantic-conventions-java) -- PWDB :: Database (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/database) - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) - Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) - Prometheus Java Simpleclient Common (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_common>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_common) @@ -235,8 +223,8 @@ The following software have components provided under the terms of this license: - 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) - RESTEasy JAX-RS Implementation (from https://repo1.maven.org/maven2/org/jboss/resteasy/resteasy-jaxrs) +- RESTEasy JAX-RS services (from https://repo1.maven.org/maven2/org/jboss/resteasy/resteasy-jaxrs-services) - RESTEasy Jackson 2 Provider (from https://repo1.maven.org/maven2/org/jboss/resteasy/resteasy-jackson2-provider) -- RESTEasy Validator Provider BV 1.1 (from http://maven.apache.org) - 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) @@ -253,12 +241,10 @@ The following software have components provided under the terms of this license: - Spring Boot AutoConfigure (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-autoconfigure, https://spring.io/projects/spring-boot) - Spring Boot Configuration Processor (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-tools/spring-boot-configuration-processor, https://spring.io/projects/spring-boot) - Spring Boot Data Redis Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) -- Spring Boot Dependencies (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Jersey Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-jersey, https://spring.io/projects/spring-boot) - 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) @@ -267,7 +253,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 Context Support (from https://github.com/spring-projects/spring-framework) @@ -290,14 +275,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) - Standard Uri Template (from https://std-uritemplate.github.io/) - Swagger UI (from <http://webjars.org>, http://webjars.org, https://www.webjars.org) -- Vavr (from http://vavr.io, https://www.vavr.io) -- Vavr Match (from http://vavr.io) - Woodstox (from https://github.com/FasterXML/woodstox) -- aalto-xml (from https://github.com/FasterXML/aalto-xml, https://repo1.maven.org/maven2/com/fasterxml/aalto-xml) - aggs-matrix-stats (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) +- btf (from https://github.com/java-json-tools/btf) - compiler (from http://github.com/spullara/mustache.java) - elasticsearch (from https://github.com/elastic/elasticsearch, https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch) - elasticsearch-cli (from https://github.com/elastic/elasticsearch) @@ -314,22 +296,21 @@ The following software have components provided under the terms of this license: - io.grpc:grpc-core (from https://github.com/grpc/grpc-java) - io.grpc:grpc-googleapis (from https://github.com/grpc/grpc-java) - io.grpc:grpc-grpclb (from https://github.com/grpc/grpc-java) +- io.grpc:grpc-inprocess (from https://github.com/grpc/grpc-java) - io.grpc:grpc-netty-shaded (from https://github.com/grpc/grpc-java) - io.grpc:grpc-protobuf (from https://github.com/grpc/grpc-java) - io.grpc:grpc-protobuf-lite (from https://github.com/grpc/grpc-java) - io.grpc:grpc-services (from https://github.com/grpc/grpc-java) - io.grpc:grpc-stub (from https://github.com/grpc/grpc-java) +- io.grpc:grpc-util (from https://github.com/grpc/grpc-java) - io.grpc:grpc-xds (from https://github.com/grpc/grpc-java) +- jackson-coreutils (from https://github.com/java-json-tools/jackson-coreutils) - jackson-databind (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson) -- jakarta.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject) - java-cloudant (from https://cloudant.com) - javatuples (from http://www.javatuples.org) - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) -- javax.inject (from http://code.google.com/p/atinject/, https://repo1.maven.org/maven2/org/glassfish/hk2/external/javax.inject) -- javax.ws.rs-api (from https://github.com/eclipse-ee4j/jaxrs-api) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) -- jersey-core (from https://repo1.maven.org/maven2/com/sun/jersey/jersey-core) - jersey-core-client (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client) - jersey-core-common (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-common) - jersey-core-server (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-server) @@ -337,16 +318,20 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) - jose4j (from https://bitbucket.org/b_c/jose4j/) - json-patch (from https://github.com/fge/json-patch, https://github.com/java-json-tools/json-patch) - json-path (from http://code.google.com/p/json-path/, https://github.com/jayway/JsonPath) - lang-mustache (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - lettuce (from http://github.com/mp911de/lettuce/wiki, https://github.com/lettuce-io/lettuce-core/wiki) - mapper-extras (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) +- micrometer-commons (from https://github.com/micrometer-metrics/micrometer) - micrometer-core (from https://github.com/micrometer-metrics/micrometer) +- micrometer-jakarta9 (from https://github.com/micrometer-metrics/micrometer) +- micrometer-observation (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-azure-monitor (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-prometheus (from <https://github.com/micrometer-metrics/micrometer>, https://github.com/micrometer-metrics/micrometer) -- null (from https://github.com/fge/btf, https://github.com/fge/msg-simple) +- msg-simple (from https://github.com/java-json-tools/msg-simple) - org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian) - org.conscrypt:conscrypt-openjdk-uber (from https://conscrypt.org/) - org.opentest4j:opentest4j (from https://github.com/ota4j-team/opentest4j) @@ -364,13 +349,16 @@ The following software have components provided under the terms of this license: - spring-security-oauth2-client (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-oauth2-core (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) +- swagger-models-jakarta (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-models-jakarta) - t-digest (from https://github.com/tdunning/t-digest) - tomcat-annotations-api (from http://tomcat.apache.org/, https://tomcat.apache.org/) - tomcat-embed-core (from http://tomcat.apache.org/) @@ -411,6 +399,7 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) ======================================================================== BSD-3-Clause @@ -440,11 +429,10 @@ The following software have components provided under the terms of this license: - HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) - Hamcrest (from http://hamcrest.org/JavaHamcrest/) - Hamcrest Core (from http://hamcrest.org/, http://hamcrest.org/JavaHamcrest/, https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core) -- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) -- Jackson module: Afterburner (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-modules-base) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta JSON Processing API (from https://github.com/eclipse-ee4j/jsonp, https://javaee.github.io/jsonp) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api, https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) @@ -460,7 +448,6 @@ The following software have components provided under the terms of this license: - 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 Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) -- Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) - Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http) - Protocol Buffer Java API (from http://code.google.com/p/protobuf, https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java) - Protocol Buffers [Util] (from https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util) @@ -471,7 +458,6 @@ The following software have components provided under the terms of this license: - Spring Data KeyValue (from https://repo1.maven.org/maven2/org/springframework/data/spring-data-keyvalue) - ThreeTen backport (from https://github.com/ThreeTen/threetenbp, https://www.threeten.org/threetenbp) - aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) -- jakarta.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) - jersey-core-client (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client) @@ -481,6 +467,7 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) - jts-core (from https://repo1.maven.org/maven2/org/locationtech/jts/jts-core) - org.locationtech.jts.io:jts-io-common (from https://repo1.maven.org/maven2/org/locationtech/jts/io/jts-io-common) @@ -500,12 +487,14 @@ The following software have components provided under the terms of this license: - Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs (from http://www.bouncycastle.org/java.html, https://www.bouncycastle.org/java.html) - 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 ======================================================================== The following software have components provided under the terms of this license: +- "Java Concurrency in Practice" book annotations (from http://jcip.net/) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) @@ -527,7 +516,6 @@ The following software have components provided under the terms of this license: - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - Hibernate Validator (from https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator) - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) -- MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) - Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) @@ -539,7 +527,7 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) -- jersey-spring5 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring5) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) - reactive-streams (from http://www.reactive-streams.org/) ======================================================================== @@ -548,11 +536,8 @@ 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) -- Expression Language 3.0 (from http://el-spec.java.net, http://uel.java.net, https://projects.eclipse.org/projects/ee4j.el) -- Expression Language 3.0 API (from http://uel-spec.java.net, http://uel.java.net) +- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) - JSR 311 API (from https://jsr311.dev.java.net, https://jsr311.dev.java.net/) -- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) -- Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) - JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) @@ -561,19 +546,15 @@ CDDL-1.1 ======================================================================== The following software have components provided under the terms of this license: -- Expression Language 3.0 (from http://el-spec.java.net, http://uel.java.net, https://projects.eclipse.org/projects/ee4j.el) -- Expression Language 3.0 API (from http://uel-spec.java.net, http://uel.java.net) +- Common Annotations 1.2 API - HK2 Spring Bridge (from https://repo1.maven.org/maven2/org/glassfish/hk2/spring-bridge) - HK2 module of HK2 itself (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2) - JSR 311 API (from https://jsr311.dev.java.net, https://jsr311.dev.java.net/) -- JSR 353 (JSON Processing) Default Provider (from http://jsonp.java.net) -- 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) +- 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) - 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) - Run Level Service (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-runlevel) - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) -- javax.ws.rs-api (from https://github.com/eclipse-ee4j/jaxrs-api) -- jersey-client (from https://repo1.maven.org/maven2/com/sun/jersey/jersey-client) +- javax.json.bind-api (from https://javaee.github.io/jsonb-spec) - tomcat-embed-core (from http://tomcat.apache.org/) ======================================================================== @@ -589,7 +570,6 @@ EDL-1.0 ======================================================================== The following software have components provided under the terms of this license: -- Jakarta Activation (from https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation) - 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) ======================================================================== @@ -604,7 +584,6 @@ The following software have components provided under the terms of this license: - 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 Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) -- aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) - jts-core (from https://repo1.maven.org/maven2/org/locationtech/jts/jts-core) - org.locationtech.jts.io:jts-io-common (from https://repo1.maven.org/maven2/org/locationtech/jts/io/jts-io-common) @@ -615,11 +594,10 @@ The following software have components provided under the terms of this license: - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - Class Model for Hk2 (from https://repo1.maven.org/maven2/org/glassfish/hk2/class-model) +- Eclipse Expressly (from https://projects.eclipse.org/projects/ee4j.expressly) - HK2 API module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-api) - HK2 Implementation Utilities (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils) - HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) -- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - 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/) @@ -628,13 +606,14 @@ 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 JSON Processing API (from https://github.com/eclipse-ee4j/jsonp, https://javaee.github.io/jsonp) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api, https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api) - 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) - OSGi resource locator (from https://repo1.maven.org/maven2/org/glassfish/hk2/osgi-resource-locator) - ServiceLocator Default Implementation (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator) - aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) -- jakarta.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) - jersey-core-client (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client) @@ -644,23 +623,15 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) -- jersey-spring5 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring5) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) ======================================================================== GPL-2.0-only ======================================================================== The following software have components provided under the terms of this license: -- Class Model for Hk2 (from https://repo1.maven.org/maven2/org/glassfish/hk2/class-model) -- Expression Language 3.0 API (from http://uel-spec.java.net, http://uel.java.net) -- HK2 Implementation Utilities (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils) -- HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) -- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) -- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api, https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api) -- aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) -- jakarta.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject) -- jersey-spring5 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring5) +- 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) +- javax.json.bind-api (from https://javaee.github.io/jsonb-spec) - tomcat-embed-core (from http://tomcat.apache.org/) ======================================================================== @@ -669,25 +640,23 @@ GPL-2.0-with-classpath-exception The following software have components provided under the terms of this license: - Class Model for Hk2 (from https://repo1.maven.org/maven2/org/glassfish/hk2/class-model) -- Expression Language 3.0 (from http://el-spec.java.net, http://uel.java.net, https://projects.eclipse.org/projects/ee4j.el) -- Expression Language 3.0 API (from http://uel-spec.java.net, http://uel.java.net) +- Eclipse Expressly (from https://projects.eclipse.org/projects/ee4j.expressly) - HK2 Implementation Utilities (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils) - HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) - JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta JSON Processing API (from https://github.com/eclipse-ee4j/jsonp, https://javaee.github.io/jsonp) +- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms) - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api, https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api) - 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) - 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) - OSGi resource locator (from https://repo1.maven.org/maven2/org/glassfish/hk2/osgi-resource-locator) - ServiceLocator Default Implementation (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator) - aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) -- jakarta.inject (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject) - javax.annotation API (from http://jcp.org/en/jsr/detail?id=250) -- javax.ws.rs-api (from https://github.com/eclipse-ee4j/jaxrs-api) +- javax.json.bind-api (from https://javaee.github.io/jsonb-spec) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) - jersey-core-client (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client) @@ -697,24 +666,9 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) -- jersey-spring5 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring5) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) - tomcat-embed-core (from http://tomcat.apache.org/) -======================================================================== -GPL-3.0-only -======================================================================== -The following software have components provided under the terms of this license: - -- null (from https://github.com/fge/jackson-coreutils) - -======================================================================== -GPL-3.0-or-later -======================================================================== -The following software have components provided under the terms of this license: - -- aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) -- javax.ws.rs-api (from https://github.com/eclipse-ee4j/jaxrs-api) - ======================================================================== IPA ======================================================================== @@ -729,13 +683,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 ======================================================================== @@ -755,6 +702,7 @@ LGPL-2.1-only ======================================================================== The following software have components provided under the terms of this license: +- Javassist (from http://www.javassist.org/, https://www.javassist.org/) - 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) @@ -779,26 +727,17 @@ LGPL-3.0-only ======================================================================== The following software have components provided under the terms of this license: +- btf (from https://github.com/java-json-tools/btf) +- jackson-coreutils (from https://github.com/java-json-tools/jackson-coreutils) - json-patch (from https://github.com/fge/json-patch, https://github.com/java-json-tools/json-patch) -- null (from https://github.com/fge/btf, https://github.com/fge/jackson-coreutils, https://github.com/fge/msg-simple) - -======================================================================== -LGPL-3.0-or-later -======================================================================== -The following software have components provided under the terms of this license: - -- null (from https://github.com/fge/jackson-coreutils) +- msg-simple (from https://github.com/java-json-tools/msg-simple) ======================================================================== MIT ======================================================================== 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 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) - Apache Lucene (module: memory) (from https://lucene.apache.org/) - Apache Lucene (module: misc) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-misc) - Apache Lucene (module: spatial-extras) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-spatial-extras) @@ -806,16 +745,12 @@ The following software have components provided under the terms of this license: - 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) - Bouncy Castle Provider (from http://www.bouncycastle.org/java.html, https://www.bouncycastle.org/java.html) - Checker Qual (from https://checkerframework.org) -- ClassGraph (from https://github.com/classgraph/classgraph) - Extensions on Apache Proton-J library (from https://github.com/Azure/qpid-proton-j-extensions) - JOpt Simple (from http://jopt-simple.github.io/jopt-simple, http://pholser.github.io/jopt-simple) - JUL to SLF4J bridge (from http://www.slf4j.org) - Jackson-core (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-core) -- 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 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) - Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) @@ -831,7 +766,10 @@ The following software have components provided under the terms of this license: - 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 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) @@ -854,16 +792,18 @@ The following software have components provided under the terms of this license: - Microsoft Kiota-Java Serialization-Json (from https://github.com/microsoft/kiota-java) - Microsoft Kiota-Java Serialization-Multipart (from https://github.com/microsoft/kiota-java) - Microsoft Kiota-Java Serialization-Text (from https://github.com/microsoft/kiota-java) -- Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) +- Mockito (from http://mockito.org, https://github.com/mockito/mockito) - Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http) - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) - Project Lombok (from http://projectlombok.org, https://projectlombok.org) -- QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) - SLF4J API Module (from http://www.slf4j.org) -- Spongy Castle (from http://rtyley.github.io/spongycastle/) +- Spring 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) - System Stubs Core (from https://repo1.maven.org/maven2/uk/org/webcompere/system-stubs-core) -- System Stubs JUnit4 (from https://repo1.maven.org/maven2/uk/org/webcompere/system-stubs-junit4) - adal4j (from https://github.com/AzureAD/azure-activedirectory-library-for-java) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) @@ -874,20 +814,13 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) -- jersey-spring5 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring5) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) +- 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, https://github.com/AzureAD/microsoft-authentication-library-for-java) -- webjars-locator-core (from <http://webjars.org>, http://webjars.org) - -======================================================================== -MPL-1.1 -======================================================================== -The following software have components provided under the terms of this license: - -- Javassist (from http://www.javassist.org/, https://www.javassist.org/) ======================================================================== SunPro @@ -909,6 +842,7 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) ======================================================================== WTFPL @@ -950,6 +884,13 @@ The following software have components provided under the terms of this license: - Netty/Codec (from https://repo1.maven.org/maven2/io/netty/netty-codec) +======================================================================== +efsl-1.0 +======================================================================== +The following software have components provided under the terms of this license: + +- Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api, https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api) + ======================================================================== gpl-2.0-classpath ======================================================================== @@ -966,9 +907,6 @@ The following software have components provided under the terms of this license: - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - JBoss Logging 3 (from http://www.jboss.org) - 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) -- RESTEasy JAX-RS Implementation (from https://repo1.maven.org/maven2/org/jboss/resteasy/resteasy-jaxrs) -- RESTEasy Validator Provider BV 1.1 (from http://maven.apache.org) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) - jersey-core-client (from https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client) @@ -976,10 +914,15 @@ The following software have components provided under the terms of this license: - jersey-ext-entity-filtering (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering) - jersey-inject-hk2 (from https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2) - jersey-media-json-jackson (from https://repo1.maven.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson) +- jersey-spring6 (from https://repo1.maven.org/maven2/org/glassfish/jersey/ext/jersey-spring6) ======================================================================== unknown ======================================================================== The following software have components provided under the terms of this license: +- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) - System Rules (from http://stefanbirkner.github.com/system-rules/, http://stefanbirkner.github.io/system-rules/) +- btf (from https://github.com/java-json-tools/btf) +- json-patch (from https://github.com/fge/json-patch, https://github.com/java-json-tools/json-patch) +- msg-simple (from https://github.com/java-json-tools/msg-simple) diff --git a/devops/azure/development-pipeline.yml b/devops/azure/development-pipeline.yml index a7493b323..0dc85c1cf 100644 --- a/devops/azure/development-pipeline.yml +++ b/devops/azure/development-pipeline.yml @@ -23,7 +23,6 @@ trigger: - .gitignore - /docs - /indexer/search-aws - - /indexer/search-byoc - /indexer/search-gc - /indexer/search-ibm diff --git a/devops/azure/pipeline.yml b/devops/azure/pipeline.yml index 927674f61..6e48db30f 100644 --- a/devops/azure/pipeline.yml +++ b/devops/azure/pipeline.yml @@ -23,7 +23,6 @@ trigger: - .gitignore - /docs - /indexer/search-aws - - /indexer/search-byoc - /indexer/search-gc - /indexer/search-ibm diff --git a/devops/service-pipeline.yml b/devops/service-pipeline.yml index df06e265e..6ec91b1d0 100644 --- a/devops/service-pipeline.yml +++ b/devops/service-pipeline.yml @@ -50,7 +50,6 @@ stages: provider/search-azure/pom.xml provider/search-azure/target/*-spring-boot.jar copyFileContentsToFlatten: | - provider/search-byoc/target/*-spring-boot.jar provider/search-gc/target/*-spring-boot.jar provider/search-gc/src/main/appengine/app.yaml provider/search-gc/src/main/resources/application.properties diff --git a/docs/docs/running.md b/docs/docs/running.md index 3e4ac8edb..8d8c08281 100644 --- a/docs/docs/running.md +++ b/docs/docs/running.md @@ -14,33 +14,3 @@ Instructions for running the Azure implementation can be found [here](https://co ## Google Instructions for running the Google implementation can be found [here](https://community.opengroup.org/osdu/platform/system/search-service/-/tree/master/provider/search-gc). - -## BYOC Environment Setup -Checkout the code and perform the following actions: -```shell script - $ cd os-search - $ mvn clean install - $ java -jar provider/search-byoc/target/search-byoc-1.0-SNAPSHOT-spring-boot.jar -``` -Once the service is up visit browser and hit the url http://localhost:8080/api/search/v2/swagger-ui.html -Enter ```opendes@byoc.local / 123 ``` as username and ***password*** - -Click on "Search API" - -Click on "/query" - -Fill in the "queryRequest" textfield with the following contents: - - if you search for - ```shell script - {"kind": "*:*:*:*"} -``` -you would get a 200 with no results (that is, if you have no data in memory) - -If you search for -```shell script -{ - "kind": "common:ihs:well:1.0.0" -} -``` -you will get a 404 which means there is no data found for that kind. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 52f356cb2..59244490d 100644 --- a/pom.xml +++ b/pom.xml @@ -27,23 +27,26 @@ <maven.compiler.source>17</maven.compiler.source> <skip.unit.tests>false</skip.unit.tests> <skip.integration.tests>true</skip.integration.tests> - <jackson-databind.version>2.15.3</jackson-databind.version> - <jackson.version>2.15.3</jackson.version> - <resteasy.version>3.12.0.Final</resteasy.version> + <jackson-databind.version>2.17.1</jackson-databind.version> + <jackson.version>2.17.1</jackson.version> + <resteasy-jaxrs.version>4.0.0.Beta5</resteasy-jaxrs.version> + <resteasy-jackson2.version>6.2.9.Final</resteasy-jackson2.version> <elasticsearch.version>7.8.1</elasticsearch.version> <snakeyaml.version>2.0</snakeyaml.version> <commons-codec.version>1.14</commons-codec.version> - <hibernate-validator.version>6.1.5.Final</hibernate-validator.version> - <httpclient.version>4.5.13</httpclient.version> <woodstox-core.version>5.3.0</woodstox-core.version> - <reactor-bom.version>2020.0.0</reactor-bom.version> - <log4j-core.version>2.17.1</log4j-core.version> + <reactor-bom.version>2023.0.6</reactor-bom.version> + <log4j-core.version>2.21.1</log4j-core.version> <google-oauth-client.version>1.34.1</google-oauth-client.version> <commons-compress.version>1.21</commons-compress.version> - <osdu.oscorecommon.version>0.26.0</osdu.oscorecommon.version> - <tomcat-embed-core.version>9.0.71</tomcat-embed-core.version> - <openapi.version>1.6.14</openapi.version> + <osdu.oscorecommon.version>0.27.0-rc1</osdu.oscorecommon.version> + <spring-framework-version>6.1.8</spring-framework-version> + <spring-security.version>6.3.0</spring-security.version> + <openapi.version>2.5.0</openapi.version> <json-smart.version>2.5.0</json-smart.version> + <mockito-core.version>5.12.0</mockito-core.version> + <mockito-inline.version>5.2.0</mockito-inline.version> + <spring-boot.version>3.2.5</spring-boot.version> </properties> <licenses> @@ -57,7 +60,6 @@ <modules> <module>search-core</module> <module>search-core-plus</module> - <module>provider/search-byoc</module> <module>provider/search-gc</module> <module>provider/search-aws</module> <module>provider/search-azure</module> @@ -66,22 +68,23 @@ <dependencyManagement> <dependencies> <dependency> - <groupId>com.fasterxml.jackson</groupId> - <artifactId>jackson-bom</artifactId> - <version>${jackson.version}</version> + <groupId>org.opengroup.osdu</groupId> + <artifactId>os-core-common-spring6</artifactId> + <version>${osdu.oscorecommon.version}</version> <type>pom</type> + <scope>import</scope> </dependency> <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> + <groupId>org.springframework</groupId> + <artifactId>spring-framework-bom</artifactId> + <version>${spring-framework-version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - <version>${osdu.oscorecommon.version}</version> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-bom</artifactId> + <version>${spring-security.version}</version> <type>pom</type> <scope>import</scope> </dependency> @@ -96,7 +99,7 @@ <version>1.5.22</version> <exclusions> <exclusion> - <groupId>javax.ws.rs</groupId> + <groupId>jakarta.ws.rs</groupId> <artifactId>jsr311-api</artifactId> </exclusion> <exclusion> @@ -177,27 +180,21 @@ <artifactId>jackson-annotations</artifactId> <version>${jackson.version}</version> </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>3.1.0</version> - </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jackson2-provider</artifactId> - <version>${resteasy.version}</version> + <version>${resteasy-jackson2.version}</version> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> - <version>${resteasy.version}</version> + <version>${resteasy-jaxrs.version}</version> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-validator-provider-11</artifactId> - <version>3.6.2.Final</version> + <artifactId>resteasy-validator-provider</artifactId> + <version>6.2.9.Final</version> </dependency> - <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> @@ -265,21 +262,21 @@ </dependency> <!--Logging--> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>${log4j-core.version}</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.28</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - <version>1.7.28</version> - </dependency> +<!-- <dependency>--> +<!-- <groupId>org.apache.logging.log4j</groupId>--> +<!-- <artifactId>log4j-to-slf4j</artifactId>--> +<!-- <version>${log4j-core.version}</version>--> +<!-- </dependency>--> +<!-- <dependency>--> +<!-- <groupId>org.slf4j</groupId>--> +<!-- <artifactId>slf4j-api</artifactId>--> +<!-- <version>1.7.28</version>--> +<!-- </dependency>--> +<!-- <dependency>--> +<!-- <groupId>org.slf4j</groupId>--> +<!-- <artifactId>jcl-over-slf4j</artifactId>--> +<!-- <version>1.7.28</version>--> +<!-- </dependency>--> <!--Test--> <dependency> @@ -287,12 +284,6 @@ <artifactId>mockito-all</artifactId> <version>2.0.2-beta</version> </dependency> - <dependency> - <groupId>com.github.stefanbirkner</groupId> - <artifactId>system-rules</artifactId> - <version>1.19.0</version> - </dependency> - <dependency> <groupId>javax.el</groupId> <artifactId>javax.el-api</artifactId> @@ -304,24 +295,18 @@ <version>3.0.0</version> </dependency> <dependency> - <groupId>org.glassfish</groupId> - <artifactId>javax.json</artifactId> - <version>1.1.4</version> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <version>2.1.3</version> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> + <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> - <version>1.19.4</version> + <version>3.1.7</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> - <version>${hibernate-validator.version}</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>${httpclient.version}</version> </dependency> <dependency> <groupId>com.fasterxml.woodstox</groupId> @@ -357,13 +342,7 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - </exclusion> - </exclusions> - <version>2.6.6</version> + <version>${spring-boot.version}</version> </dependency> </dependencies> </dependencyManagement> @@ -372,38 +351,26 @@ <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.26</version> - </dependency> - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <version>1</version> - </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - <version>${osdu.oscorecommon.version}</version> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-core</artifactId> - <version>${tomcat-embed-core.version}</version> </dependency> <!--OpenApi --> <dependency> <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-ui</artifactId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>${openapi.version}</version> </dependency> <dependency> <groupId>org.springframework.plugin</groupId> <artifactId>spring-plugin-core</artifactId> - <version>2.0.0.RELEASE</version> + <version>3.0.0</version> </dependency> <dependency> <groupId>org.springframework.plugin</groupId> <artifactId>spring-plugin-metadata</artifactId> - <version>2.0.0.RELEASE</version> + <version>3.0.0</version> <exclusions> <exclusion> <groupId>org.springframework.plugin</groupId> @@ -456,7 +423,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>${spring-boot.version}</version> <executions> <execution> <id>build-info</id> diff --git a/provider/search-aws/pom.xml b/provider/search-aws/pom.xml index cbea43960..0045ec75a 100644 --- a/provider/search-aws/pom.xml +++ b/provider/search-aws/pom.xml @@ -36,7 +36,8 @@ <failOnMissingWebXml>false</failOnMissingWebXml> <project.main.basedir>${project.parent.basedir}</project.main.basedir> <nimbus-jose-jwt.version>9.18</nimbus-jose-jwt.version> - <spring-webmvc.version>6.0.9</spring-webmvc.version> + <spring-webmvc.version>6.1.9</spring-webmvc.version> + <tomcat-embed-core.version>10.1.24</tomcat-embed-core.version> </properties> @@ -45,7 +46,7 @@ <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb</artifactId> - <version>3.4.2</version> + <version>4.0.3</version> </dependency> </dependencies> </dependencyManagement> @@ -61,7 +62,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.26.0</version> + <version>0.26.0-spring6-rc2</version> <exclusions> <exclusion> <groupId>software.amazon.ion</groupId> @@ -71,7 +72,7 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${osdu.oscorecommon.version}</version> </dependency> @@ -91,21 +92,6 @@ <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-core</artifactId> - <version>9.0.83</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.2.13</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>1.2.13</version> - </dependency> <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> @@ -134,16 +120,7 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>5.3.34</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core</artifactId> - <version>5.7.12</version> + <version>${spring-webmvc.version}</version> </dependency> <!-- Testing packages --> @@ -169,7 +146,6 @@ <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> - <version>5.8.8</version> <scope>test</scope> </dependency> <dependency> @@ -200,7 +176,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>3.3.0</version> <configuration> <classifier>spring-boot</classifier> <mainClass>org.opengroup.osdu.search.SearchApplication</mainClass> @@ -217,7 +193,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.5</version> + <version>3.3.0</version> <configuration> <useSystemClassLoader>false</useSystemClassLoader> <threadCount>1</threadCount> diff --git a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/di/EntitlementsFactoryAws.java b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/di/EntitlementsFactoryAws.java index 07aeff1d1..0f93e2324 100644 --- a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/di/EntitlementsFactoryAws.java +++ b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/di/EntitlementsFactoryAws.java @@ -26,7 +26,7 @@ import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component @RequestScope @@ -53,4 +53,4 @@ public class EntitlementsFactoryAws extends AbstractFactoryBean<IEntitlementsFac public Class<?> getObjectType() { return IEntitlementsFactory.class; } -} \ No newline at end of file +} diff --git a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/entitlements/AWSAuthorizationServiceImpl.java b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/entitlements/AWSAuthorizationServiceImpl.java index af1414d90..20c06fe18 100644 --- a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/entitlements/AWSAuthorizationServiceImpl.java +++ b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/entitlements/AWSAuthorizationServiceImpl.java @@ -34,7 +34,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/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/persistence/ElasticRepositoryImpl.java b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/persistence/ElasticRepositoryImpl.java index 6eb97962e..5c1f2cff9 100644 --- a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/persistence/ElasticRepositoryImpl.java +++ b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/persistence/ElasticRepositoryImpl.java @@ -16,7 +16,7 @@ package org.opengroup.osdu.search.provider.aws.persistence; import org.opengroup.osdu.core.aws.ssm.K8sLocalParameterProvider; import org.opengroup.osdu.core.aws.ssm.K8sParameterNotFoundException; import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import org.opengroup.osdu.core.common.model.search.ClusterSettings; import org.opengroup.osdu.core.common.provider.interfaces.IElasticRepository; import org.springframework.beans.factory.annotation.Value; @@ -76,4 +76,4 @@ public class ElasticRepositoryImpl implements IElasticRepository { return settings; } -} \ No newline at end of file +} diff --git a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/provider/impl/CrossTenantInfoServiceAwsImpl.java b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/provider/impl/CrossTenantInfoServiceAwsImpl.java index 4c5375861..28cdf814b 100644 --- a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/provider/impl/CrossTenantInfoServiceAwsImpl.java +++ b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/provider/impl/CrossTenantInfoServiceAwsImpl.java @@ -23,7 +23,7 @@ import org.opengroup.osdu.core.common.model.tenant.TenantInfo; import org.opengroup.osdu.search.provider.interfaces.ICrossTenantInfoService; import org.springframework.stereotype.Service; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.LinkedList; import java.util.List; diff --git a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/ElasticSettingServiceImpl.java b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/ElasticSettingServiceImpl.java index 5cc6d2583..ee8bf2d2b 100644 --- a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/ElasticSettingServiceImpl.java +++ b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/ElasticSettingServiceImpl.java @@ -24,7 +24,7 @@ import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.util.Map; @Primary @@ -78,4 +78,4 @@ public class ElasticSettingServiceImpl implements IElasticSettingService { return settings; } -} \ No newline at end of file +} diff --git a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/UnsafeX509ExtendedTrustManager.java b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/UnsafeX509ExtendedTrustManager.java index b7fc727c1..7aca90153 100644 --- a/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/UnsafeX509ExtendedTrustManager.java +++ b/provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/service/UnsafeX509ExtendedTrustManager.java @@ -78,4 +78,4 @@ class UnsafeX509ExtendedTrustManager extends X509ExtendedTrustManager { return EMPTY_X509_CERTIFICATES; } -} \ No newline at end of file +} diff --git a/provider/search-azure/pom.xml b/provider/search-azure/pom.xml index f381ad772..0dd3b05e6 100644 --- a/provider/search-azure/pom.xml +++ b/provider/search-azure/pom.xml @@ -34,23 +34,15 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <failOnMissingWebXml>false</failOnMissingWebXml> <project.main.basedir>${project.parent.basedir}</project.main.basedir> - <springboot.version>2.1.7.RELEASE</springboot.version> - <osdu.corelibazure.version>0.26.0</osdu.corelibazure.version> + <osdu.corelibazure.version>0.27.0-rc2</osdu.corelibazure.version> <osdu.search-core.version>0.27.0-SNAPSHOT</osdu.search-core.version> <spatial4j.version>0.7</spatial4j.version> - <reactor-netty.version>1.1.14</reactor-netty.version> - <reactor-core.version>3.4.21</reactor-core.version> - <jackson-dataformat-xml.version>2.11.4</jackson-dataformat-xml.version> - <log4j.version>2.17.1</log4j.version> + <log4j.version>2.21.1</log4j.version> <azure.appservice.resourcegroup /> <azure.appservice.plan /> <azure.appservice.appname /> <azure.appservice.subscription /> - <spring-webmvc.version>5.3.22</spring-webmvc.version> - <azure-core.version>1.31.0</azure-core.version> - <azure-security-keyvault-keys.version>4.4.6</azure-security-keyvault-keys.version> - <azure-security-keyvault-secrets.version>4.4.6</azure-security-keyvault-secrets.version> - <netty.version>4.1.101.Final</netty.version> + <netty.version>4.1.109.Final</netty.version> <guava.version>32.1.2-jre</guava.version> <woodstox-core.version>6.4.0</woodstox-core.version> <nimbus-jose-jwt.version>9.30.2</nimbus-jose-jwt.version> @@ -67,40 +59,20 @@ <type>pom</type> <scope>import</scope> </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>2.7.17</version> - <type>pom</type> - <scope>import</scope> - </dependency> <!-- Inherit managed dependencies from core-lib-azure --> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-azure</artifactId> + <artifactId>core-lib-azure-spring6</artifactId> <version>${osdu.corelibazure.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jul</artifactId> - <version>${log4j.version}</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <version>${log4j.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-databind</artifactId> - <version>${jackson.version}</version> + <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.boot</groupId> @@ -111,12 +83,23 @@ <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> - <version>2.7.17</version> + <version>${spring-boot.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core</artifactId> - <version>5.7.11</version> + <artifactId>spring-security-bom</artifactId> + <version>6.3.0</version> + </dependency> + + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-jul</artifactId> + <version>${log4j.version}</version> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + <version>${log4j.version}</version> </dependency> </dependencies> </dependencyManagement> @@ -132,55 +115,49 @@ <artifactId>log4j-to-slf4j</artifactId> </exclusion> <exclusion> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + </exclusion> + <exclusion> + <artifactId>spring-boot-autoconfigure</artifactId> + <groupId>org.springframework.boot</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${osdu.oscorecommon.version}</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-azure</artifactId> + <artifactId>core-lib-azure-spring6</artifactId> <version>${osdu.corelibazure.version}</version> - <exclusions> - <exclusion> - <artifactId>azure-security-keyvault-keys</artifactId> - <groupId>com.azure</groupId> - </exclusion> - <exclusion> - <artifactId>azure-security-keyvault-secrets</artifactId> - <groupId>com.azure</groupId> - </exclusion> - <exclusion> - <artifactId>azure-core</artifactId> - <groupId>com.azure</groupId> - </exclusion> - </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.7.36</version> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-junit-jupiter</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.hibernate.validator</groupId> - <artifactId>hibernate-validator</artifactId> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> - <version>2.0.0-beta</version> + <artifactId>mockito-inline</artifactId> + <version>${mockito-inline.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> - <version>${spring-webmvc.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -191,7 +168,6 @@ <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> - <version>2.7.17</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -206,11 +182,13 @@ <!-- Azure dependencies --> <dependency> <groupId>com.azure.spring</groupId> - <artifactId>azure-spring-boot</artifactId> + <artifactId>spring-cloud-azure-autoconfigure</artifactId> + <version>5.13.0</version> </dependency> <dependency> <groupId>com.azure.spring</groupId> - <artifactId>azure-spring-boot-starter-active-directory</artifactId> + <artifactId>spring-cloud-azure-starter-active-directory</artifactId> + <version>5.13.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -231,52 +209,34 @@ <dependency> <groupId>io.projectreactor.netty</groupId> <artifactId>reactor-netty</artifactId> - <version>${reactor-netty.version}</version> </dependency> <dependency> <groupId>io.projectreactor.netty</groupId> <artifactId>reactor-netty-http</artifactId> - <version>${reactor-netty.version}</version> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-core</artifactId> - <version>${reactor-core.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId> - <version>${jackson-dataformat-xml.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-databind</artifactId> - <version>${jackson-databind.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> - <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.azure</groupId> <artifactId>azure-core</artifactId> - <version>${azure-core.version}</version> - </dependency> - <dependency> - <groupId>com.azure</groupId> - <artifactId>azure-security-keyvault-keys</artifactId> - <version>${azure-security-keyvault-keys.version}</version> - </dependency> - <dependency> - <groupId>com.azure</groupId> - <artifactId>azure-security-keyvault-secrets</artifactId> - <version>${azure-security-keyvault-secrets.version}</version> </dependency> <dependency> <groupId>com.google.guava</groupId> @@ -295,7 +255,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>${spring-boot.version}</version> <executions> <execution> <goals> @@ -304,7 +264,7 @@ <configuration> <classifier>spring-boot</classifier> <mainClass> - org.opengroup.osdu.search.provider.azure.SearchApplication + org.opengroup.osdu.search.provider.azure.SearchAzureApplication </mainClass> </configuration> </execution> diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/SearchApplication.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/SearchAzureApplication.java similarity index 92% rename from provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/SearchApplication.java rename to provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/SearchAzureApplication.java index 245a6a041..274715414 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/SearchApplication.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/SearchAzureApplication.java @@ -25,11 +25,11 @@ import org.springframework.context.annotation.PropertySource; org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration.class}) @PropertySource("classpath:swagger.properties") -public class SearchApplication { +public class SearchAzureApplication { public static void main(String[] args) { - SpringApplication.run(SearchApplication.class, args); + SpringApplication.run(SearchAzureApplication.class, args); } diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/CursorCacheImpl.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/CursorCacheImpl.java index 3ed169671..d437dcdbc 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/CursorCacheImpl.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/CursorCacheImpl.java @@ -14,7 +14,7 @@ package org.opengroup.osdu.search.provider.azure.cache.impl; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.model.search.CursorSettings; @@ -46,4 +46,4 @@ public class CursorCacheImpl implements CursorCache { public void clearAll() { this.cache.clearAll(); } -} \ No newline at end of file +} diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/ElasticCredentialsCacheImpl.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/ElasticCredentialsCacheImpl.java index 9066db353..8aa594cc0 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/ElasticCredentialsCacheImpl.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/ElasticCredentialsCacheImpl.java @@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; -import javax.annotation.Resource; +import jakarta.annotation.Resource; @Component("clusterSettingsCache") @ConditionalOnProperty(value = "elasticSearchCred.cache.provider", havingValue = "redis") diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheImpl.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheImpl.java index d5f05ba95..9522e8026 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheImpl.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheImpl.java @@ -22,7 +22,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; -import javax.annotation.Resource; +import jakarta.annotation.Resource; @Component @Primary diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/config/AzureBootstrapConfig.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/config/AzureBootstrapConfig.java index 36fdc3e47..a394f557b 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/config/AzureBootstrapConfig.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/config/AzureBootstrapConfig.java @@ -23,7 +23,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import javax.inject.Named; +import jakarta.inject.Named; + +import java.time.Duration; @Configuration public class AzureBootstrapConfig { @@ -72,4 +74,9 @@ public class AzureBootstrapConfig { .build(); return new EntitlementsFactory(apiConfig, httpResponseBodyMapper); } + + @Bean + public Duration slowIndicatorLoggingThreshold() { + return Duration.ofSeconds(5); + } } diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/CrossTenantInfoServiceImpl.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/CrossTenantInfoServiceImpl.java index 7dfa76d62..b564b75c1 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/CrossTenantInfoServiceImpl.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/CrossTenantInfoServiceImpl.java @@ -23,7 +23,7 @@ import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory; import org.opengroup.osdu.search.provider.interfaces.ICrossTenantInfoService; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.LinkedList; import java.util.List; diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AADSecurityConfig.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AADSecurityConfig.java index 5a9a61453..4098277e4 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AADSecurityConfig.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AADSecurityConfig.java @@ -14,22 +14,26 @@ package org.opengroup.osdu.search.provider.azure.security; -import com.azure.spring.autoconfigure.aad.AADAppRoleStatelessAuthenticationFilter; +import com.azure.spring.cloud.autoconfigure.implementation.aad.filter.AadAppRoleStatelessAuthenticationFilter; import org.springframework.beans.factory.annotation.Autowired; 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; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +@Configuration @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) +@EnableMethodSecurity @ConditionalOnProperty(value = "azure.istio.auth.enabled", havingValue = "false", matchIfMissing = false) -public class AADSecurityConfig extends WebSecurityConfigurerAdapter { +public class AADSecurityConfig { @Autowired - private AADAppRoleStatelessAuthenticationFilter appRoleAuthFilter; + private AadAppRoleStatelessAuthenticationFilter appRoleAuthFilter; public static final String[] AUTH_ALLOWLIST = {"/", "/index.html", "/api-docs.yaml", @@ -40,16 +44,13 @@ public class AADSecurityConfig extends WebSecurityConfigurerAdapter { "/swagger-ui/**" }; - @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 securityFilterChain(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/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AzureIstioSecurityConfig.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AzureIstioSecurityConfig.java index d2f3ddc61..80f9a6480 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AzureIstioSecurityConfig.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/AzureIstioSecurityConfig.java @@ -16,20 +16,26 @@ package org.opengroup.osdu.search.provider.azure.security; 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.web.SecurityFilterChain; + +@Configuration @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) +@EnableMethodSecurity @ConditionalOnProperty(value = "azure.istio.auth.enabled", havingValue = "true", matchIfMissing = true) -public class AzureIstioSecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.httpBasic().disable() - .csrf().disable(); //AuthN is disabled. AuthN is handled by sidecar proxy +public class AzureIstioSecurityConfig { + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + return http + .csrf(AbstractHttpConfigurer::disable) + .httpBasic(httpBasic->httpBasic.disable()) + .build(); //AuthN is disabled. AuthN is handled by sidecar proxy } } diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/RequestRejectedExceptionFilter.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/RequestRejectedExceptionFilter.java index 6789abd81..fc3e52bea 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/RequestRejectedExceptionFilter.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/security/RequestRejectedExceptionFilter.java @@ -11,12 +11,12 @@ import org.springframework.security.web.firewall.RequestRejectedException; import org.springframework.stereotype.Component; import org.springframework.web.filter.GenericFilterBean; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; @Component @@ -55,4 +55,4 @@ public class RequestRejectedExceptionFilter extends GenericFilterBean { String queryString = request.getQueryString(); return queryString == null ? requestURL.toString() : requestURL.append('?').append(queryString).toString(); } -} \ No newline at end of file +} diff --git a/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/FieldTypeMappingCacheImplTest.java b/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/FieldTypeMappingCacheImplTest.java index 3c82a7023..be95a121d 100644 --- a/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/FieldTypeMappingCacheImplTest.java +++ b/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/FieldTypeMappingCacheImplTest.java @@ -7,10 +7,14 @@ import org.mockito.MockedConstruction; import org.mockito.MockitoAnnotations; import org.mockito.junit.jupiter.MockitoExtension; import org.opengroup.osdu.core.common.cache.VmCache; +import org.springframework.util.ReflectionUtils; + +import java.lang.reflect.Field; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mockConstruction; +import static org.mockito.Mockito.spy; @ExtendWith(MockitoExtension.class) public class FieldTypeMappingCacheImplTest { @@ -22,11 +26,13 @@ public class FieldTypeMappingCacheImplTest { @Test public void when_FieldTypeMappingCache_isCreated_then_VMCacheConstructorIsCalled_and_objectReturnedIsNotNull() { - try (MockedConstruction<VmCache> vmCacheClass = mockConstruction( - VmCache.class)) { - FieldTypeMappingCacheImpl fieldTypeMappingCache = new FieldTypeMappingCacheImpl(); - assertNotNull(fieldTypeMappingCache); - assertEquals(1, vmCacheClass.constructed().size()); - } + FieldTypeMappingCacheImpl spyCache = spy(new FieldTypeMappingCacheImpl()); + Field field = ReflectionUtils.findField(VmCache.class, "cache"); + assertNotNull(field); + + ReflectionUtils.makeAccessible(field); + Object cacheValue = ReflectionUtils.getField(field, spyCache); + + assertNotNull(cacheValue); } } diff --git a/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheTest.java b/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheTest.java index 4dca9e2c5..47a44e516 100644 --- a/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheTest.java +++ b/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/cache/impl/IndexAliasCacheTest.java @@ -25,7 +25,7 @@ import org.opengroup.osdu.core.common.cache.ICache; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import java.util.concurrent.atomic.AtomicReference; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; diff --git a/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/provider.impl/AzureAuthorizationServiceTest.java b/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/provider.impl/AzureAuthorizationServiceTest.java index e30daad67..c788535f8 100644 --- a/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/provider.impl/AzureAuthorizationServiceTest.java +++ b/provider/search-azure/src/test/java/org/opengroup/osdu/search/provider/azure/provider.impl/AzureAuthorizationServiceTest.java @@ -46,7 +46,6 @@ public class AzureAuthorizationServiceTest { @Test public void should_throwAppException_when_givenGroupDoesNotExistForUser() { - when(groups.any(any())).thenReturn(false); when(entitlementsService.getGroups(any())).thenReturn(groups); DpsHeaders dpsHeaders = new DpsHeaders(); @@ -55,12 +54,10 @@ public class AzureAuthorizationServiceTest { @Test public void should_returnGroupsWithUserEmail_when_givenGroupExistsForUser() { - when(groups.any(any())).thenReturn(true); + String groupNames[]= {"a", "b"}; + when(groups.any(groupNames)).thenReturn(true); when(entitlementsService.getGroups(any())).thenReturn(groups); - - AuthorizationResponse authorizationResponse = sut.authorizeAny(new DpsHeaders(), "a", "b"); - - assertNotNull(authorizationResponse); + assertNotNull(sut.authorizeAny(new DpsHeaders(), groupNames)); } @Test diff --git a/provider/search-byoc/pom.xml b/provider/search-byoc/pom.xml deleted file mode 100644 index 3f7d52f6d..000000000 --- a/provider/search-byoc/pom.xml +++ /dev/null @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Copyright 2017-2019, Schlumberger - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - 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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <artifactId>search-byoc</artifactId> - <description>In memory implementation of Search service APIs</description> - <packaging>jar</packaging> - - <parent> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-search</artifactId> - <version>0.27.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <properties> - <java.version>17</java.version> - <maven.compiler.target>17</maven.compiler.target> - <maven.compiler.source>17</maven.compiler.source> - <maven.war.plugin>2.6</maven.war.plugin> - <appengine.maven.plugin>1.0.0</appengine.maven.plugin> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <failOnMissingWebXml>false</failOnMissingWebXml> - <project.main.basedir>${project.parent.basedir}</project.main.basedir> - <spring-webmvc.version>5.3.22</spring-webmvc.version> - </properties> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>5.3.30</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>5.3.30</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - </exclusion> - </exclusions> - <version>2.7.17</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core</artifactId> - <version>5.7.11</version> - </dependency> - </dependencies> - </dependencyManagement> - - <dependencies> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>search-core</artifactId> - <version>0.27.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - <version>${osdu.oscorecommon.version}</version> - </dependency> - - <dependency> - <groupId>pl.allegro.tech</groupId> - <artifactId>embedded-elasticsearch</artifactId> - <version>2.10.0</version> -<!-- <scope>test</scope>--> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${spring-webmvc.version}</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-security</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-data-redis</artifactId> - </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> - <pluginManagement> - <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.search.provider.byoc.SearchApplication - </mainClass> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </pluginManagement> - </build> -</project> diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/SearchApplication.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/SearchApplication.java deleted file mode 100644 index 3e30753a9..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/SearchApplication.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.opengroup.osdu.search.provider.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.search","org.opengroup.osdu.core.common","org.opengroup.osdu.is.core"}) -@SpringBootApplication( - exclude = { - org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, - org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration.class}) -@PropertySource("classpath:swagger.properties") -public class SearchApplication { - - public static void main(String[] args) { - - SpringApplication.run(SearchApplication.class, args); - - } - -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsFactoryByoc.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsFactoryByoc.java deleted file mode 100644 index 41fd12625..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/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.search.provider.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/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsServiceByoc.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsServiceByoc.java deleted file mode 100644 index eb2c19ef5..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/di/EntitlementsServiceByoc.java +++ /dev/null @@ -1,94 +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.search.provider.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.http.HttpResponse; -import org.opengroup.osdu.core.common.model.search.SearchServiceRole; -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(SearchServiceRole.PREFIX)) { - role = role.substring(SearchServiceRole.PREFIX.length()); - } - gi.setName(role); - gi.setEmail(email); - giList.add(gi); - } - if (giList.size() > 0) { - Groups groups = new Groups(); - groups.setGroups(giList); - groups.setMemberEmail(email); - 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/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/model/RedisProperties.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/model/RedisProperties.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CrossTenantInfoServiceImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CrossTenantInfoServiceImpl.java deleted file mode 100644 index 16854d614..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CrossTenantInfoServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.provider.impl; - - -import java.util.ArrayList; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.core.common.model.http.DpsHeaders; -import org.opengroup.osdu.core.common.multitenancy.ITenantInfoService; -import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory; -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.search.provider.interfaces.ICrossTenantInfoService; -import org.springframework.stereotype.Service; - -import javax.inject.Inject; -import java.util.LinkedList; -import java.util.List; - -@Service -public class CrossTenantInfoServiceImpl implements ITenantInfoService, ICrossTenantInfoService { - - @Inject - private ITenantFactory tenantFactory; - - @Inject - private DpsHeaders headers; - - @Override - public TenantInfo getTenantInfo() { - String primaryAccountId = this.headers.getPartitionIdWithFallbackToAccountId(); - TenantInfo tenantInfo = this.tenantFactory.getTenantInfo(primaryAccountId); - if (tenantInfo == null) { - throw AppException.createUnauthorized(String.format("could not retrieve tenant info for data partition id: %s", primaryAccountId)); - } - return tenantInfo; - } - - @Override - public List<TenantInfo> getAllTenantInfos() { - return new ArrayList<>(tenantFactory.listTenantInfo()); - } - - @Override - public List<TenantInfo> getAllTenantsFromPartitionId() { - List<TenantInfo> tenantInfos = new LinkedList<>(); - - String[] accountIdList = headers.getPartitionIdWithFallbackToAccountId().split(","); - //Get all tenant values requested by user - for (String accountId : accountIdList) { - TenantInfo tenantInfo = tenantFactory.getTenantInfo(accountId); - tenantInfos.add(tenantInfo); - } - return tenantInfos; - } - -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CursorCacheImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CursorCacheImpl.java deleted file mode 100644 index 93fec365b..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/CursorCacheImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.opengroup.osdu.search.provider.byoc.provider.impl; - -import org.opengroup.osdu.core.common.cache.VmCache; -import org.opengroup.osdu.search.cache.CursorCache; -import org.opengroup.osdu.core.common.model.search.CursorSettings; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -@Component -public class CursorCacheImpl implements CursorCache { - - private VmCache<String, CursorSettings> cache; - - public CursorCacheImpl(@Value("${ELASTIC_CACHE_EXPIRATION}") final String ELASTIC_CACHE_EXPIRATION, - @Value("${MAX_CACHE_VALUE_SIZE}") final String MAX_CACHE_VALUE_SIZE) { - cache = new VmCache<>(Integer.parseInt(ELASTIC_CACHE_EXPIRATION) * 60, - Integer.parseInt(MAX_CACHE_VALUE_SIZE)); - } - - @Override - public void put(String s, CursorSettings o) { - this.cache.put(s,o); - } - - @Override - public CursorSettings get(String s) { - return this.cache.get(s); - } - - @Override - public void delete(String s) { - this.cache.delete(s); - } - - @Override - public void clearAll() { - this.cache.clearAll(); - } -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryBase.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryBase.java deleted file mode 100644 index 7b4c6282b..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryBase.java +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.provider.impl; - -import org.apache.commons.lang3.StringUtils; -import org.elasticsearch.ElasticsearchStatusException; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.RequestOptions; -import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.WrapperQueryBuilder; -import org.elasticsearch.rest.RestStatus; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.aggregations.Aggregation; -import org.elasticsearch.search.aggregations.bucket.nested.ParsedNested; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder; -import org.elasticsearch.search.fetch.subphase.highlight.HighlightField; -import org.elasticsearch.search.sort.FieldSortBuilder; -import org.elasticsearch.search.sort.SortOrder; -import org.opengroup.osdu.core.common.model.http.DpsHeaders; -import org.opengroup.osdu.core.common.model.entitlements.AclRole; -import org.opengroup.osdu.core.common.model.search.*; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; -import org.opengroup.osdu.search.policy.service.IPolicyService; -import org.opengroup.osdu.search.provider.interfaces.IProviderHeaderService; -import org.opengroup.osdu.search.util.AggregationParserUtil; -import org.opengroup.osdu.search.util.IQueryParserUtil; -import org.opengroup.osdu.search.util.ISortParserUtil; -import org.springframework.beans.factory.annotation.Autowired; - -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -import static org.elasticsearch.index.query.QueryBuilders.*; - -abstract class QueryBase { - - @Inject - DpsHeaders dpsHeaders; - - @Inject - private JaxRsDpsLog log; - - @Inject - private IProviderHeaderService providerHeaderService; - - @Autowired(required = false) - private IPolicyService iPolicyService; - @Autowired - private IQueryParserUtil queryParserUtil; - @Autowired - private ISortParserUtil sortParserUtil; - - - // if returnedField contains property matching from excludes than query result will NOT include that property - private final Set<String> excludes = new HashSet<>(Arrays.asList(RecordMetaAttribute.X_ACL.getValue())); - - // queryableExcludes properties can be returned by query results - private final Set<String> queryableExcludes = new HashSet<>(Arrays.asList(RecordMetaAttribute.INDEX_STATUS.getValue())); - - private final TimeValue REQUEST_TIMEOUT = TimeValue.timeValueMinutes(1); - - QueryBuilder buildQuery(String simpleQuery, SpatialFilter spatialFilter, boolean asOwner) throws AppException { - - QueryBuilder textQueryBuilder = null; - QueryBuilder spatialQueryBuilder = null; - QueryBuilder queryBuilder = null; - - if (!Strings.isNullOrEmpty(simpleQuery)) { - textQueryBuilder = queryParserUtil.buildQueryBuilderFromQueryString(simpleQuery); - } - - // use only one of the spatial request - if (spatialFilter != null) { - if (spatialFilter.getByBoundingBox() != null) { - spatialQueryBuilder = getBoundingBoxQuery(spatialFilter); - } else if (spatialFilter.getByDistance() != null) { - spatialQueryBuilder = getDistanceQuery(spatialFilter); - } else if (spatialFilter.getByGeoPolygon() != null) { - spatialQueryBuilder = getGeoPolygonQuery(spatialFilter); - } - } - - if (textQueryBuilder != null) { - queryBuilder = boolQuery().must(textQueryBuilder); - } - if (spatialQueryBuilder != null) { - queryBuilder = queryBuilder != null ? boolQuery().must(queryBuilder).must(spatialQueryBuilder) : boolQuery().must(spatialQueryBuilder); - } - - if(this.iPolicyService != null) { - String compiledESPolicy = this.iPolicyService.getCompiledPolicy(providerHeaderService); - WrapperQueryBuilder wrapperQueryBuilder = new WrapperQueryBuilder(compiledESPolicy); - return queryBuilder != null ? boolQuery().must(queryBuilder).must(wrapperQueryBuilder) : boolQuery().must(wrapperQueryBuilder); - } else { - return getQueryBuilderWithAuthorization(queryBuilder, asOwner); - } - } - - private QueryBuilder getQueryBuilderWithAuthorization(QueryBuilder queryBuilder, boolean asOwner) { - if (userHasFullDataAccess()) { - return queryBuilder; - } - - QueryBuilder authorizationQueryBuilder = null; - String groups = dpsHeaders.getHeaders().get(providerHeaderService.getDataGroupsHeader()); - if (groups != null) { - String[] groupArray = groups.trim().split("\\s*,\\s*"); - if (asOwner) { - authorizationQueryBuilder = boolQuery().minimumShouldMatch("1").should(termsQuery(AclRole.OWNERS.getPath(), groupArray)); - } else { - authorizationQueryBuilder = boolQuery().minimumShouldMatch("1").should(termsQuery(RecordMetaAttribute.X_ACL.getValue(), groupArray)); - } - } - if (authorizationQueryBuilder != null) { - queryBuilder = queryBuilder != null ? boolQuery().must(queryBuilder).must(authorizationQueryBuilder) : boolQuery().must(authorizationQueryBuilder); - } - return queryBuilder; - } - - private QueryBuilder getSimpleQuery(String searchQuery) { - - // if query is empty , then put * - String query = StringUtils.isNotBlank(searchQuery) ? searchQuery : "*"; - return queryStringQuery(query).allowLeadingWildcard(false); - } - - private QueryBuilder getBoundingBoxQuery(SpatialFilter spatialFilter) throws AppException { - - GeoPoint topLeft = new GeoPoint(spatialFilter.getByBoundingBox().getTopLeft().getLatitude(), spatialFilter.getByBoundingBox().getTopLeft().getLongitude()); - GeoPoint bottomRight = new GeoPoint(spatialFilter.getByBoundingBox().getBottomRight().getLatitude(), spatialFilter.getByBoundingBox().getBottomRight().getLongitude()); - return geoBoundingBoxQuery(spatialFilter.getField()).setCorners(topLeft, bottomRight).ignoreUnmapped(true); - } - - private QueryBuilder getDistanceQuery(SpatialFilter spatialFilter) throws AppException { - - return geoDistanceQuery(spatialFilter.getField()) - .point(spatialFilter.getByDistance().getPoint().getLatitude(), spatialFilter.getByDistance().getPoint().getLongitude()) - .distance(spatialFilter.getByDistance().getDistance(), DistanceUnit.METERS).ignoreUnmapped(true); - } - - private QueryBuilder getGeoPolygonQuery(SpatialFilter spatialFilter) throws AppException { - - List<GeoPoint> points = new ArrayList<>(); - for (Point point : spatialFilter.getByGeoPolygon().getPoints()) { - points.add(new GeoPoint(point.getLatitude(), point.getLongitude())); - } - return geoPolygonQuery(spatialFilter.getField(), points).ignoreUnmapped(true); - } - - List<Map<String, Object>> getHitsFromSearchResponse(SearchResponse searchResponse) { - List<Map<String, Object>> results = new ArrayList<>(); - SearchHits searchHits = searchResponse.getHits(); - if (searchHits.getHits().length != 0) { - for (SearchHit searchHitFields : searchHits.getHits()) { - Map<String, Object> hitFields = searchHitFields.getSourceAsMap(); - if (!searchHitFields.getHighlightFields().isEmpty()) { - Map<String, List<String>> highlights = new HashMap<>(); - for (HighlightField hf : searchHitFields.getHighlightFields().values()) { - if (!hf.getName().equalsIgnoreCase(RecordMetaAttribute.X_ACL.getValue())) { - Text[] fragments = hf.getFragments(); - highlights.put( - hf.getName(), - Arrays.asList(fragments).stream().map(x -> x.toString()).collect(Collectors.toList()) - ); - } - } - hitFields.put("highlight", highlights); - } - results.add(hitFields); - } - return results; - } - - return null; - } - - - - List<AggregationResponse> getAggregationFromSearchResponse(SearchResponse searchResponse) { - List<AggregationResponse> results = null; - - if (searchResponse.getAggregations() != null) { - Terms kindAgg = null; - ParsedNested nested = searchResponse.getAggregations().get(AggregationParserUtil.NESTED_AGGREGATION_NAME); - if(nested != null){ - kindAgg = (Terms) getTermsAggregationFromNested(nested); - }else { - kindAgg = searchResponse.getAggregations().get(AggregationParserUtil.TERM_AGGREGATION_NAME); - } - if (kindAgg.getBuckets() != null) { - results = new ArrayList<>(); - for (Terms.Bucket bucket : kindAgg.getBuckets()) { - results.add(AggregationResponse.builder().key(bucket.getKeyAsString()).count(bucket.getDocCount()).build()); - } - } - } - - return results; - } - - private Aggregation getTermsAggregationFromNested(ParsedNested parsedNested){ - ParsedNested nested = parsedNested.getAggregations().get(AggregationParserUtil.NESTED_AGGREGATION_NAME); - if(nested != null){ - return getTermsAggregationFromNested(nested); - }else { - return parsedNested.getAggregations().get(AggregationParserUtil.TERM_AGGREGATION_NAME); - } - } - - SearchSourceBuilder createSearchSourceBuilder(Query request) { - SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); - - // build query: set query options and query - QueryBuilder queryBuilder = buildQuery(request.getQuery(), request.getSpatialFilter(), request.isQueryAsOwner()); - sourceBuilder.size(QueryUtils.getResultSizeForQuery(request.getLimit())); - sourceBuilder.query(queryBuilder); - sourceBuilder.timeout(REQUEST_TIMEOUT); - if (request.isTrackTotalCount()) { - sourceBuilder.trackTotalHits(request.isTrackTotalCount()); - } - - // set highlighter - if (!Objects.isNull(request.getHighlightedFields())) { - HighlightBuilder highlightBuilder = new HighlightBuilder(); - highlightBuilder = request.getHighlightedFields().stream().reduce( - highlightBuilder, (builder, fieldName) -> builder.field(fieldName, 200, 5), (a, b) -> a - ); - sourceBuilder.highlighter(highlightBuilder); - } - - // sort: text is not suitable for sorting or aggregation, refer to: this: https://github.com/elastic/elasticsearch/issues/28638, - // so keyword is recommended for unmappedType in general because it can handle both string and number. - // It will ignore the characters longer than the threshold when sorting. - if (request.getSort() != null) { - for (int idx = 0; idx < request.getSort().getField().size(); idx++) { - sourceBuilder.sort(sortParserUtil.parseSort( - request.getSort().getFieldByIndex(idx), - request.getSort().getOrderByIndex(idx).name(), - request.getSort().getFilterByIndex(idx)) - ); - } - } - - // set the return fields - List<String> returnedFields = request.getReturnedFields(); - if (returnedFields == null) { - returnedFields = new ArrayList<>(); - } - Set<String> returnedFieldsSet = new HashSet<>(returnedFields); - String[] includesArr = returnedFieldsSet.toArray(new String[returnedFieldsSet.size()]); - - // remove all matching returnedField and queryable from excludes - Set<String> requestQueryableExcludes = new HashSet<>(queryableExcludes); - Set<String> requestExcludes = new HashSet<>(excludes); - requestQueryableExcludes.removeAll(returnedFields); - requestExcludes.addAll(requestQueryableExcludes); - String[] excludesArr = requestExcludes.toArray(new String[requestExcludes.size()]); - - sourceBuilder.fetchSource(includesArr, excludesArr); - return sourceBuilder; - } - - SearchResponse makeSearchRequest(Query searchRequest, RestHighLevelClient client) { - Long startTime = 0L; - SearchRequest elasticSearchRequest = null; - SearchResponse searchResponse = null; - - try { - elasticSearchRequest = createElasticRequest(searchRequest); - startTime = System.currentTimeMillis(); - searchResponse = client.search(elasticSearchRequest, RequestOptions.DEFAULT); - return searchResponse; - } catch (ElasticsearchStatusException e) { - switch (e.status()) { - case NOT_FOUND: - throw new AppException(HttpServletResponse.SC_NOT_FOUND, "Not Found","Resource you are trying to find does not exists", e); - case BAD_REQUEST: - throw new AppException(HttpServletResponse.SC_BAD_REQUEST, "Bad Request", "Invalid parameters were given on org.opengroup.osdu.search.search request", e); - case SERVICE_UNAVAILABLE: - throw new AppException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Search error", "Please re-try org.opengroup.osdu.search.search after some time.", e); - default: - throw new AppException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Search error", "Error processing org.opengroup.osdu.search.search request", e); - } - } catch (AppException e) { - throw e; - } catch (IOException e) { - if(e.getMessage().startsWith("listener timeout after waiting for")) { - throw new AppException(HttpServletResponse.SC_GATEWAY_TIMEOUT, "Search error", String.format("Request timed out after waiting for %sm", REQUEST_TIMEOUT.getMinutes()), e); - } - throw new AppException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Search error", "Error processing org.opengroup.osdu.search.search request", e); - } catch (Exception e) { - throw new AppException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Search error", "Error processing org.opengroup.osdu.search.search request", e); - } finally { - Long latency = System.currentTimeMillis() - startTime; - String request = elasticSearchRequest != null ? elasticSearchRequest.source().toString() : searchRequest.toString(); - this.log.info(String.format("elastic latency: %s | elastic request-payload: %s", latency, request)); - this.auditLog(searchRequest, searchResponse); - } - } - - abstract SearchRequest createElasticRequest(Query request) throws AppException; - - - abstract void querySuccessAuditLogger(Query request); - - abstract void queryFailedAuditLogger(Query request); - - private void auditLog(Query searchRequest, SearchResponse searchResponse) { - if (searchResponse != null && searchResponse.status() == RestStatus.OK) { - this.querySuccessAuditLogger(searchRequest); - return; - } - this.queryFailedAuditLogger(searchRequest); - } - - private boolean userHasFullDataAccess() { - String dataRootUser = dpsHeaders.getHeaders().getOrDefault(providerHeaderService.getDataRootUserHeader(), "false"); - return Boolean.parseBoolean(dataRootUser); - } -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryServiceImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryServiceImpl.java deleted file mode 100644 index ae4dbefea..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/QueryServiceImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.provider.impl; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.search.builder.SearchSourceBuilder; - -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.search.config.SearchConfigurationProperties; -import org.opengroup.osdu.search.util.ElasticClientHandler; -import org.opengroup.osdu.search.logging.AuditLogger; -import org.opengroup.osdu.core.common.model.search.AggregationResponse; -import org.opengroup.osdu.core.common.model.search.Query; -import org.opengroup.osdu.core.common.model.search.QueryRequest; -import org.opengroup.osdu.core.common.model.search.QueryResponse; -import org.opengroup.osdu.search.util.CrossTenantUtils; -import org.opengroup.osdu.search.provider.interfaces.IQueryService; -import org.opengroup.osdu.search.util.IAggregationParserUtil; -import org.opengroup.osdu.search.util.SearchRequestUtil; -import org.springframework.stereotype.Service; - -import javax.inject.Inject; -import java.io.IOException; -import java.util.List; -import java.util.Map; - - -@Service -public class QueryServiceImpl extends QueryBase implements IQueryService { - - @Inject - private ElasticClientHandler elasticClientHandler; - @Inject - private CrossTenantUtils crossTenantUtils; - @Inject - private AuditLogger auditLogger; - @Inject - private SearchConfigurationProperties configurationProperties; - @Inject - private IAggregationParserUtil aggregationParserUtil; - - @Override - public QueryResponse queryIndex(QueryRequest searchRequest) throws IOException { - try (RestHighLevelClient client = this.elasticClientHandler.createRestClient()) { - QueryResponse queryResponse = this.executeQuery(searchRequest, client); - return queryResponse; - } - } - - private QueryResponse executeQuery(QueryRequest searchRequest, RestHighLevelClient client) throws AppException { - SearchResponse searchResponse = this.makeSearchRequest(searchRequest, client); - List<Map<String, Object>> results = this.getHitsFromSearchResponse(searchResponse); - List<AggregationResponse> aggregations = getAggregationFromSearchResponse(searchResponse); - - QueryResponse queryResponse = QueryResponse.getEmptyResponse(); - queryResponse.setTotalCount(searchResponse.getHits().getTotalHits().value); - if (results != null) { - queryResponse.setAggregations(aggregations); - queryResponse.setResults(results); - } - return queryResponse; - } - - @Override - SearchRequest createElasticRequest(Query request) throws AppException { - QueryRequest searchRequest = (QueryRequest) request; - - // set the indexes to org.opengroup.osdu.search.search against - String index = this.crossTenantUtils.getIndexName(request); - SearchRequest elasticSearchRequest = SearchRequestUtil.createSearchRequest(index); - - // build query - SearchSourceBuilder sourceBuilder = this.createSearchSourceBuilder(request); - sourceBuilder.from(searchRequest.getFrom()); - - // aggregation: only make it available in pre demo for now - if (configurationProperties.isPreDemo() && !Strings.isNullOrEmpty(searchRequest.getAggregateBy())) { - sourceBuilder.aggregation(aggregationParserUtil.parseAggregation(searchRequest.getAggregateBy())); - } - - elasticSearchRequest.source(sourceBuilder); - - return elasticSearchRequest; - } - - - @Override - void querySuccessAuditLogger(Query request) { - this.auditLogger.queryIndexSuccess(Lists.newArrayList(request.toString())); - } - - @Override - void queryFailedAuditLogger(Query request) { - this.auditLogger.queryIndexFailed(Lists.newArrayList(request.toString())); - } -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/ScrollQueryServiceImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/ScrollQueryServiceImpl.java deleted file mode 100644 index 8b19fd56d..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/impl/ScrollQueryServiceImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.provider.impl; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import org.apache.http.HttpStatus; -import org.elasticsearch.ElasticsearchStatusException; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchScrollRequest; -import org.elasticsearch.client.RequestOptions; -import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.search.Scroll; -import org.elasticsearch.search.builder.SearchSourceBuilder; - -import org.elasticsearch.search.sort.SortBuilders; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.search.util.ElasticClientHandler; -import org.opengroup.osdu.search.cache.CursorCache; -import org.opengroup.osdu.search.logging.AuditLogger; -import org.opengroup.osdu.core.common.model.search.CursorQueryRequest; -import org.opengroup.osdu.core.common.model.search.CursorQueryResponse; -import org.opengroup.osdu.core.common.model.search.CursorSettings; -import org.opengroup.osdu.core.common.model.search.Query; -import org.opengroup.osdu.search.provider.interfaces.IScrollQueryService; -import org.opengroup.osdu.search.util.CrossTenantUtils; -import org.opengroup.osdu.search.util.ResponseExceptionParser; -import org.opengroup.osdu.search.util.SearchRequestUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.DatatypeConverter; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.List; -import java.util.Map; - -import static org.elasticsearch.rest.RestStatus.NOT_FOUND; - -@Service -public class ScrollQueryServiceImpl extends QueryBase implements IScrollQueryService { - - private final TimeValue SEARCH_SCROLL_TIMEOUT = TimeValue.timeValueSeconds(90L); - - @Inject - private ElasticClientHandler elasticClientHandler; - - @Inject - private CursorCache cursorCache; - - @Inject - private CrossTenantUtils crossTenantUtils; - - @Inject - private AuditLogger auditLogger; - - @Autowired - private ResponseExceptionParser exceptionParser; - - private final MessageDigest digest; - - ScrollQueryServiceImpl() throws NoSuchAlgorithmException { - this.digest = MessageDigest.getInstance("MD5"); - } - - @Override - public CursorQueryResponse queryIndex(CursorQueryRequest searchRequest) throws Exception { - - CursorQueryResponse queryResponse = CursorQueryResponse.getEmptyResponse(); - - try (RestHighLevelClient client = this.elasticClientHandler.createRestClient()) { - if (Strings.isNullOrEmpty(searchRequest.getCursor())) { - try { - return this.initCursorQuery(searchRequest, client); - } catch (AppException e) { - if (this.exceptionParser.parseException(e).stream().anyMatch(r -> r.contains("Trying to create too many scroll contexts. Must be less than or equal to:"))) { - throw new AppException(429, "Too many requests", "Too many cursor requests, please re-try after some time.", e); - } - throw e; - } - } else { - try { - CursorSettings cursorSettings = null;//this.cursorCache.get(searchRequest.getCursor()); - if (cursorSettings != null) { - if (!this.dpsHeaders.getUserEmail().equals(cursorSettings.getUserId())) { - throw new AppException(HttpServletResponse.SC_FORBIDDEN, "cursor issuer doesn't match the cursor consumer", "cursor sharing is forbidden"); - } - - SearchScrollRequest scrollRequest = new SearchScrollRequest(cursorSettings.getCursor()); - scrollRequest.scroll(SEARCH_SCROLL_TIMEOUT); - SearchResponse searchScrollResponse = client.scroll(scrollRequest, RequestOptions.DEFAULT); - - List<Map<String, Object>> results = getHitsFromSearchResponse(searchScrollResponse); - queryResponse.setTotalCount(searchScrollResponse.getHits().getTotalHits().value); - if (results != null) { - queryResponse.setResults(results); - queryResponse.setCursor(this.refreshCursorCache(searchScrollResponse.getScrollId(), dpsHeaders.getUserEmail())); - - this.querySuccessAuditLogger(searchRequest); - } - } else { - throw new AppException(HttpServletResponse.SC_BAD_REQUEST, "Can't find the given cursor", "The given cursor is invalid or expired"); - } - } catch (AppException e) { - throw e; - } catch (ElasticsearchStatusException e) { - String invalidScrollMessage = "No search context found for id"; - if (e.status() == NOT_FOUND - && (e.getMessage().startsWith(invalidScrollMessage)) || this.exceptionParser.parseException(e).stream().anyMatch(r -> r.contains(invalidScrollMessage))) - throw new AppException(HttpStatus.SC_BAD_REQUEST, "Can't find the given cursor", "The given cursor is invalid or expired", e); - throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Search error", "Error processing search request", e); - } catch (Exception e) { - throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Search error", "Error processing search request", e); - } - } - return queryResponse; - } - } - - private CursorQueryResponse initCursorQuery(CursorQueryRequest searchRequest, RestHighLevelClient client) { - CursorQueryResponse queryResponse = this.executeCursorQuery(searchRequest, client); - return queryResponse; - } - - private CursorQueryResponse executeCursorQuery(CursorQueryRequest searchRequest, RestHighLevelClient client) throws AppException { - - SearchResponse searchResponse = this.makeSearchRequest(searchRequest, client); - List<Map<String, Object>> results = this.getHitsFromSearchResponse(searchResponse); - if (results != null) { - return CursorQueryResponse.builder() - .cursor(refreshCursorCache(searchResponse.getScrollId(), dpsHeaders.getUserEmail())) - .results(results) - .totalCount(searchResponse.getHits().getTotalHits().value) - .build(); - } - return CursorQueryResponse.getEmptyResponse(); - } - - @Override - SearchRequest createElasticRequest(Query request) throws AppException { - - // set the indexes to org.opengroup.osdu.search.search against - String index = this.crossTenantUtils.getIndexName(request); - SearchRequest elasticSearchRequest = SearchRequestUtil.createSearchRequest(index); - - // build query - SearchSourceBuilder sourceBuilder = this.createSearchSourceBuilder(request); - - // Optimize Scroll request if users wants to iterate over all documents regardless of order - if (request.getSort() == null) { - sourceBuilder.sort(SortBuilders.scoreSort()); - sourceBuilder.sort(SortBuilders.fieldSort("_doc")); - } - - elasticSearchRequest.source(sourceBuilder); - elasticSearchRequest.scroll(new Scroll(SEARCH_SCROLL_TIMEOUT)); - - return elasticSearchRequest; - } - - String refreshCursorCache(String rawCursor, String userId) { - if (rawCursor != null) { - this.digest.update(rawCursor.getBytes()); - String hashCursor = DatatypeConverter.printHexBinary(this.digest.digest()).toUpperCase(); - //this.cursorCache.put(hashCursor, CursorSettings.builder().cursor(rawCursor).userId(userId).build()); - return hashCursor; - } - return null; - } - - @Override - void querySuccessAuditLogger(Query request) { - this.auditLogger.queryIndexWithCursorSuccess(Lists.newArrayList(request.toString())); - } - - @Override - void queryFailedAuditLogger(Query request) { - this.auditLogger.queryIndexWithCursorFailed(Lists.newArrayList(request.toString())); - } -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ByocDatastoreFactory.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ByocDatastoreFactory.java deleted file mode 100644 index 851c3f3c8..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ByocDatastoreFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.provider.persistence; - -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.springframework.stereotype.Component; -import pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic; - -import java.util.HashMap; -import java.util.Map; - -@Component -public class ByocDatastoreFactory { - - public static Map<String, EmbeddedElastic> DATASTORE_CLIENTS = new HashMap<>(); - - public EmbeddedElastic getDatastoreInstance(TenantInfo tenantInfo) throws Exception{ - if (DATASTORE_CLIENTS.get(tenantInfo.getName()) == null) { - DATASTORE_CLIENTS.put(tenantInfo.getName(), DATASTORE_CLIENTS.get("byoc")); - } - return DATASTORE_CLIENTS.get(tenantInfo.getName()); - } - - -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticCredentialsCache.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticCredentialsCache.java deleted file mode 100644 index 64a438095..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticCredentialsCache.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.opengroup.osdu.search.provider.byoc.provider.persistence; - -import org.opengroup.osdu.core.common.cache.VmCache; -import org.opengroup.osdu.core.common.model.search.ClusterSettings; -import org.opengroup.osdu.core.common.provider.interfaces.IElasticCredentialsCache; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - - -@Component -public class ElasticCredentialsCache implements IElasticCredentialsCache<String, ClusterSettings> { - - private VmCache<String, ClusterSettings> cache; - - public ElasticCredentialsCache(@Value("${ELASTIC_CACHE_EXPIRATION}") final String ELASTIC_CACHE_EXPIRATION, - @Value("${MAX_CACHE_VALUE_SIZE}") final String MAX_CACHE_VALUE_SIZE) { - cache = new VmCache<>(Integer.parseInt(ELASTIC_CACHE_EXPIRATION) * 60, - Integer.parseInt(MAX_CACHE_VALUE_SIZE)); - } - - @Override - public void put(String s, ClusterSettings o) { - this.cache.put(s,o); - } - - @Override - public ClusterSettings get(String s) { - return this.cache.get(s); - } - - @Override - public void delete(String s) { - this.cache.delete(s); - } - - @Override - public void clearAll() { - this.cache.clearAll(); - } -} - diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticRepositoryDatastore.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticRepositoryDatastore.java deleted file mode 100644 index 0e3b7eb9d..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/ElasticRepositoryDatastore.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.provider.persistence; - -import org.apache.http.HttpStatus; - -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.core.common.model.search.ClusterSettings; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.core.common.provider.interfaces.IElasticRepository; -import org.opengroup.osdu.core.common.search.Preconditions; -import org.springframework.stereotype.Component; -import pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic; - -import javax.inject.Inject; - -@Component -public class ElasticRepositoryDatastore implements IElasticRepository { - - @Inject - private ByocDatastoreFactory byocDatastoreFactory; - - @Override - public ClusterSettings getElasticClusterSettings(TenantInfo tenantInfo) { - - try{ - EmbeddedElastic byocDatastore = this.byocDatastoreFactory.getDatastoreInstance(tenantInfo); - - String host = "localhost"; - String portString = String.valueOf(byocDatastore.getHttpPort()); - String usernameAndPassword = ""; - Preconditions.checkNotNullOrEmpty(host, "host cannot be null"); - Preconditions.checkNotNullOrEmpty(portString, "port cannot be null"); - //Preconditions.checkNotNullOrEmpty(usernameAndPassword, "configuration cannot be null"); - int port = Integer.parseInt(portString); - return new ClusterSettings(host, port, usernameAndPassword, false, false); - } catch (Exception e) { - throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "BYOC Cluster setting fetch error", "An error has occurred fetching cluster settings from the datastore.", e); - } - } -} \ No newline at end of file diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisConfiguration.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisConfiguration.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisRepository.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisRepository.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisRepositoryImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/provider/persistence/RedisRepositoryImpl.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/BasicAuthSecurityConfig.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/BasicAuthSecurityConfig.java deleted file mode 100644 index fc2fb619e..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/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.search.provider.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/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/WhoamiController.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/WhoamiController.java deleted file mode 100644 index 28dc56887..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/security/WhoamiController.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.search.provider.byoc.security; - -import io.swagger.v3.oas.annotations.Hidden; -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; - -@Hidden -@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/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/ElasticSettingServiceImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/ElasticSettingServiceImpl.java deleted file mode 100644 index 3c3c1395e..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/ElasticSettingServiceImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2017-2019, Schlumberger -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.search.provider.byoc.service; - -import org.apache.http.HttpStatus; -import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; -import org.opengroup.osdu.core.common.provider.interfaces.IElasticCredentialsCache; -import org.opengroup.osdu.core.common.model.http.AppException; -import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import org.opengroup.osdu.core.common.model.search.ClusterSettings; -import org.opengroup.osdu.core.common.provider.interfaces.IElasticRepository; -import org.opengroup.osdu.core.common.model.indexer.IElasticSettingService; -import org.opengroup.osdu.core.common.multitenancy.ITenantInfoService; -import org.opengroup.osdu.search.config.SearchConfigurationProperties; -import org.springframework.stereotype.Service; - -import javax.inject.Inject; - -@Service -public class ElasticSettingServiceImpl implements IElasticSettingService { - - @Inject - private javax.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; - - @Inject - private IElasticRepository elasticRepository; - - @Inject - private IElasticCredentialsCache<String, ClusterSettings> elasticCredentialCache; - - - @Inject - private JaxRsDpsLog log; - - @Inject - private SearchConfigurationProperties configurationProperties; - - @Override - public ClusterSettings getElasticClusterInformation() { - - TenantInfo tenantInfo = this.tenantInfoServiceProvider.get().getTenantInfo(); - String cacheKey = String.format("%s-%s", configurationProperties.getDeployedServiceId(), tenantInfo.getName()); - - ClusterSettings clusterInfo = this.elasticCredentialCache.get(cacheKey); - if (clusterInfo != null) { - return clusterInfo; - } - log.warning(String.format("elastic-credential cache missed for tenant: %s", tenantInfo.getName())); - - clusterInfo = this.elasticRepository.getElasticClusterSettings(tenantInfo); - - if (clusterInfo == null) { - throw new AppException(HttpStatus.SC_NOT_FOUND, "Tenant not found", "No information about the given tenant was found"); - } - - this.elasticCredentialCache.put(cacheKey, clusterInfo); - return clusterInfo; - } -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/TenantFactoryImpl.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/TenantFactoryImpl.java deleted file mode 100644 index 03a7a6b2d..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/service/TenantFactoryImpl.java +++ /dev/null @@ -1,63 +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.search.provider.byoc.service; - -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.Collection; -import java.util.HashMap; -import java.util.Map; - -@Component -public class TenantFactoryImpl implements ITenantFactory { - public static final String[] REGISTERED_TENANTS = new String[] {"tenant1","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/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ByocElasticSearchServer.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ByocElasticSearchServer.java deleted file mode 100644 index e64a68960..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ByocElasticSearchServer.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.opengroup.osdu.search.provider.byoc.utils; - -import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; -import org.opengroup.osdu.search.provider.byoc.provider.persistence.ByocDatastoreFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.ApplicationListener; -import org.springframework.core.io.ClassPathResource; -import org.springframework.stereotype.Component; -import pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic; -import pl.allegro.tech.embeddedelasticsearch.IndexSettings; -import pl.allegro.tech.embeddedelasticsearch.PopularProperties; - -import javax.inject.Inject; - -import java.util.concurrent.TimeUnit; - -@Component -public class ByocElasticSearchServer implements ApplicationListener<ApplicationReadyEvent> { - - @Value("${ELASTIC_SEARCH_VERSION}") - private String elasticSearchVersion; - - @Value("${ELASTIC_SEARCH_PORT}") - private int elasticSearchPort; - - @Value("${ELASTIC_SEARCH_CLUSTER_NAME}") - private String clusterName; - - @Value("${ELASTIC_SEARCH_BYOC_INDEX}") - private String byocIndex; - - @Inject - private JaxRsDpsLog log; - - private EmbeddedElastic embeddedElastic = null; - - @Override - public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { - - try{ - embeddedElastic = EmbeddedElastic.builder() - .withElasticVersion(elasticSearchVersion) - .withSetting(PopularProperties.TRANSPORT_TCP_PORT, elasticSearchPort) - .withSetting(PopularProperties.CLUSTER_NAME, clusterName) - .withStartTimeout(60, TimeUnit.SECONDS) -// .withPlugin("analysis-stempel") - .withIndex(byocIndex, IndexSettings.builder() - .withType("welldb", new ClassPathResource( - "tenant-mappings.json").getInputStream()) - .build()) - .build() - .start(); - ByocDatastoreFactory.DATASTORE_CLIENTS.put("byoc", embeddedElastic); - log.info(String.format("Embedded elastic search started on port : %s ", elasticSearchPort)); - - }catch (Exception e){ - e.printStackTrace(); - log.error(String.format("Error starting embedded elastic search server %s", e), e); - } - - } - -} diff --git a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ConfigModule.java b/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ConfigModule.java deleted file mode 100644 index 36ff003b6..000000000 --- a/provider/search-byoc/src/main/java/org/opengroup/osdu/search/provider/byoc/utils/ConfigModule.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opengroup.osdu.search.provider.byoc.utils; - -import org.jboss.resteasy.specimpl.ResteasyHttpHeaders; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import javax.ws.rs.core.MultivaluedHashMap; - -@Configuration -public class ConfigModule { - - @Bean - ResteasyHttpHeaders resteasyHttpHeaders() { - return new ResteasyHttpHeaders(new MultivaluedHashMap<>()); - } - -} diff --git a/provider/search-byoc/src/main/resources/application.properties b/provider/search-byoc/src/main/resources/application.properties deleted file mode 100644 index 1eae6a256..000000000 --- a/provider/search-byoc/src/main/resources/application.properties +++ /dev/null @@ -1,26 +0,0 @@ -LOG_PREFIX=search - -server.servlet.contextPath=/api/search/v2/ -logging.level.org.springframework.web=DEBUG -server.port=8080 -JAVA_HEAP_OPTS=-Xms4096M -Xmx4096M -JAVA_GC_OPTS=-XX:+UseG1GC -XX:+UseStringDeduplication -XX:InitiatingHeapOccupancyPercent=45 - -spring.security.user.name=opendes@byoc.local -spring.security.user.password=123 -spring.security.user.roles=service.search.admin,data.search.admin - -AUTHORIZE_API=notused -LEGALTAG_API=notused - -ELASTIC_SEARCH_VERSION=6.8.0 -ELASTIC_SEARCH_PORT=9350 -ELASTIC_SEARCH_CLUSTER_NAME=byoc-cluster -ELASTIC_SEARCH_BYOC_INDEX=tenant1:welldb:well:1.0.2 -ELASTIC_CACHE_EXPIRATION=1440 -CURSOR_CACHE_EXPIRATION=60 -MAX_CACHE_VALUE_SIZE=1000 - -QUERY_DEFAULT_LIMIT=10 -QUERY_LIMIT_MAXIMUM=1000 -AGGREGATION_SIZE=1000 \ No newline at end of file diff --git a/provider/search-byoc/src/main/resources/tenant-mappings.json b/provider/search-byoc/src/main/resources/tenant-mappings.json deleted file mode 100644 index 8ebd39418..000000000 --- a/provider/search-byoc/src/main/resources/tenant-mappings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "welldb": { - "properties": { - - } - } -} \ No newline at end of file diff --git a/provider/search-gc/pom.xml b/provider/search-gc/pom.xml index cdbab3b5b..dad373a71 100644 --- a/provider/search-gc/pom.xml +++ b/provider/search-gc/pom.xml @@ -36,7 +36,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <failOnMissingWebXml>false</failOnMissingWebXml> <project.main.basedir>${project.parent.basedir}</project.main.basedir> - <spring-webmvc.version>5.3.22</spring-webmvc.version> + <spring-webmvc.version>6.3.0</spring-webmvc.version> </properties> <dependencyManagement> @@ -50,17 +50,12 @@ <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> - <version>2.6.6</version> + <version>${spring-boot.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> - <artifactId>spring-security-web</artifactId> - <version>5.7.11</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core</artifactId> - <version>5.7.11</version> + <artifactId>spring-security-bom</artifactId> + <version>6.3.0</version> </dependency> </dependencies> </dependencyManagement> @@ -68,8 +63,8 @@ <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-gc</artifactId> - <version>0.26.0</version> + <artifactId>core-lib-gc-spring6</artifactId> + <version>0.27.0-rc3</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> @@ -84,7 +79,7 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${osdu.oscorecommon.version}</version> <exclusions> <exclusion> @@ -106,6 +101,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-inline</artifactId> + <version>5.2.0</version> <scope>test</scope> </dependency> <!--Elasticsearch--> @@ -122,10 +118,10 @@ <artifactId>elasticsearch-rest-high-level-client</artifactId> </dependency> <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>javax.ws.rs-api</artifactId> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> <scope>test</scope> - <version>2.0.1</version> + <version>4.0.0</version> </dependency> <dependency> <groupId>ch.qos.logback.contrib</groupId> @@ -140,7 +136,6 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> - <version>${spring-webmvc.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -157,7 +152,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>${spring-boot.version}</version> <configuration> <classifier>spring-boot</classifier> <mainClass> diff --git a/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/security/GcpSecurityConfig.java b/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/security/GcpSecurityConfig.java index 8fa33f357..44afaddbd 100644 --- a/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/security/GcpSecurityConfig.java +++ b/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/security/GcpSecurityConfig.java @@ -17,19 +17,25 @@ package org.opengroup.osdu.search.provider.gcp.security; -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.Customizer; +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.web.SecurityFilterChain; +@Configuration @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class GcpSecurityConfig extends WebSecurityConfigurerAdapter { +@EnableMethodSecurity +public class GcpSecurityConfig { - @Override - protected void configure(HttpSecurity httpSecurity) throws Exception { - httpSecurity - .httpBasic().disable() - .csrf().disable(); //disable default authN. AuthN handled by endpoints proxy + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + return http + .csrf(AbstractHttpConfigurer::disable) + .httpBasic(Customizer.withDefaults()) + .build(); //disable default authN. AuthN handled by endpoints proxy } -} \ No newline at end of file +} diff --git a/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/service/ElasticSettingServiceImpl.java b/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/service/ElasticSettingServiceImpl.java index eb164b3bc..939734e15 100644 --- a/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/service/ElasticSettingServiceImpl.java +++ b/provider/search-gc/src/main/java/org/opengroup/osdu/search/provider/gcp/service/ElasticSettingServiceImpl.java @@ -38,7 +38,7 @@ import org.springframework.stereotype.Service; public class ElasticSettingServiceImpl implements IElasticSettingService { private final SearchConfigurationProperties searchConfigurationProperties; - private final javax.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; + private final jakarta.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; private final IElasticRepository elasticRepository; private final IElasticCredentialsCache<String, ClusterSettings> elasticCredentialCache; private final JaxRsDpsLog log; diff --git a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/middleware/RedirectHttpRequestsHandlerTest.java b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/middleware/RedirectHttpRequestsHandlerTest.java index 24fa00b8d..aa70c0327 100644 --- a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/middleware/RedirectHttpRequestsHandlerTest.java +++ b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/middleware/RedirectHttpRequestsHandlerTest.java @@ -18,10 +18,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.mockito.Mockito.when; -import javax.servlet.FilterChain; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.container.ContainerRequestContext; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.container.ContainerRequestContext; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AllFiltersTest.java b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AllFiltersTest.java index 61fd98c4f..d80d47131 100644 --- a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AllFiltersTest.java +++ b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AllFiltersTest.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.inject.Provider; +import jakarta.inject.Provider; import com.google.common.collect.Ordering; import org.junit.After; diff --git a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AttributeFilterTest.java b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AttributeFilterTest.java index 6cd66c5b3..f3f944409 100644 --- a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AttributeFilterTest.java +++ b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/AttributeFilterTest.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.inject.Provider; +import jakarta.inject.Provider; import org.junit.Before; import org.junit.Test; diff --git a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/SourceFilterTest.java b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/SourceFilterTest.java index 9de8a1f55..79358d719 100644 --- a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/SourceFilterTest.java +++ b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/SourceFilterTest.java @@ -38,7 +38,7 @@ public class SourceFilterTest { @Mock private Kinds kindRetriever; @Mock - javax.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; + jakarta.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; @InjectMocks private SourceFilter sut; diff --git a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/TypeFilterTest.java b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/TypeFilterTest.java index 6a174a077..2d2833b96 100644 --- a/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/TypeFilterTest.java +++ b/provider/search-gc/src/test/java/org/opengroup/osdu/search/provider/gcp/smart/filters/TypeFilterTest.java @@ -37,7 +37,7 @@ import static org.mockito.Mockito.when; public class TypeFilterTest { @Mock - javax.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; + jakarta.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; @Mock private Kinds kindRetriever; diff --git a/provider/search-ibm/pom.xml b/provider/search-ibm/pom.xml index 8e644727b..c42435e1b 100644 --- a/provider/search-ibm/pom.xml +++ b/provider/search-ibm/pom.xml @@ -24,7 +24,7 @@ <properties> <tomcat.embed.core.version>9.0.69</tomcat.embed.core.version> - <os-core-lib-ibm.version>0.25.1</os-core-lib-ibm.version> + <os-core-lib-ibm.version>0.27.0-rc2</os-core-lib-ibm.version> <start-class>org.opengroup.osdu.search.provider.ibm.app.SearchIBMApplication</start-class> <spring-webmvc.version>5.3.22</spring-webmvc.version> <jackson-databind.version>2.15.2</jackson-databind.version> @@ -42,8 +42,8 @@ <artifactId>nimbus-jose-jwt</artifactId> </exclusion> <exclusion> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> </exclusion> <exclusion> <groupId>org.apache.tomcat.embed</groupId> @@ -83,7 +83,7 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${osdu.oscorecommon.version}</version> <exclusions> <exclusion> @@ -245,7 +245,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>${spring-boot.version}</version> <executions> <execution> <goals> @@ -263,7 +263,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.5</version> + <version>3.3.0</version> <configuration> <useSystemClassLoader>false</useSystemClassLoader> <threadCount>1</threadCount> diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/di/EntitlementsFactoryIbm.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/di/EntitlementsFactoryIbm.java index 43b209127..e07bd4930 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/di/EntitlementsFactoryIbm.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/di/EntitlementsFactoryIbm.java @@ -3,7 +3,7 @@ package org.opengroup.osdu.search.provider.ibm.di; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig; import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory; import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/model/ElasticSettingSchema.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/model/ElasticSettingSchema.java index a804956c7..82076a567 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/model/ElasticSettingSchema.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/model/ElasticSettingSchema.java @@ -3,7 +3,7 @@ package org.opengroup.osdu.search.provider.ibm.model; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticRepositoryIBM.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticRepositoryIBM.java index c85e8cec8..da6c7d8b1 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticRepositoryIBM.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticRepositoryIBM.java @@ -3,7 +3,7 @@ package org.opengroup.osdu.search.provider.ibm.persistence; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.apache.http.HttpStatus; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticSettingSchemaRepositoryImpl.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticSettingSchemaRepositoryImpl.java index 621da38ab..c21e50a4f 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticSettingSchemaRepositoryImpl.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/persistence/ElasticSettingSchemaRepositoryImpl.java @@ -3,8 +3,8 @@ package org.opengroup.osdu.search.provider.ibm.persistence; -import javax.annotation.PostConstruct; -import javax.inject.Inject; +import jakarta.annotation.PostConstruct; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.ibm.auth.ServiceCredentials; diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/provider/impl/CrossTenantInfoServiceImpl.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/provider/impl/CrossTenantInfoServiceImpl.java index ea1d0d3e2..2091fe736 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/provider/impl/CrossTenantInfoServiceImpl.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/provider/impl/CrossTenantInfoServiceImpl.java @@ -15,7 +15,7 @@ import org.opengroup.osdu.core.common.model.tenant.TenantInfo; import org.opengroup.osdu.search.provider.interfaces.ICrossTenantInfoService; import org.springframework.stereotype.Service; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.LinkedList; import java.util.List; diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/security/SecurityConfig.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/security/SecurityConfig.java index 8afa5949e..6b00d9765 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/security/SecurityConfig.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/security/SecurityConfig.java @@ -4,31 +4,25 @@ package org.opengroup.osdu.search.provider.ibm.security; -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) -public class SecurityConfig extends WebSecurityConfigurerAdapter { - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .csrf().disable() - .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER); - // .and() - // .authorizeRequests() - // .antMatchers("/", "/index.html", - // "/v2/api-docs", - // "/health/**", - // "/configuration/ui", - // "/swagger-resources/**", - // "/configuration/security", - // "/swagger", - // "/swagger-ui.html", - // "/webjars/**").permitAll() - // .anyRequest().authenticated().and().oauth2ResourceServer().jwt(); +@EnableMethodSecurity +public class SecurityConfig { + + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + return http + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session-> session.sessionCreationPolicy(SessionCreationPolicy.NEVER)) + .build(); //AuthN is disabled. AuthN is handled by sidecar proxy } } diff --git a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/service/ElasticSettingServiceImpl.java b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/service/ElasticSettingServiceImpl.java index b82a6d739..e9eb7844f 100644 --- a/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/service/ElasticSettingServiceImpl.java +++ b/provider/search-ibm/src/main/java/org/opengroup/osdu/search/provider/ibm/service/ElasticSettingServiceImpl.java @@ -15,13 +15,13 @@ import org.opengroup.osdu.core.common.multitenancy.ITenantInfoService; import org.opengroup.osdu.search.config.SearchConfigurationProperties; import org.springframework.stereotype.Service; -import javax.inject.Inject; +import jakarta.inject.Inject; @Service public class ElasticSettingServiceImpl implements IElasticSettingService { @Inject - private javax.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; + private jakarta.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; @Inject private IElasticRepository elasticRepository; @@ -57,4 +57,4 @@ public class ElasticSettingServiceImpl implements IElasticSettingService { this.elasticCredentialCache.put(cacheKey, clusterInfo); return clusterInfo; } -} \ No newline at end of file +} diff --git a/search-core-plus/pom.xml b/search-core-plus/pom.xml index f8ed8556f..e12680c28 100644 --- a/search-core-plus/pom.xml +++ b/search-core-plus/pom.xml @@ -38,38 +38,24 @@ <failOnMissingWebXml>false</failOnMissingWebXml> <project.main.basedir>${project.parent.basedir}</project.main.basedir> <spring-webmvc.version>5.3.22</spring-webmvc.version> + <core-plus.version>0.26.0</core-plus.version> </properties> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <version>2.7.17</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-web</artifactId> - <version>5.8.10</version> - </dependency> - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core</artifactId> - <version>5.8.10</version> - </dependency> - </dependencies> - </dependencyManagement> - <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>core-plus-common-lib</artifactId> - <version>0.24.0-rc4</version> + <artifactId>os-core-common-spring6</artifactId> + <version>${osdu.oscorecommon.version}</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>apd-core</artifactId> - <version>0.26.0</version> + <artifactId>core-plus-common-lib</artifactId> + <version>${core-plus.version}</version> + <exclusions> + <exclusion> + <artifactId>os-core-common</artifactId> + <groupId>org.opengroup.osdu</groupId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> @@ -78,7 +64,7 @@ </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${osdu.oscorecommon.version}</version> </dependency> <dependency> @@ -94,18 +80,16 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-inline</artifactId> + <version>5.2.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-loader</artifactId> - <version>2.7.17</version> </dependency> <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>javax.ws.rs-api</artifactId> - <scope>test</scope> - <version>2.0.1</version> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> </dependency> <dependency> <groupId>ch.qos.logback.contrib</groupId> @@ -120,7 +104,6 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> - <version>${spring-webmvc.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -137,7 +120,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.7.4</version> + <version>${spring-boot.version}</version> <executions> <execution> <goals> @@ -146,7 +129,7 @@ <configuration> <classifier>spring-boot</classifier> <mainClass> - org.springframework.boot.loader.PropertiesLauncher + org.springframework.boot.loader.launch.PropertiesLauncher </mainClass> </configuration> </execution> diff --git a/search-core-plus/src/main/java/org/opengroup/osdu/search/security/CorePlusSecurityConfig.java b/search-core-plus/src/main/java/org/opengroup/osdu/search/security/CorePlusSecurityConfig.java index 50c550ca6..8b6cec0ab 100644 --- a/search-core-plus/src/main/java/org/opengroup/osdu/search/security/CorePlusSecurityConfig.java +++ b/search-core-plus/src/main/java/org/opengroup/osdu/search/security/CorePlusSecurityConfig.java @@ -17,19 +17,23 @@ package org.opengroup.osdu.search.security; -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.web.SecurityFilterChain; +@Configuration @EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class CorePlusSecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity httpSecurity) throws Exception { - httpSecurity - .httpBasic().disable() - .csrf().disable(); //disable default authN. AuthN handled by endpoints proxy +@EnableMethodSecurity +public class CorePlusSecurityConfig { + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + return http + .csrf(AbstractHttpConfigurer::disable) + .httpBasic(httpBasic->httpBasic.disable()) + .build(); } } diff --git a/search-core-plus/src/main/java/org/opengroup/osdu/search/service/ElasticSettingServiceImpl.java b/search-core-plus/src/main/java/org/opengroup/osdu/search/service/ElasticSettingServiceImpl.java index 208af3847..1ab6b92cf 100644 --- a/search-core-plus/src/main/java/org/opengroup/osdu/search/service/ElasticSettingServiceImpl.java +++ b/search-core-plus/src/main/java/org/opengroup/osdu/search/service/ElasticSettingServiceImpl.java @@ -38,7 +38,7 @@ import org.springframework.stereotype.Service; public class ElasticSettingServiceImpl implements IElasticSettingService { private final SearchConfigurationProperties searchConfigurationProperties; - private final javax.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; + private final jakarta.inject.Provider<ITenantInfoService> tenantInfoServiceProvider; private final IElasticRepository elasticRepository; private final IElasticCredentialsCache<String, ClusterSettings> elasticCredentialCache; private final JaxRsDpsLog log; diff --git a/search-core-plus/src/main/java/org/opengroup/osdu/search/utils/ConfigModule.java b/search-core-plus/src/main/java/org/opengroup/osdu/search/utils/ConfigModule.java index 240e4dc67..2bb16232e 100644 --- a/search-core-plus/src/main/java/org/opengroup/osdu/search/utils/ConfigModule.java +++ b/search-core-plus/src/main/java/org/opengroup/osdu/search/utils/ConfigModule.java @@ -27,6 +27,6 @@ public class ConfigModule { @Bean ResteasyHttpHeaders resteasyHttpHeaders() { - return new ResteasyHttpHeaders(new MultivaluedHashMap<>()); + return new ResteasyHttpHeaders(new MultivaluedHashMap<String, String>() ); } } diff --git a/search-core-plus/src/test/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandlerTest.java b/search-core-plus/src/test/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandlerTest.java index c9d1bafaa..c4971fdf9 100644 --- a/search-core-plus/src/test/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandlerTest.java +++ b/search-core-plus/src/test/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandlerTest.java @@ -21,10 +21,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.mockito.Mockito.when; -import javax.servlet.FilterChain; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.container.ContainerRequestContext; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.container.ContainerRequestContext; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; diff --git a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AllFiltersTest.java b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AllFiltersTest.java index 9ff36edc7..9bb9c60bb 100644 --- a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AllFiltersTest.java +++ b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AllFiltersTest.java @@ -35,7 +35,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import javax.inject.Provider; +import jakarta.inject.Provider; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AttributeFilterTest.java b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AttributeFilterTest.java index f0f9a79e2..fa103b5d4 100644 --- a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AttributeFilterTest.java +++ b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/AttributeFilterTest.java @@ -27,7 +27,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import javax.inject.Provider; +import jakarta.inject.Provider; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/SourceFilterTest.java b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/SourceFilterTest.java index e74f589fe..1d7f12ae5 100644 --- a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/SourceFilterTest.java +++ b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/SourceFilterTest.java @@ -41,7 +41,7 @@ import org.opengroup.osdu.search.smart.models.Kinds; public class SourceFilterTest { @Mock - javax.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; + jakarta.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; @Mock private Kinds kindRetriever; @InjectMocks diff --git a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/TypeFilterTest.java b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/TypeFilterTest.java index ada25f456..ac2ea83cc 100644 --- a/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/TypeFilterTest.java +++ b/search-core-plus/src/test/java/org/opengroup/osdu/search/smart/filters/TypeFilterTest.java @@ -41,7 +41,7 @@ import org.opengroup.osdu.search.smart.models.Kinds; public class TypeFilterTest { @Mock - javax.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; + jakarta.inject.Provider<ICrossTenantInfoService> tenantInfoServiceProvide; @Mock private Kinds kindRetriever; diff --git a/search-core/pom.xml b/search-core/pom.xml index 7d63c5a32..62c8aa94d 100644 --- a/search-core/pom.xml +++ b/search-core/pom.xml @@ -36,9 +36,9 @@ <project.main.basedir>${project.basedir}</project.main.basedir> <nimbus-jose-jwt.version>9.1.2</nimbus-jose-jwt.version> <elasticsearch.version>7.8.1</elasticsearch.version> - <netty.version>4.1.70.Final</netty.version> - <spring-security-web.version>5.8.2</spring-security-web.version> - <spring-webmvc.version>5.3.26</spring-webmvc.version> + <netty.version>4.1.109.Final</netty.version> + <spring-security-web.version>6.3.0</spring-security-web.version> + <spring-webmvc.version>6.1.6</spring-webmvc.version> <jts-io-common.version>1.15.0</jts-io-common.version> </properties> @@ -68,7 +68,7 @@ <dependencies> <dependency> <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> + <artifactId>os-core-common-spring6</artifactId> <version>${osdu.oscorecommon.version}</version> </dependency> <dependency> @@ -77,19 +77,16 @@ <version>${jts-io-common.version}</version> </dependency> <dependency> - <groupId>javax.el</groupId> - <artifactId>javax.el-api</artifactId> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> </dependency> <dependency> - <groupId>org.glassfish</groupId> - <artifactId>javax.el</artifactId> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> + <version>4.0.0</version> </dependency> <dependency> - <groupId>org.glassfish</groupId> - <artifactId>javax.json</artifactId> - </dependency> - <dependency> - <groupId>com.sun.jersey</groupId> + <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> </dependency> <dependency> @@ -97,7 +94,7 @@ <artifactId>swagger-jaxrs</artifactId> <exclusions> <exclusion> - <groupId>javax.ws.rs</groupId> + <groupId>jakarta.ws.rs</groupId> <artifactId>jsr311-api</artifactId> </exclusion> <exclusion> @@ -131,12 +128,6 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-web</artifactId> - </exclusion> - </exclusions> </dependency> <dependency> <groupId>org.springframework.security</groupId> @@ -148,10 +139,6 @@ <artifactId>spring-webmvc</artifactId> <version>${spring-webmvc.version}</version> </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jackson2-provider</artifactId> @@ -161,21 +148,16 @@ <artifactId>resteasy-jaxrs</artifactId> <exclusions> <exclusion> - <groupId>javax.validation</groupId> + <groupId>jakarta.validation</groupId> <artifactId>validation-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - <version>2.0.1.Final</version> - </dependency> - <dependency> - <groupId>org.jboss.resteasy</groupId> - <artifactId>resteasy-validator-provider-11</artifactId> + <groupId>jakarta.validation</groupId> + <artifactId>jakarta.validation-api</artifactId> + <version>3.1.0</version> </dependency> - <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> @@ -224,21 +206,6 @@ <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> </dependency> - - <!--Logging--> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - </dependency> - <!--Elasticsearch--> <dependency> <groupId>org.elasticsearch</groupId> @@ -261,8 +228,6 @@ <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>${elasticsearch.version}</version> </dependency> - - <!--Test--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> @@ -271,15 +236,33 @@ <dependency> <groupId>com.github.stefanbirkner</groupId> <artifactId>system-rules</artifactId> + <version>1.19.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> + <version>${spring-boot.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jersey</artifactId> + <version>${spring-boot.version}</version> + </dependency> + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>4.0.2</version> + </dependency> + <dependency> + <groupId>jakarta.annotation</groupId> + <artifactId>jakarta.annotation-api</artifactId> + <version>3.0.0</version> + </dependency> + <dependency> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + <version>2.0.1</version> </dependency> </dependencies> diff --git a/search-core/src/main/java/org/opengroup/osdu/search/api/HealthCheckApi.java b/search-core/src/main/java/org/opengroup/osdu/search/api/HealthCheckApi.java index 51eb86782..98251657f 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/api/HealthCheckApi.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/api/HealthCheckApi.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.annotation.security.PermitAll; +import jakarta.annotation.security.PermitAll; @RestController @RequestMapping("/") diff --git a/search-core/src/main/java/org/opengroup/osdu/search/api/SearchApi.java b/search-core/src/main/java/org/opengroup/osdu/search/api/SearchApi.java index 41d2070bd..4d1148b44 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/api/SearchApi.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/api/SearchApi.java @@ -41,10 +41,10 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.annotation.RequestScope; -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; @RestController diff --git a/search-core/src/main/java/org/opengroup/osdu/search/logging/AuditLogger.java b/search-core/src/main/java/org/opengroup/osdu/search/logging/AuditLogger.java index 49c8c4ee3..aea04c7ef 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/logging/AuditLogger.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/logging/AuditLogger.java @@ -19,7 +19,7 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.logging.audit.AuditPayload; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.util.List; @Component @@ -71,4 +71,4 @@ public class AuditLogger { private void writeLog(AuditPayload log) { this.logger.audit(log); } -} \ No newline at end of file +} diff --git a/search-core/src/main/java/org/opengroup/osdu/search/middleware/AuthorizationFilter.java b/search-core/src/main/java/org/opengroup/osdu/search/middleware/AuthorizationFilter.java index 4f8695bea..5cd93bd4d 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/middleware/AuthorizationFilter.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/middleware/AuthorizationFilter.java @@ -14,9 +14,9 @@ import org.opengroup.osdu.search.provider.interfaces.IProviderHeaderService; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import javax.inject.Inject; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilter.java b/search-core/src/main/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilter.java index 1e90bc6ae..cadf2520b 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilter.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilter.java @@ -23,10 +23,10 @@ import org.opengroup.osdu.core.common.model.http.Request; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import javax.inject.Inject; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.inject.Inject; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.time.Duration; import java.util.Map; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapper.java b/search-core/src/main/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapper.java index cf04fe8fb..2e11277a9 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapper.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapper.java @@ -30,6 +30,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.http.converter.HttpMessageNotReadableException; import org.springframework.security.access.AccessDeniedException; @@ -42,7 +43,7 @@ import org.springframework.web.context.annotation.RequestScope; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; -import javax.validation.ValidationException; +import jakarta.validation.ValidationException; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -69,7 +70,7 @@ public class GlobalExceptionMapper extends ResponseEntityExceptionHandler { // ResponseEntityExceptionHandler already has a default implementation for handling MethodArgumentNotValidException, so we are overriding it @Override - protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException e, HttpHeaders headers, HttpStatus status, WebRequest request) { + protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException e, HttpHeaders headers, HttpStatusCode statusCode, WebRequest request) { List<String> errors = new ArrayList<>(); for (FieldError fieldError : e.getBindingResult().getFieldErrors()) { errors.add(fieldError.getDefaultMessage()); @@ -82,7 +83,7 @@ public class GlobalExceptionMapper extends ResponseEntityExceptionHandler { // Yes, if we are extending ResponseEntityExceptionHandler, this is being caught as HttpMessageNotReadableException type, and not as UnrecognizedPropertyException type // ResponseEntityExceptionHandler already has a default implementation for handling HttpMessageNotReadableException, so we are overriding it @Override - protected ResponseEntity<Object> handleHttpMessageNotReadable(HttpMessageNotReadableException e, HttpHeaders headers, HttpStatus status, WebRequest request) { + protected ResponseEntity<Object> handleHttpMessageNotReadable(HttpMessageNotReadableException e, HttpHeaders headers, HttpStatusCode statusCode, WebRequest request) { AppException appException = new AppException(HttpStatus.BAD_REQUEST.value(), "Bad Request", "Invalid parameters were given on search request", e); this.jaxRsDpsLogger.warning(appException.getError().getMessage(), appException); HttpStatus httpStatus = HttpStatus.resolve(appException.getError().getCode()); diff --git a/search-core/src/main/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandler.java b/search-core/src/main/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandler.java index b664de4c4..c3baa8c37 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandler.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/middleware/RedirectHttpRequestsHandler.java @@ -16,9 +16,9 @@ package org.opengroup.osdu.search.middleware; import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; +import jakarta.inject.Inject; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.search.provider.interfaces.IProviderHeaderService; @@ -59,4 +59,4 @@ public class RedirectHttpRequestsHandler implements Filter { throw new AppException(302, "Redirect", "HTTP is not supported. Use HTTPS."); } } -} \ No newline at end of file +} diff --git a/search-core/src/main/java/org/opengroup/osdu/search/model/InnerQueryNode.java b/search-core/src/main/java/org/opengroup/osdu/search/model/InnerQueryNode.java index b652c04f4..3e5c166bb 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/model/InnerQueryNode.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/model/InnerQueryNode.java @@ -1,6 +1,6 @@ package org.opengroup.osdu.search.model; -import io.micrometer.core.lang.Nullable; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/model/NestedQueryNode.java b/search-core/src/main/java/org/opengroup/osdu/search/model/NestedQueryNode.java index 9b86037de..ba3f583b0 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/model/NestedQueryNode.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/model/NestedQueryNode.java @@ -5,7 +5,7 @@ import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import java.util.List; import java.util.Objects; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import org.apache.commons.lang3.StringUtils; import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.index.query.BoolQueryBuilder; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/model/QueryNode.java b/search-core/src/main/java/org/opengroup/osdu/search/model/QueryNode.java index 16520a18b..21c650213 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/model/QueryNode.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/model/QueryNode.java @@ -2,7 +2,7 @@ package org.opengroup.osdu.search.model; import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.StringUtils; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/model/SmartParsedQuery.java b/search-core/src/main/java/org/opengroup/osdu/search/model/SmartParsedQuery.java index b7c5380ae..c0c809d99 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/model/SmartParsedQuery.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/model/SmartParsedQuery.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; import org.opengroup.osdu.core.common.model.search.validation.ValidMultiKind; import org.springframework.validation.annotation.Validated; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/policy/cache/PolicyCache.java b/search-core/src/main/java/org/opengroup/osdu/search/policy/cache/PolicyCache.java index ba3d886f4..e36d49787 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/policy/cache/PolicyCache.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/policy/cache/PolicyCache.java @@ -17,7 +17,7 @@ package org.opengroup.osdu.search.policy.cache; import org.opengroup.osdu.core.common.cache.VmCache; import org.opengroup.osdu.core.common.model.policy.PolicyStatus; import org.springframework.stereotype.Component; -import javax.inject.Named; +import jakarta.inject.Named; @Component("policyCache") public class PolicyCache extends VmCache<String, PolicyStatus> { diff --git a/search-core/src/main/java/org/opengroup/osdu/search/policy/di/PolicyCacheConfiguration.java b/search-core/src/main/java/org/opengroup/osdu/search/policy/di/PolicyCacheConfiguration.java index 77382659d..5c8bc57e1 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/policy/di/PolicyCacheConfiguration.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/policy/di/PolicyCacheConfiguration.java @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; -import javax.inject.Named; +import jakarta.inject.Named; @Configuration @ConfigurationProperties(prefix = "policy.cache") diff --git a/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryBase.java b/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryBase.java index ae2febacc..edc249ac5 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryBase.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryBase.java @@ -26,8 +26,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletResponse; import org.apache.http.ContentTooLongException; import org.apache.http.HttpStatus; import org.elasticsearch.ElasticsearchStatusException; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImpl.java b/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImpl.java index d063c7ee3..00132fa81 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImpl.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImpl.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import java.io.IOException; import java.util.List; import java.util.Map; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.RestHighLevelClient; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/ScrollCoreQueryServiceImpl.java b/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/ScrollCoreQueryServiceImpl.java index 94bf7de0f..564a4f16c 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/ScrollCoreQueryServiceImpl.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/provider/impl/ScrollCoreQueryServiceImpl.java @@ -23,9 +23,9 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.List; import java.util.Map; -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.DatatypeConverter; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.xml.bind.DatatypeConverter; import org.apache.http.ContentTooLongException; import org.apache.http.HttpStatus; import org.elasticsearch.ElasticsearchStatusException; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java b/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java index f1e9d18e5..59ed57337 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java @@ -29,7 +29,7 @@ import org.opengroup.osdu.search.cache.MultiPartitionIndexAliasCache; import org.opengroup.osdu.search.util.ElasticClientHandler; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/attributes/AttributeMappingReader.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/attributes/AttributeMappingReader.java index 198407389..029e3c93b 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/attributes/AttributeMappingReader.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/attributes/AttributeMappingReader.java @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Scanner; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; @Log public class AttributeMappingReader implements AttributesRepository { diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AllFilters.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AllFilters.java index 823138abc..f641f35e0 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AllFilters.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AllFilters.java @@ -18,8 +18,8 @@ import java.io.IOException; import java.util.*; -import javax.inject.Inject; -import javax.inject.Provider; +import jakarta.inject.Inject; +import jakarta.inject.Provider; import org.opengroup.osdu.search.provider.interfaces.ICrossTenantInfoService; import org.opengroup.osdu.search.smart.attributes.AttributeLoader; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AttributeFilter.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AttributeFilter.java index b68c48076..c3c606bde 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AttributeFilter.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/AttributeFilter.java @@ -21,8 +21,8 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.inject.Provider; +import jakarta.inject.Inject; +import jakarta.inject.Provider; import org.opengroup.osdu.search.provider.interfaces.ICrossTenantInfoService; import org.opengroup.osdu.search.smart.models.Attribute; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/SourceFilter.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/SourceFilter.java index 38a3c3ee7..6711cc9ba 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/SourceFilter.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/SourceFilter.java @@ -25,8 +25,8 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.inject.Provider; +import jakarta.inject.Inject; +import jakarta.inject.Provider; public class SourceFilter implements IFilter { diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/TypeFilter.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/TypeFilter.java index 998d0ba93..4f7d4dee8 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/TypeFilter.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/filters/TypeFilter.java @@ -19,8 +19,8 @@ import org.opengroup.osdu.search.smart.models.Kinds; import org.opengroup.osdu.core.common.model.tenant.TenantInfo; -import javax.inject.Inject; -import javax.inject.Provider; +import jakarta.inject.Inject; +import jakarta.inject.Provider; import java.io.IOException; import java.util.HashMap; import java.util.List; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/middleware/SyncFilterValuesServiceImpl.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/middleware/SyncFilterValuesServiceImpl.java index a6671d11e..3b9fe4c4f 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/middleware/SyncFilterValuesServiceImpl.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/middleware/SyncFilterValuesServiceImpl.java @@ -21,8 +21,8 @@ import org.opengroup.osdu.search.smart.models.Kinds; import java.io.IOException; import java.net.URISyntaxException; -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletResponse; public class SyncFilterValuesServiceImpl implements SyncFilterValuesService { diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/AttributeCollection.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/AttributeCollection.java index d2740d87a..4c536e1d0 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/AttributeCollection.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/AttributeCollection.java @@ -23,8 +23,8 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletResponse; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.RequestOptions; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Filter.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Filter.java index 6bd0223e8..7931c4eaf 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Filter.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Filter.java @@ -15,10 +15,10 @@ package org.opengroup.osdu.search.smart.models; import lombok.Data; -import org.hibernate.validator.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Pattern; +import jakarta.validation.constraints.Size; @Data public class Filter diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/FilterCollection.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/FilterCollection.java index 256716aff..a0dca9e36 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/FilterCollection.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/FilterCollection.java @@ -16,7 +16,7 @@ package org.opengroup.osdu.search.smart.models; import lombok.Data; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Size; import java.util.ArrayList; import java.util.List; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Kinds.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Kinds.java index 32fc159d0..e2f71da0e 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Kinds.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/models/Kinds.java @@ -40,7 +40,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.inject.Inject; +import jakarta.inject.Inject; @Scope("request") public class Kinds { diff --git a/search-core/src/main/java/org/opengroup/osdu/search/smart/parser/ParseToQuery.java b/search-core/src/main/java/org/opengroup/osdu/search/smart/parser/ParseToQuery.java index 88a2d68c6..05f034030 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/smart/parser/ParseToQuery.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/smart/parser/ParseToQuery.java @@ -19,7 +19,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.inject.Inject; +import jakarta.inject.Inject; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.search.QueryRequest; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java b/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java index 6ce458505..9d937ecce 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java @@ -21,7 +21,8 @@ import org.opengroup.osdu.core.common.util.KindParser; import org.opengroup.osdu.search.service.IndexAliasService; import org.springframework.stereotype.Component; -import javax.inject.Inject; +import jakarta.inject.Inject; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/DetailedBadRequestMessageUtil.java b/search-core/src/main/java/org/opengroup/osdu/search/util/DetailedBadRequestMessageUtil.java index 9bf0a45c6..d044bb099 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/DetailedBadRequestMessageUtil.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/DetailedBadRequestMessageUtil.java @@ -51,7 +51,7 @@ public class DetailedBadRequestMessageUtil implements IDetailedBadRequestMessage try { InputStream content = entity.getContent(); JsonNode errorNode = objectMapper.readValue(content, JsonNode.class); - JsonNode reasonNode = errorNode.findValue("reason"); + JsonNode reasonNode = errorNode.findValue("root_cause").findValue("reason"); String reasonMessage = reasonNode.textValue(); if (StringUtils.isNotEmpty(reasonMessage)) { stringJoiner.add(reasonMessage); diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/ElasticClientHandler.java b/search-core/src/main/java/org/opengroup/osdu/search/util/ElasticClientHandler.java index 734429e1b..b3fe1a00a 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/ElasticClientHandler.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/ElasticClientHandler.java @@ -158,4 +158,4 @@ public class ElasticClientHandler { public void setSecurityHttpsCertificateTrust(Boolean securityHttpsCertificateTrust) { this.securityHttpsCertificateTrust = securityHttpsCertificateTrust; } -} \ No newline at end of file +} diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/GeoQueryBuilder.java b/search-core/src/main/java/org/opengroup/osdu/search/util/GeoQueryBuilder.java index 27ceba85d..7b2796c13 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/GeoQueryBuilder.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/GeoQueryBuilder.java @@ -20,7 +20,7 @@ import static org.elasticsearch.index.query.QueryBuilders.geoWithinQuery; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.elasticsearch.common.geo.builders.CircleBuilder; import org.elasticsearch.common.geo.builders.CoordinatesBuilder; import org.elasticsearch.common.geo.builders.EnvelopeBuilder; diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/SuggestionsQueryUtil.java b/search-core/src/main/java/org/opengroup/osdu/search/util/SuggestionsQueryUtil.java index 9fa3f1937..a2dbb78e9 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/SuggestionsQueryUtil.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/SuggestionsQueryUtil.java @@ -16,7 +16,7 @@ import static org.opengroup.osdu.search.config.SearchConfigurationProperties.AUT import java.util.ArrayList; import java.util.List; -import javax.inject.Inject; +import jakarta.inject.Inject; @Component public class SuggestionsQueryUtil { diff --git a/search-core/src/main/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidator.java b/search-core/src/main/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidator.java index f1a919818..13a03c9fa 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidator.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidator.java @@ -18,13 +18,13 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Set; -import javax.validation.Configuration; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorFactory; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; +import jakarta.validation.Configuration; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorFactory; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; import org.hibernate.validator.internal.util.privilegedactions.NewInstance; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/api/SearchApiTest.java b/search-core/src/test/java/org/opengroup/osdu/search/api/SearchApiTest.java index 1df0930ae..aed6334bb 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/api/SearchApiTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/api/SearchApiTest.java @@ -29,7 +29,7 @@ import org.opengroup.osdu.search.provider.interfaces.IScrollQueryService; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.http.ResponseEntity; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/middleware/AuthorizationRequestFilterTest.java b/search-core/src/test/java/org/opengroup/osdu/search/middleware/AuthorizationRequestFilterTest.java index 6663c96f2..02e6223a9 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/middleware/AuthorizationRequestFilterTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/middleware/AuthorizationRequestFilterTest.java @@ -26,12 +26,12 @@ import static org.opengroup.osdu.search.middleware.RequestHeadersTestUtil.setupR import java.lang.reflect.Method; import java.util.HashMap; -import javax.annotation.security.RolesAllowed; -import javax.servlet.FilterChain; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ResourceInfo; +import jakarta.annotation.security.RolesAllowed; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ResourceInfo; import org.junit.Before; import org.junit.Test; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilterTest.java b/search-core/src/test/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilterTest.java index a40c9a92a..c6f2b6b1e 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilterTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/middleware/CorrelationIDRequestFilterTest.java @@ -22,11 +22,11 @@ import static org.opengroup.osdu.search.middleware.RequestHeadersTestUtil.setupR import java.util.HashMap; -import javax.servlet.FilterChain; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ResourceInfo; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ResourceInfo; import org.junit.Before; import org.junit.Test; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapperTest.java b/search-core/src/test/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapperTest.java index 87116bc42..025138604 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapperTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/middleware/GlobalExceptionMapperTest.java @@ -30,7 +30,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.security.access.AccessDeniedException; -import javax.validation.ValidationException; +import jakarta.validation.ValidationException; import java.io.IOException; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/middleware/RequestHeadersTestUtil.java b/search-core/src/test/java/org/opengroup/osdu/search/middleware/RequestHeadersTestUtil.java index 754847590..b19557b05 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/middleware/RequestHeadersTestUtil.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/middleware/RequestHeadersTestUtil.java @@ -9,7 +9,7 @@ import java.util.Enumeration; import java.util.Iterator; import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; public class RequestHeadersTestUtil { public static void setupRequestHeaderMock(Map<String, String> headers, HttpServletRequest request) { diff --git a/search-core/src/test/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImplTest.java b/search-core/src/test/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImplTest.java index d575ed1ca..5c465cd4c 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImplTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/provider/impl/CoreQueryServiceImplTest.java @@ -101,6 +101,7 @@ import org.opengroup.osdu.search.util.QueryParserUtil; import org.opengroup.osdu.search.util.SortParserUtil; import org.opengroup.osdu.search.util.SuggestionsQueryUtil; import org.opengroup.osdu.core.common.feature.IFeatureFlag; +import org.springframework.test.util.ReflectionTestUtils; @RunWith(MockitoJUnitRunner.class) public class CoreQueryServiceImplTest { @@ -217,6 +218,8 @@ public class CoreQueryServiceImplTest { when(providerHeaderService.getDataGroupsHeader()).thenReturn(DATA_GROUPS); when(dpsHeaders.getHeaders()).thenReturn(HEADERS); + + ReflectionTestUtils.setField(suggestionsQueryUtil, "autocompleteFeatureFlag", autocompleteFeatureFlag); } @Test diff --git a/search-core/src/test/java/org/opengroup/osdu/search/smart/models/AttributesTest.java b/search-core/src/test/java/org/opengroup/osdu/search/smart/models/AttributesTest.java index ef4b43529..812ba3ee0 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/smart/models/AttributesTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/smart/models/AttributesTest.java @@ -30,6 +30,7 @@ import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -52,6 +53,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; @@ -72,7 +74,7 @@ public class AttributesTest { @Mock private DpsHeaders dpsHeaders; @Mock - private IAttributesCache cache; + private IAttributesCache<String, Set<String>> cache; @Mock private HttpResponse response; @Mock diff --git a/search-core/src/test/java/org/opengroup/osdu/search/smart/models/FilterTest.java b/search-core/src/test/java/org/opengroup/osdu/search/smart/models/FilterTest.java index 59a8465db..db9e353f5 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/smart/models/FilterTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/smart/models/FilterTest.java @@ -16,9 +16,9 @@ package org.opengroup.osdu.search.smart.models; import org.junit.Test; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; import java.util.Set; import static junit.framework.TestCase.assertEquals; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/validation/OffsetValidatorTest.java b/search-core/src/test/java/org/opengroup/osdu/search/validation/OffsetValidatorTest.java index 353a9e9aa..548b9fceb 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/validation/OffsetValidatorTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/validation/OffsetValidatorTest.java @@ -25,7 +25,7 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnitRunner; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidatorTest.java b/search-core/src/test/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidatorTest.java index 31cd269ec..b72cb2bcf 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidatorTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/validation/QueryRequestConstraintValidatorTest.java @@ -20,7 +20,7 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; import static org.mockito.Mockito.mock; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import org.junit.Before; import org.junit.Test; diff --git a/search-core/src/test/java/org/opengroup/osdu/search/validation/SortOrderValidatorTest.java b/search-core/src/test/java/org/opengroup/osdu/search/validation/SortOrderValidatorTest.java index 18844306f..8b335eeb5 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/validation/SortOrderValidatorTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/validation/SortOrderValidatorTest.java @@ -25,7 +25,7 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import java.util.ArrayList; import java.util.List; diff --git a/testing/integration-tests/search-test-azure/pom.xml b/testing/integration-tests/search-test-azure/pom.xml index d561a5dc3..02153cbad 100644 --- a/testing/integration-tests/search-test-azure/pom.xml +++ b/testing/integration-tests/search-test-azure/pom.xml @@ -110,6 +110,12 @@ <artifactId>core-lib-azure</artifactId> <version>0.26.0</version> <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>log4j-slf4j-impl</artifactId> + <groupId>org.apache.logging.log4j</groupId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>io.netty</groupId> diff --git a/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature b/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature index 8e2628e71..a9f24d488 100644 --- a/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature +++ b/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature @@ -51,10 +51,10 @@ Feature: Search with different queries Then I should get in response <count> records with <returned_fields> Examples: - | tenant | kind | number | query | limit | offset | returned_fields | count | - | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 300 | "data.OriginalOperator:OFFICE4" | None | None | All | 1 | - | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 300 | None | 0 | None | NULL | 3 | - | "tenant1" | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | 300 | None | 0 | None | NULL | 3 | + | tenant | kind | number | query | limit | offset | returned_fields | count | + | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 250 | "data.OriginalOperator:OFFICE4" | None | None | All | 1 | + | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 250 | None | 0 | None | NULL | 3 | + | "tenant1" | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | 250 | None | 0 | None | NULL | 3 | Scenario Outline: Search data in a given a kind with invalid inputs diff --git a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/TestsBase.java b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/TestsBase.java index 1663015ac..31f798f02 100644 --- a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/TestsBase.java +++ b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/TestsBase.java @@ -4,7 +4,6 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import cucumber.api.DataTable; -import lombok.extern.slf4j.Slf4j; import org.opengroup.osdu.core.common.model.entitlements.Acl; import org.opengroup.osdu.core.common.model.legal.Legal; import org.opengroup.osdu.core.common.model.search.Point; @@ -18,6 +17,7 @@ import org.opengroup.osdu.util.HTTPClient; import com.sun.jersey.api.client.ClientResponse; import cucumber.api.Scenario; +import org.opengroup.osdu.util.SchemaServiceClient; import javax.ws.rs.HttpMethod; import javax.ws.rs.core.MediaType; @@ -25,13 +25,15 @@ import javax.ws.rs.core.MultivaluedMap; import java.io.IOException; import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.opengroup.osdu.util.Config.*; import static org.opengroup.osdu.util.Utility.beautifyJsonString; -@Slf4j + public abstract class TestsBase { protected HTTPClient httpClient; protected Scenario scenario; @@ -49,7 +51,7 @@ public abstract class TestsBase { protected static final String timeStamp = String.valueOf(System.currentTimeMillis()) ; private boolean dunit = false; - + private static final Logger LOGGER = Logger.getLogger(SchemaServiceClient.class.getName()); public TestsBase(HTTPClient httpClient) { this.httpClient = httpClient; headers = httpClient.getCommonHeader(); @@ -108,7 +110,7 @@ public abstract class TestsBase { protected String executeQuery(String api, String payLoad, Map<String, String> headers, String token) { ClientResponse clientResponse = httpClient.send(this.getHttpMethod(), api, payLoad, headers, token); logCorrelationIdWithFunctionName(clientResponse.getHeaders()); - log.info(String.format("Response status: %s, type: %s", clientResponse.getStatus(), clientResponse.getType().toString())); + LOGGER.log( Level.INFO, String.format("Response status: %s, type: %s", clientResponse.getStatus(), clientResponse.getType().toString())); assertEquals(MediaType.APPLICATION_JSON, clientResponse.getType().toString()); return clientResponse.getEntity(String.class); } @@ -126,14 +128,14 @@ public abstract class TestsBase { } private <T extends ResponseBase> T getResponse(ClientResponse clientResponse, Class<T> typeParameterClass) { - if (clientResponse.getType() == null || log == null){ + if (clientResponse.getType() == null || LOGGER == null){ int i = 0; } - log.info(String.format("Response status: %s", clientResponse.getStatus())); + LOGGER.log( Level.INFO, String.format("Response status: %s", clientResponse.getStatus())); if(clientResponse.getType() != null){ - log.info(String.format("Response type: %s", clientResponse.getType().toString())); + LOGGER.log( Level.INFO, String.format("Response type: %s", clientResponse.getType().toString())); }else { - log.info("Got response type: null"); + LOGGER.log( Level.INFO,"Got response type: null"); } assertTrue(clientResponse.getType().toString().contains(MediaType.APPLICATION_JSON)); String responseEntity = clientResponse.getEntity(String.class); @@ -141,7 +143,7 @@ public abstract class TestsBase { T response = new Gson().fromJson(responseEntity, typeParameterClass); response.setHeaders(clientResponse.getHeaders()); response.setResponseCode(clientResponse.getStatus()); - log.info(String.format("Response body: %s\nCorrelation id: %s\nResponse code: %s", beautifyJsonString(responseEntity), response.getHeaders().get("correlation-id"), response.getResponseCode())); + LOGGER.log( Level.INFO, String.format("Response body: %s\nCorrelation id: %s\nResponse code: %s", beautifyJsonString(responseEntity), response.getHeaders().get("correlation-id"), response.getResponseCode())); return response; } @@ -152,14 +154,14 @@ public abstract class TestsBase { protected ClientResponse executeRequest(String method, String api, Map<String, String> headers, String token) { ClientResponse clientResponse = httpClient.send(method, api, null, headers, token); if (clientResponse.getType() != null) { - log.info(String.format("Response status: %s, type: %s", clientResponse.getStatus(), clientResponse.getType().toString())); + LOGGER.log( Level.INFO, String.format("Response status: %s, type: %s", clientResponse.getStatus(), clientResponse.getType().toString())); } logCorrelationIdWithFunctionName(clientResponse.getHeaders()); return clientResponse; } private void logCorrelationIdWithFunctionName(MultivaluedMap<String, String> headers) { - log.info(String.format("Scenario Name: %s, Correlation-Id: %s", scenario.getId(), headers.get("correlation-id"))); + LOGGER.log( Level.INFO, String.format("Scenario Name: %s, Correlation-Id: %s", scenario.getId(), headers.get("correlation-id"))); } protected String getTenantMapping(String tenant) { @@ -200,10 +202,10 @@ public abstract class TestsBase { List<String> recordIds = schemaRecords.get(kind); for (String id : recordIds) { ClientResponse clientResponse = httpClient.send(HttpMethod.DELETE, getStorageBaseURL() + "records/" +id,payload,headers, httpClient.getAccessToken()); - log.info(String.format("Deleted record with id: %s\nHttpMethod: %s\nStorage base URL: %s\nRequest body: %s\nCorrelation id: %s\nStatus code: %s", id, HttpMethod.DELETE, getStorageBaseURL(), beautifyJsonString(payload), clientResponse.getHeaders().get("correlation-id"), clientResponse.getStatus())); + LOGGER.log( Level.INFO, String.format("Deleted record with id: %s\nHttpMethod: %s\nStorage base URL: %s\nRequest body: %s\nCorrelation id: %s\nStatus code: %s", id, HttpMethod.DELETE, getStorageBaseURL(), beautifyJsonString(payload), clientResponse.getHeaders().get("correlation-id"), clientResponse.getStatus())); } ClientResponse clientResponse = httpClient.send(HttpMethod.DELETE, getIndexerBaseURL() + "index?kind=" +kind,payload,headers, httpClient.getAccessToken()); - log.info(String.format("Deleted index with kind: %s\nHttpMethod: %s\nIndexer base URL: %s\nRequest body: %s\nCorrelation id: %s\nStatus code: %s", kind, HttpMethod.DELETE, getIndexerBaseURL(), beautifyJsonString(payload), clientResponse.getHeaders().get("correlation-id"), clientResponse.getStatus())); + LOGGER.log( Level.INFO, String.format("Deleted index with kind: %s\nHttpMethod: %s\nIndexer base URL: %s\nRequest body: %s\nCorrelation id: %s\nStatus code: %s", kind, HttpMethod.DELETE, getIndexerBaseURL(), beautifyJsonString(payload), clientResponse.getHeaders().get("correlation-id"), clientResponse.getStatus())); } } @@ -250,9 +252,9 @@ public abstract class TestsBase { } schemaRecords.put(actualKind,recordsForKind); String payLoad = new Gson().toJson(records); - log.info( "Start ingesting records= %s", payLoad); + LOGGER.log( Level.INFO, String.format("Start ingesting records= %s", payLoad)); ClientResponse clientResponse = httpClient.send(HttpMethod.PUT, getStorageBaseURL() + "records", payLoad, headers, httpClient.getAccessToken()); - log.info(String.format("Response body: %s\n Correlation id: %s\nStatus code: %s",beautifyJsonString(clientResponse.getEntity(String.class)) , clientResponse.getHeaders().get("correlation-id"), clientResponse.getStatus())); + LOGGER.log( Level.INFO, String.format("Response body: %s\n Correlation id: %s\nStatus code: %s",beautifyJsonString(clientResponse.getEntity(String.class)) , clientResponse.getHeaders().get("correlation-id"), clientResponse.getStatus())); assertEquals(201, clientResponse.getStatus()); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { diff --git a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/SchemaServiceClient.java b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/SchemaServiceClient.java index f73b266cf..5b0a2f078 100644 --- a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/SchemaServiceClient.java +++ b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/SchemaServiceClient.java @@ -54,7 +54,7 @@ public class SchemaServiceClient { public boolean exists(SchemaIdentity identity) { String uri = buildSchemaUri(identity.getId()); - LOGGER.log(Level.INFO, "Checking whether the schema exists having identity={0}", identity); + LOGGER.log(Level.INFO, "Checking whether the schema exists with url={0}", uri); ResponseEntity<?> response = template.exchange(uri, HttpMethod.GET, null, Object.class); LOGGER.log(Level.INFO, "Finished checking whether the schema exists having identity={0}, response={1}", new Object[]{identity, response}); return response.getStatusCode() == HttpStatus.OK; @@ -66,8 +66,8 @@ public class SchemaServiceClient { HttpHeaders headers = new HttpHeaders(); headers.put(HttpHeaders.CONTENT_TYPE, singletonList(MediaType.APPLICATION_JSON_VALUE)); HttpEntity<SchemaModel> httpEntity = new HttpEntity<>(schema, headers); - template.exchange(uri, HttpMethod.PUT, httpEntity, Object.class); - LOGGER.log(Level.INFO, "Finished creating the schema={0}", schema); + ResponseEntity<Object> responseEntity = template.exchange(uri, HttpMethod.PUT, httpEntity, Object.class); + LOGGER.log(Level.INFO, "Finished creating the schema, response={0}", responseEntity); } public void createIfNotExist(SchemaModel schema) { @@ -84,7 +84,7 @@ public class SchemaServiceClient { private String buildSchemaUri() { return UriComponentsBuilder.fromHttpUrl(schemaBaseUrl) - .path("/schema/") + .path("/schema") .build().toUriString(); } -- GitLab