From 303b8a035e58afdb85190ef6e0df035c19aa74f4 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Tue, 27 Sep 2022 12:23:08 +0200 Subject: [PATCH] Dependencies Management --- cms-plugin-framework/pom.xml | 3 - cms-test-commons/pom.xml | 25 ++++++++ .../application/cms/tests/TokenSetter.java | 38 ++++++++---- geoportal-service/pom.xml | 30 +++++++--- pom.xml | 60 ++++++++++++++----- 5 files changed, 117 insertions(+), 39 deletions(-) diff --git a/cms-plugin-framework/pom.xml b/cms-plugin-framework/pom.xml index d68f3d3..00624be 100644 --- a/cms-plugin-framework/pom.xml +++ b/cms-plugin-framework/pom.xml @@ -45,7 +45,6 @@ net.postgis postgis-jdbc 2.5.0 - provided @@ -53,7 +52,6 @@ org.gcube.spatial.data gis-interface [2.4.6,3.0.0-SNAPSHOT) - provided @@ -62,7 +60,6 @@ org.gcube.data.transfer data-transfer-library [1.2.1,2.0.0-SNAPSHOT) - provided diff --git a/cms-test-commons/pom.xml b/cms-test-commons/pom.xml index 3f1da89..340eb5b 100644 --- a/cms-test-commons/pom.xml +++ b/cms-test-commons/pom.xml @@ -84,6 +84,31 @@ jackson-datatype-jsr310 + + + org.gcube.common + authorization-utils + [2.0.0, 3.0.0-SNAPSHOT) + + + + org.gcube.common + authorization-client + provided + + + + org.gcube.common + common-authorization + provided + + + + org.gcube.core + common-encryption + provided + + org.apache.logging.log4j log4j-slf4j18-impl diff --git a/cms-test-commons/src/main/java/org/gcube/application/cms/tests/TokenSetter.java b/cms-test-commons/src/main/java/org/gcube/application/cms/tests/TokenSetter.java index 89e7f63..282fd09 100644 --- a/cms-test-commons/src/main/java/org/gcube/application/cms/tests/TokenSetter.java +++ b/cms-test-commons/src/main/java/org/gcube/application/cms/tests/TokenSetter.java @@ -4,6 +4,10 @@ import lombok.extern.slf4j.Slf4j; import org.gcube.application.geoportal.common.utils.Files; import org.gcube.common.authorization.library.provider.AccessTokenProvider; import org.gcube.common.authorization.library.provider.SecurityTokenProvider; +import org.gcube.common.authorization.utils.manager.SecretManager; +import org.gcube.common.authorization.utils.manager.SecretManagerProvider; +import org.gcube.common.authorization.utils.secret.GCubeSecret; +import org.gcube.common.authorization.utils.secret.Secret; import org.gcube.common.scope.api.ScopeProvider; import java.io.File; @@ -27,19 +31,27 @@ public class TokenSetter { public static void set(String scope){ + SecretManagerProvider.instance.set(new SecretManager()); + if(!props.containsKey(scope)) throw new RuntimeException("No token found for scope : "+scope); +// Secret secret = SecretUtility. getSecretByTokenString(token); // se non sai con che token hai a che fare; + // oppure + String toSet= props.getProperty(scope); + log.debug("Setting secret "+toSet); + Secret secret = new GCubeSecret(toSet); // se vecchio token + // oppure +// Secret secret = new JWTSecret(token); // se nuovo token + + SecretManagerProvider.instance.get().addSecret(secret); try{ - if(!props.containsKey(scope)) throw new RuntimeException("No token found for scope : "+scope); - SecurityTokenProvider.instance.set(props.getProperty(scope)); - }catch(Throwable e){ - log.warn("Unable to set token for scope "+scope,e); - } - ScopeProvider.instance.set(scope); + SecretManagerProvider.instance.get().set(); + }catch(Exception e ){throw new RuntimeException("Unable to set secret for context "+scope,e);} } +// +// public static void setUma() throws IOException { +// File umaFile = new File("uma.json"); +// String uma= Files.readFileAsString(umaFile.getAbsolutePath(), Charset.defaultCharset()); +// AccessTokenProvider.instance.set(uma); +// +// } - public static void setUma() throws IOException { - File umaFile = new File("uma.json"); - String uma= Files.readFileAsString(umaFile.getAbsolutePath(), Charset.defaultCharset()); - AccessTokenProvider.instance.set(uma); - - } -} +} \ No newline at end of file diff --git a/geoportal-service/pom.xml b/geoportal-service/pom.xml index 1db28f1..65bd31b 100644 --- a/geoportal-service/pom.xml +++ b/geoportal-service/pom.xml @@ -72,7 +72,11 @@ 3.6.0 - + + + javax.xml.bind + jaxb-api + @@ -139,6 +143,24 @@ test + + com.sun.xml.bind + jaxb-impl + test + + + + com.sun.xml.bind + jaxb-core + test + + + + javax.activation + activation + test + + @@ -153,7 +175,6 @@ test - org.gcube.data.transfer data-transfer-library @@ -161,11 +182,6 @@ test - - javax.xml.bind - jaxb-api - - diff --git a/pom.xml b/pom.xml index 514345b..0aec16e 100644 --- a/pom.xml +++ b/pom.xml @@ -22,19 +22,19 @@ https://code-repo.d4science.org/gCubeSystem - - - - - + 2.0.2 + 2.1.1 + 3.6.3 + [1.0.0,2.0.0-SNAPSHOT) + 1.0.1-SNAPSHOT - 2.1.0-SNAPSHOT - 2.2.0-SNAPSHOT - 3.7.0-SNAPSHOT - [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) - - 1.0.1-SNAPSHOT + + + + + + @@ -196,11 +196,39 @@ - - org.projectlombok - lombok - 1.18.4 - + + + + org.projectlombok + lombok + 1.18.4 + + + + javax.xml.bind + jaxb-api + 2.3.0 + + + + com.sun.xml.bind + jaxb-impl + 2.3.0.1 + + + + com.sun.xml.bind + jaxb-core + 2.3.0.1 + + + + + javax.activation + activation + 1.1.1 + + junit