Examples of GSISecurityContext


Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

    @Before
    public void setUp() throws Exception {

        GFacConfiguration gFacConfiguration = new GFacConfiguration(null);
        GSISecurityContext context = new GSISecurityContext("myproxy.teragrid.org", "*****", "*****", 3600, "./certificates");

        //have to set InFlwo Handlers and outFlowHandlers
        gFacConfiguration.setInHandlers(Arrays.asList(new GFacHandlerConfig[]{new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GramDirectorySetupHandler"), new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GridFTPInputHandler")}));
        gFacConfiguration.setOutHandlers(Arrays.asList(new GFacHandlerConfig[] {new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GridFTPOutputHandler")}));
        /*
 
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

        jobExecutionContext.setOutMessageContext(outMessage);

    }

  private GSISecurityContext getSecurityContext() {
    GSISecurityContext context = new GSISecurityContext("myproxy.teragrid.org", "xxxx", "xxxxxx", 3600, "~/.globus/certificates");
    return context;
  }
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

   
    if (secProperties != null) return;
   

   
    GSISecurityContext gssContext = (GSISecurityContext)jobExecutionContext.
                getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT);

    GlobusGSSCredentialImpl gss = (GlobusGSSCredentialImpl) gssContext.getGssCredentials();
   
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
   
    BufferedOutputStream bufos = new BufferedOutputStream(bos);
   
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

        try {
            pbsCluster = new PBSCluster(serverInfo, authenticationInfo, app.getInstalledParentPath());
        } catch (SSHApiException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
        GSISecurityContext sshSecurityContext = new GSISecurityContext(pbsCluster);
        return sshSecurityContext;
    }
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

                || registeredHost.getType() instanceof GsisshHostType) {

            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
                    = getCredentialManagementService(contextHeader);

            GSISecurityContext context;

            String gatewayId = contextHeader.getSecurityContext().getCredentialManagementService().getGatewayId();

            if (credentialManagementService != null) {
                String tokenId
                        = credentialManagementService.getTokenId();
                String portalUser = credentialManagementService.getPortalUser();

                requestData = new RequestData(tokenId, portalUser, gatewayId);
            } else {

                requestData = new RequestData(gatewayId);
            }

            try {
                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
            } catch (Exception e) {
                throw new WorkflowException("An error occurred while creating GSI security context", e);
            }
            if (registeredHost.getType() instanceof GsisshHostType) {
                GSIAuthenticationInfo authenticationInfo
                        = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
                        requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());

                Cluster pbsCluster = null;
                try {
                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
                            (((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
                } catch (SSHApiException e) {
                    e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                }

                context.setPbsCluster(pbsCluster);
            }
           
            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
        } else if (registeredHost.getType() instanceof Ec2HostType) {
            if (this.configuration.getAmazonSecurityContext() != null) {
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

    if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType) {

            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
                    = getCredentialManagementService(contextHeader);

            GSISecurityContext context;
            RequestData requestData;

            String gatewayId = contextHeader.getSecurityContext().getCredentialManagementService().getGatewayId();

            if (credentialManagementService != null) {
                String tokenId
                        = credentialManagementService.getTokenId();
                String portalUser = credentialManagementService.getPortalUser();

                requestData = new RequestData(tokenId, portalUser, gatewayId);
            } else {

                requestData = new RequestData(gatewayId);
            }

            try {
                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
            } catch (Exception e) {
                throw new WorkflowException("An error occurred while creating GSI security context", e);
            }


            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);

    } else if (registeredHost.getType() instanceof Ec2HostType) {
      if (this.configuration.getAmazonSecurityContext() != null) {
        jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
            this.configuration.getAmazonSecurityContext());
      }
    } else if (registeredHost.getType() instanceof SSHHostType) {
      SSHSecurityContext context = new SSHSecurityContext();
      context.setUsername(configurationProperties.getProperty(Constants.SSH_USER_NAME));
      context.setPrivateKeyLoc(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY));
      context.setKeyPass(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS));
      jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, context);

    }
  }
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

    if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType) {

            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
                    = getCredentialManagementService(contextHeader);

            GSISecurityContext context;

            if (credentialManagementService != null) {
                String tokenId
                        = credentialManagementService.getTokenId();
                String gatewayUser = credentialManagementService.getPortalUser();

                String gatewayId = jobExecutionContext.getGFacConfiguration().getAiravataAPI().getGateway();

                context = new GSISecurityContext(configurationProperties, tokenId, gatewayId,
                        gatewayUser);

            } else {

                context = new GSISecurityContext(configurationProperties);
            }


      jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);

    } else if (registeredHost.getType() instanceof Ec2HostType) {
      if (this.configuration.getAmazonSecurityContext() != null) {
        jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
            this.configuration.getAmazonSecurityContext());
      }
    } else if (registeredHost.getType() instanceof SSHHostType) {
      SSHSecurityContext context = new SSHSecurityContext();
      context.setUsername(configurationProperties.getProperty(Constants.SSH_USER_NAME));
      context.setPrivateKeyLoc(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY));
      context.setKeyPass(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS));
      jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, context);

    }
  }
View Full Code Here

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext

                context.setPbsCluster(pbsCluster);
            }
            */
            requestData = new RequestData("default");
            GSISecurityContext context;
            try {
                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
            } catch (Exception e) {
                throw new WorkflowException("An error occurred while creating GSI security context", e);
            }

            if (registeredHost.getType() instanceof GsisshHostType) {
                GSIAuthenticationInfo authenticationInfo
                        = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
                        requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());

                Cluster pbsCluster = null;
                try {
                    String installedParentPath = ((HpcApplicationDeploymentType)
                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
                            (CommonUtils.getPBSJobManager(installedParentPath)));
                } catch (SSHApiException e) {
                    e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                }

                context.setPbsCluster(pbsCluster);
            }

            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
        //Adding Amanzon Keys
            if (this.configuration.getAmazonSecurityContext() != null) {
View Full Code Here

Examples of org.apache.airavata.gfac.gram.security.GSISecurityContext

        requestData.setMyProxyServerUrl("myproxy.teragrid.org");
        requestData.setMyProxyUserName(System.getProperty("myproxy.user"));
        requestData.setMyProxyPassword(System.getProperty("myproxy.password"));
        requestData.setMyProxyLifeTime(3600);
        CredentialReader credentialReader = new CredentialReaderImpl(getDbUtil());
        return new GSISecurityContext(credentialReader, requestData);
    }
View Full Code Here

Examples of org.apache.airavata.gfac.gsissh.security.GSISecurityContext

        } else if (registeredHost.getType() instanceof GsisshHostType) {
            String credentialStoreToken = jobExecutionContext.getCredentialStoreToken(); // this is set by the framework
            RequestData requestData = new RequestData(ServerSettings.getDefaultUserGateway());
            requestData.setTokenId(credentialStoreToken);
            PBSCluster pbsCluster = null;
            GSISecurityContext context = null;
            try {
                TokenizedMyProxyAuthInfo tokenizedMyProxyAuthInfo = new TokenizedMyProxyAuthInfo(requestData);
                GsisshHostType gsisshHostType = (GsisshHostType) registeredHost.getType();
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress(),
                        gsisshHostType.getPort());

                JobManagerConfiguration jConfig = null;
                String installedParentPath = ((HpcApplicationDeploymentType)
                        jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
                String jobManager = ((GsisshHostType) registeredHost.getType()).getJobManager();
                if (jobManager == null) {
                    logger.error("No Job Manager is configured, so we are picking pbs as the default job manager");
                    jConfig = CommonUtils.getPBSJobManager(installedParentPath);
                } else {
                    if (PBS_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                        jConfig = CommonUtils.getPBSJobManager(installedParentPath);
                    } else if (SLURM_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                        jConfig = CommonUtils.getSLURMJobManager(installedParentPath);
                    } else if (SUN_GRID_ENGINE_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                        jConfig = CommonUtils.getSGEJobManager(installedParentPath);
                    }
                }
                pbsCluster = new PBSCluster(serverInfo, tokenizedMyProxyAuthInfo, jConfig);
                context = new GSISecurityContext(tokenizedMyProxyAuthInfo.getCredentialReader(), requestData,pbsCluster);
            } catch (Exception e) {
                throw new GFacException("An error occurred while creating GSI security context", e);
            }
            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.