updated to changes to common-security
This commit is contained in:
parent
c72abfee4b
commit
7f0661d315
6
pom.xml
6
pom.xml
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -37,10 +37,4 @@ public class TestSecret extends Secret {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRefreshable() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue