diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d8fb2..fc5c125 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for gxREST -## [v1.2.0-SNAPSHOT] +## [v1.2.0] - Managing new UMA token and not only old authz gcube token [#21525] - Switched JSON management to gcube-jackson [#19737] diff --git a/gxHTTP/src/main/java/org/gcube/common/gxhttp/reference/GXConnection.java b/gxHTTP/src/main/java/org/gcube/common/gxhttp/reference/GXConnection.java index 1286d3d..1fb775a 100644 --- a/gxHTTP/src/main/java/org/gcube/common/gxhttp/reference/GXConnection.java +++ b/gxHTTP/src/main/java/org/gcube/common/gxhttp/reference/GXConnection.java @@ -119,12 +119,11 @@ public class GXConnection { public HttpURLConnection send(HTTPMETHOD method) throws Exception { return send(this.buildURL(), method); } - + private HttpURLConnection addGCubeAuthorizationToken(HttpURLConnection uConn) throws Exception { if (!this.extCall) { - String oldGcubeAuthtoken = SecurityTokenProvider.instance.get(); - - if (Objects.isNull(oldGcubeAuthtoken) || oldGcubeAuthtoken.isEmpty()) { + String oldGcubeAuthToken = SecurityTokenProvider.instance.get(); + if (Objects.isNull(oldGcubeAuthToken) || oldGcubeAuthToken.isEmpty()) { String umaToken = AccessTokenProvider.instance.get(); if(Objects.isNull(umaToken) || umaToken.isEmpty()) { throw new IllegalStateException("The security token in the current environment is null."); @@ -132,7 +131,7 @@ public class GXConnection { uConn.setRequestProperty("Authorization", "Bearer " + umaToken); } } else { - uConn.setRequestProperty(org.gcube.common.authorization.client.Constants.TOKEN_HEADER_ENTRY, oldGcubeAuthtoken); + uConn.setRequestProperty(org.gcube.common.authorization.client.Constants.TOKEN_HEADER_ENTRY, oldGcubeAuthToken); } } return uConn; @@ -186,7 +185,7 @@ public class GXConnection { } return uConn; } - + private URL getURL(String urlString) throws MalformedURLException { URL url = new URL(urlString); if (url.getProtocol().equals("https")) { diff --git a/pom.xml b/pom.xml index e6504d5..817d7a6 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.common gxREST - 1.2.0-SNAPSHOT + 1.2.0 pom gCube eXtensions to REST gCube eXtensions to REST