Updating secure test-suite
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@44101 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c2615afce3
commit
3f3787da1e
|
@ -45,16 +45,12 @@ public class SecureRegistryRegistrationTest {
|
|||
|
||||
for (String param : args) System.out.println("param "+ param);
|
||||
|
||||
final boolean isSecurityEnabled = GHNContext.getContext().isSecurityEnabled();
|
||||
|
||||
if (args.length != 5) {
|
||||
printUsage();
|
||||
}
|
||||
|
||||
|
||||
String identity = null;
|
||||
if (isSecurityEnabled) identity = args [4];
|
||||
|
||||
String identity = args [4];
|
||||
|
||||
GCUBEResource resource = getResource(args[2], new FileReader(args[1]));
|
||||
EndpointReferenceType factoryEPR = new EndpointReferenceType();
|
||||
|
@ -62,7 +58,7 @@ public class SecureRegistryRegistrationTest {
|
|||
factoryEPR.setAddress(new Address(args[0]));
|
||||
ResourceRegistrationServiceAddressingLocator locator = new ResourceRegistrationServiceAddressingLocator();
|
||||
ResourceRegistrationPortType registration = locator.getResourceRegistrationPortTypePort(factoryEPR);
|
||||
GCUBESecurityManager securityManager = Utils.generateAndConfigureDefaultSecurityManager(identity, isSecurityEnabled);
|
||||
GCUBESecurityManager securityManager = Utils.generateAndConfigureDefaultSecurityManager(identity, true);
|
||||
securityManager.setSecurity(registration, GCUBESecurityManager.AuthMode.PRIVACY, GCUBESecurityManager.DelegationMode.FULL);
|
||||
registration = GCUBERemotePortTypeContext.getProxy(registration, GCUBEScope.getScope(args[3]), securityManager);
|
||||
CreateMessage message = new CreateMessage();
|
||||
|
@ -70,6 +66,7 @@ public class SecureRegistryRegistrationTest {
|
|||
resource.store(writer);
|
||||
message.setProfile(writer.toString());
|
||||
message.setType(resource.getType());
|
||||
registration.create(message);
|
||||
System.out.println("Resource successfully registered");
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -4,13 +4,12 @@ import org.gcube.common.core.security.GCUBEClientSecurityManager;
|
|||
import org.gcube.common.core.security.GCUBESecurityManager;
|
||||
import org.gcube.common.core.security.GCUBESecurityManagerImpl;
|
||||
import org.gcube.common.core.security.context.SecurityContextFactory;
|
||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||
import org.gcube.common.core.utils.logging.GCUBEClientLog;
|
||||
|
||||
public class Utils
|
||||
{
|
||||
public class Utils {
|
||||
public static GCUBESecurityManager generateAndConfigureDefaultSecurityManager (String identity, final boolean isSecurityEnabled)
|
||||
{
|
||||
GCUBELog logger = new GCUBELog(Utils.class);
|
||||
GCUBEClientLog logger = new GCUBEClientLog(Utils.class);
|
||||
|
||||
GCUBESecurityManager securityManager = null;
|
||||
|
||||
|
|
Loading…
Reference in New Issue