diff --git a/NOTICE b/NOTICE index f18d78c82ced8da20b79daa2700d4fbecc864ae4..6639aeb03f6a1649fd164fe2a8cbed781a3837e2 100644 --- a/NOTICE +++ b/NOTICE @@ -232,7 +232,6 @@ The following software have components provided under the terms of this license: - Apache Commons Lang (from http://commons.apache.org/proper/commons-lang/) - Apache Commons Logging (from http://commons.apache.org/proper/commons-logging/) - Apache Commons Logging (from http://commons.apache.org/proper/commons-logging/) -- Apache Commons Logging (from http://commons.apache.org/proper/commons-logging/) - Apache Commons Validator (from http://commons.apache.org/proper/commons-validator/) - Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version}) - Apache Groovy (from http://groovy-lang.org) @@ -602,7 +601,6 @@ The following software have components provided under the terms of this license: - Stax2 API (from http://github.com/FasterXML/stax2-api) - jersey-ext-bean-validation (from ) - jersey-spring4 (from ) -- oro (from ) ======================================================================== BSD-3-Clause @@ -666,12 +664,6 @@ CC-BY-2.5 The following software have components provided under the terms of this license: - Checker Qual (from https://checkerframework.org) - -======================================================================== -CC-BY-3.0 -======================================================================== -The following software have components provided under the terms of this license: - - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) ======================================================================== @@ -705,9 +697,7 @@ The following software have components provided under the terms of this license: - HK2 configuration module (from ) - HK2 core module (from ) - HK2 module of HK2 itself (from ) -- Java Servlet API (from http://servlet-spec.java.net) - JavaBeans Activation Framework API jar (from ) -- JavaBeans(TM) Activation Framework (from http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp) - Run Level Service (from ) - ServiceLocator Default Implementation (from git://java.net/hk2~git/hk2-locator) - Servlet Specification 2.5 API (from ) @@ -730,7 +720,9 @@ CDDL-1.1 The following software have components provided under the terms of this license: - Java Architecture For XML Binding (from ) +- Java Servlet API (from http://servlet-spec.java.net) - JavaBeans Activation Framework (from ) +- JavaBeans(TM) Activation Framework (from http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp) - JavaMail API (from ) - OSGi resource locator (from ) - jersey-ext-bean-validation (from ) @@ -743,6 +735,7 @@ CPL-1.0 ======================================================================== The following software have components provided under the terms of this license: +- JUnit (from http://junit.org) - System Rules (from http://stefanbirkner.github.io/system-rules/) ======================================================================== @@ -750,7 +743,6 @@ EPL-1.0 ======================================================================== The following software have components provided under the terms of this license: -- JUnit (from http://junit.org) - Logback Classic Module (from ) - Logback Core Module (from ) - Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java) @@ -876,7 +868,6 @@ LGPL-2.1-or-later ======================================================================== The following software have components provided under the terms of this license: -- Java Native Access (from https://github.com/java-native-access/jna) - Java Native Access Platform (from https://github.com/java-native-access/jna) - Javassist (from http://www.javassist.org/) - SnakeYAML (from http://www.snakeyaml.org) @@ -981,7 +972,6 @@ The following software have components provided under the terms of this license: - jersey-core-common (from ) - jersey-core-server (from git://java.net/jersey~code/jersey-server) - reactive-streams (from http://www.reactive-streams.org/) -- xml-apis (from ) ======================================================================== SISSL-1.2 @@ -1034,7 +1024,9 @@ The following software have components provided under the terms of this license: - Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) - Project Lombok (from https://projectlombok.org) - Spring Web (from https://github.com/spring-projects/spring-framework) +- StAX API (from http://stax.codehaus.org/) - msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java) +- xml-apis (from ) ======================================================================== unknown @@ -1042,6 +1034,7 @@ unknown The following software have components provided under the terms of this license: - Byte Buddy (without dependencies) (from ) +- JUnit (from http://junit.org) - JavaBeans Activation Framework API jar (from ) - Servlet Specification 2.5 API (from ) - Spongy Castle (from http://rtyley.github.io/spongycastle/) diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/di/EntitlementsClientFactory.java b/legal-core/src/main/java/org/opengroup/osdu/legal/di/EntitlementsClientFactory.java index 10f98e0eb70e32eccd4e3e1d7bbe8b3706f3041b..9fea31aafc98164e61f97ebc9becfba5c1ccac1d 100644 --- a/legal-core/src/main/java/org/opengroup/osdu/legal/di/EntitlementsClientFactory.java +++ b/legal-core/src/main/java/org/opengroup/osdu/legal/di/EntitlementsClientFactory.java @@ -17,6 +17,8 @@ package org.opengroup.osdu.legal.di; import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig; import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory; import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; +import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.context.annotation.Lazy; @@ -32,6 +34,9 @@ public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlements @Value("${AUTHORIZE_API_KEY:}") public String AUTHORIZE_API_KEY; + @Autowired + private HttpResponseBodyMapper bodyMapper; + @Override protected IEntitlementsFactory createInstance() throws Exception { @@ -40,7 +45,8 @@ public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlements .builder() .rootUrl(AUTHORIZE_API) .apiKey(AUTHORIZE_API_KEY) - .build()); + .build(), + bodyMapper); } @Override diff --git a/pom.xml b/pom.xml index 48adfdea1fa285177d54268ee36233f24cd5b5da..8a3f90beb8e86488739da13dc223791dc1873cb9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ <maven.compiler.source>1.8</maven.compiler.source> <docker.image.prefix>opendes</docker.image.prefix> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <os-core-common.version>0.3.6</os-core-common.version> + <os-core-common.version>0.3.23</os-core-common.version> </properties> <licenses> diff --git a/provider/legal-azure/pom.xml b/provider/legal-azure/pom.xml index 74abade369a365346bc7ed96fe8d448dd6862978..0f8d634eab5cd1390d1febfc0c49a1c61bb76923 100644 --- a/provider/legal-azure/pom.xml +++ b/provider/legal-azure/pom.xml @@ -34,7 +34,7 @@ <azure.appservice.appname></azure.appservice.appname> <azure.appservice.subscription></azure.appservice.subscription> <osdu.corelibazure.version>0.0.42</osdu.corelibazure.version> - <osdu.oscorecommon.version>0.3.12</osdu.oscorecommon.version> + <osdu.oscorecommon.version>0.3.23</osdu.oscorecommon.version> <osdu.legal-core.version>0.0.5-SNAPSHOT</osdu.legal-core.version> <javax.inject.version>1</javax.inject.version> <javax.servlet-api.version>4.0.1</javax.servlet-api.version> diff --git a/provider/legal-gcp/src/main/java/org/opengroup/osdu/legal/countries/CloudStorageCredential.java b/provider/legal-gcp/src/main/java/org/opengroup/osdu/legal/countries/CloudStorageCredential.java index 5a3f2eb37c7929a7c903665e0c4c084c54284214..ede6242c1fb2f52457b179f8604bdd85b4fbda70 100644 --- a/provider/legal-gcp/src/main/java/org/opengroup/osdu/legal/countries/CloudStorageCredential.java +++ b/provider/legal-gcp/src/main/java/org/opengroup/osdu/legal/countries/CloudStorageCredential.java @@ -16,6 +16,9 @@ import com.google.auth.oauth2.GoogleCredentials; import com.google.common.net.HttpHeaders; import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.util.Objects; +import org.apache.commons.lang3.StringUtils; import org.opengroup.osdu.core.common.http.HttpClient; import org.opengroup.osdu.core.common.http.HttpRequest; import org.opengroup.osdu.core.common.http.HttpResponse; @@ -41,6 +44,7 @@ public class CloudStorageCredential extends GoogleCredentials { private final transient TenantInfo tenant; private final transient HttpClient httpClient; + static final transient JsonParser parser = new JsonParser(); public CloudStorageCredential(TenantInfo tenant) { this.tenant = tenant; @@ -79,9 +83,9 @@ public class CloudStorageCredential extends GoogleCredentials { "assertion", signedJwt)) .build(); HttpResponse response = this.httpClient.send(request); - JsonObject jsonResult = response.getAsJsonObject(); + JsonObject jsonResult = StringUtils.isBlank(response.getBody()) ? null : parser.parse(response.getBody()).getAsJsonObject(); - if (!response.isSuccessCode() || !jsonResult.has("access_token")) { + if (!response.isSuccessCode() || Objects.isNull(jsonResult) ||!jsonResult.has("access_token")) { throw new CompletionException("Error retrieving refresh token from Google. " + response.getBody(), response.getException()); }