Package org.apache.airavata.gfac.context.security

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


   
    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

        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

                || 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

    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

    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

                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

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

        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

            GFacException {

        if (secProperties != null)
            return;

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

        try {
            String certLocation = gssContext.getTrustedCertificatePath();
            List<String> trustedCert = new ArrayList<String>();
            trustedCert.add(certLocation + "/*.0");
            trustedCert.add(certLocation + "/*.pem");

            DirectoryCertChainValidator dcValidator = new DirectoryCertChainValidator(trustedCert, Encoding.PEM, -1,
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.context.security.GSISecurityContext

Copyright © 2018 www.massapicom. 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.