Skip to content
Snippets Groups Projects
Commit 5b266d43 authored by Rostislav Dublin (EPAM)'s avatar Rostislav Dublin (EPAM)
Browse files

Merge branch 'gcp-update-core-common' into 'master'

Gcp update core common (GONRG-1211)

See merge request !82
parents 70abc2ab 67973a1f
No related branches found
No related tags found
1 merge request!82Gcp update core common (GONRG-1211)
Pipeline #18884 failed
......@@ -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/)
......
......@@ -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
......
......@@ -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>
......
......@@ -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>
......
......@@ -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());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment