porting to changes in common-security

This commit is contained in:
lucio 2024-02-23 11:32:50 +01:00
parent a446c93589
commit bd3cb5cc8f
4 changed files with 9 additions and 5 deletions

View File

@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for Common Utility For Smartgears 4.X.X
## [v1.0.1-SNAPSHOT]
- porting to changes of common-security
## [v1.0.0-SNAPSHOT]
- First Version

View File

@ -3,12 +3,12 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
<relativePath />
</parent>
<groupId>org.gcube.common</groupId>
<artifactId>common-utility-sg4</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<name>Common Utility For Smartgears 4.X.X</name>
<description>
This library provides utility functions for APIs available in Smartgears 3 but broken in Smartgears 4.
@ -30,7 +30,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -8,7 +8,7 @@ import org.gcube.common.security.providers.SecretManagerProvider;
public class ContextUtility {
public static String getCurrentContextFullName() {
String context = SecretManagerProvider.instance.get().getContext();
String context = SecretManagerProvider.get().getContext();
return context;
}

View File

@ -13,7 +13,7 @@ public class GXHTTPUtility {
public static GXHTTPStringRequest getGXHTTPStringRequest(String address) {
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
Secret secret = SecretManagerProvider.instance.get();
Secret secret = SecretManagerProvider.get();
Map<String, String> authorizationHeaders = secret.getHTTPAuthorizationHeaders();
for(String key : authorizationHeaders.keySet()) {
gxHTTPStringRequest.header(key, authorizationHeaders.get(key));