Removed usage of Encrypted Property Type and added Vault instead

This commit is contained in:
Luca Frosini 2023-02-27 15:31:50 +01:00
parent f7152f0be1
commit 4b54aa3103
2 changed files with 5 additions and 13 deletions

View File

@ -25,12 +25,12 @@ import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
import org.gcube.informationsystem.model.impl.properties.PropagationConstraintImpl;
import org.gcube.informationsystem.model.impl.relations.ConsistsOfImpl;
import org.gcube.informationsystem.model.reference.entities.Entity;
import org.gcube.informationsystem.model.reference.properties.Encrypted;
import org.gcube.informationsystem.model.reference.properties.Header;
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.AddConstraint;
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.DeleteConstraint;
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint.RemoveConstraint;
import org.gcube.informationsystem.model.reference.properties.Vault;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
@ -386,8 +386,8 @@ public class FacetBasedISConfigurationProxy extends ISConfigurationProxy<SimpleF
public ServiceCatalogueConfiguration setCkanServiceInfo(ServiceCatalogueConfiguration catalogueConfiguration) throws Exception {
AccessPointFacet ckanServiceAccessPointFacet = queryCkanServiceAccessPointFacet();
catalogueConfiguration.setCkanURL(ckanServiceAccessPointFacet.getEndpoint().toString());
Encrypted encrypted = (Encrypted) ckanServiceAccessPointFacet.getAdditionalProperty(CatalogueConfiguration.SYS_ADMIN_TOKEN_KEY);
String encryptedPassword = encrypted.getEncryptedValue();
Vault vault = (Vault) ckanServiceAccessPointFacet.getAdditionalProperty(CatalogueConfiguration.SYS_ADMIN_TOKEN_KEY);
String encryptedPassword = vault.getValue();
catalogueConfiguration.setSysAdminToken(encryptedPassword);
return catalogueConfiguration;
}
@ -397,8 +397,8 @@ public class FacetBasedISConfigurationProxy extends ISConfigurationProxy<SimpleF
ServiceCKANDB ckanDB = new ServiceCKANDB();
String ckanDbURL = postgresCkanDBAccessPointFacet.getEndpoint().toString();
ckanDB.setUrl(ckanDbURL);
Encrypted encrypted = (Encrypted) postgresCkanDBAccessPointFacet.getAdditionalProperty(ServiceCKANDB.PASSWORD_KEY);
String encryptedPassword = encrypted.getEncryptedValue();
Vault vault = (Vault) postgresCkanDBAccessPointFacet.getAdditionalProperty(ServiceCKANDB.PASSWORD_KEY);
String encryptedPassword = vault.getValue();
ckanDB.setEncryptedPassword(encryptedPassword);
String username = (String) postgresCkanDBAccessPointFacet.getAdditionalProperty(ServiceCKANDB.USERNAME_KEY);
ckanDB.setUsername(username);

View File

@ -1,18 +1,10 @@
package org.gcube.gcat.oldutils;
import org.gcube.gcat.ContextTest;
import org.gcube.informationsystem.model.impl.properties.EncryptedImpl;
import org.junit.Assert;
import org.junit.Test;
public class ValidatorTest extends ContextTest {
@Test
public void testPWd() throws Exception {
String pwd = EncryptedImpl.decrypt("");
Assert.assertTrue(true);
}
@Test
public void createGroupAsSysAdmin() throws Exception {
String groupName = "Italian";