updated to changes to common-security

This commit is contained in:
lucio 2024-02-23 14:23:34 +01:00
parent c72abfee4b
commit 7f0661d315
6 changed files with 10 additions and 12 deletions

View File

@ -29,7 +29,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>
@ -41,6 +41,10 @@
<groupId>org.gcube.common</groupId>
<artifactId>common-security</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>

View File

@ -43,7 +43,7 @@ public final class SymmetricKey {
* @throws InvalidKeyException if the key is not available or is invalid
*/
public synchronized static Key getKey() throws InvalidKeyException {
Secret secret = SecretManagerProvider.instance.get();
Secret secret = SecretManagerProvider.get();
String context = secret.getContext();
if(!keyContextMap.containsKey(context))
load(context);

View File

@ -10,13 +10,13 @@ public class LocalKeyTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
SecretManagerProvider.instance.set(new TestSecret("/gcube/devsec"));
SecretManagerProvider.set(new TestSecret("/gcube/devsec"));
}
@Test
public void test() throws InvalidKeyException {
String key=SymmetricKey.getKeyFileName(SecretManagerProvider.instance.get().getContext());
String key=SymmetricKey.getKeyFileName(SecretManagerProvider.get().getContext());
System.out.println("file key found: "+key);
}

View File

@ -17,7 +17,7 @@ public class SymmetricKeyTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
SecretManagerProvider.instance.set(new TestSecret("/gcube/devsec"));
SecretManagerProvider.set(new TestSecret("/gcube/devsec"));
}
@AfterClass

View File

@ -37,10 +37,4 @@ public class TestSecret extends Secret {
return false;
}
@Override
public boolean isRefreshable() {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -18,7 +18,7 @@ public class StringEncrypterTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
SecretManagerProvider.instance.set(new TestSecret("/gcube/devsec"));
SecretManagerProvider.set(new TestSecret("/gcube/devsec"));
key = SymmetricKey.getKey();
}