You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/09/25 21:10:41 UTC

[1/8] airavata git commit: AIRAVATA-2500 Disallow overwriting LDAP SSH key

Repository: airavata
Updated Branches:
  refs/heads/AIRAVATA-2500 2425187bb -> 50d7bb6a5


AIRAVATA-2500 Disallow overwriting LDAP SSH key


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/42059ecc
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/42059ecc
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/42059ecc

Branch: refs/heads/AIRAVATA-2500
Commit: 42059ecccc02eaf6493cda480a6edbaad0d09961
Parents: 2425187
Author: Marcus Christie <ma...@apache.org>
Authored: Wed Sep 20 16:29:26 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Wed Sep 20 16:29:26 2017 -0400

----------------------------------------------------------------------
 .../provisioner/IULdapSSHAccountProvisioner.java        | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/42059ecc/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
index 4f0ad07..69ed3f6 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
@@ -104,7 +104,17 @@ public class IULdapSSHAccountProvisioner implements SSHAccountProvisioner  {
                     modifyRequest.addModification(new DefaultAttribute(SSH_PUBLIC_KEY_ATTRIBUTE_NAME, sshPublicKey), ModificationOperation.ADD_ATTRIBUTE);
                 } else {
 
-                    modifyRequest.addModification(new DefaultAttribute(SSH_PUBLIC_KEY_ATTRIBUTE_NAME, sshPublicKey), ModificationOperation.REPLACE_ATTRIBUTE);
+                    String oldSshPublicKey = entry.get(SSH_PUBLIC_KEY_ATTRIBUTE_NAME).getString();
+                    if (!oldSshPublicKey.equals(sshPublicKey)) {
+                        // Disallow overwriting the SSH key
+                        throw new RuntimeException("User [" + username + "] already has an SSH public key in LDAP for ["
+                                + ldapBaseDN + "] and overwriting it isn't allowed.");
+                        // modifyRequest.addModification(new DefaultAttribute(SSH_PUBLIC_KEY_ATTRIBUTE_NAME,
+                        //        sshPublicKey), ModificationOperation.REPLACE_ATTRIBUTE);
+                    } else {
+                        // SSH key is already installed so just return
+                        return true;
+                    }
                 }
                 ModifyResponse modifyResponse = ldapConnection.modify(modifyRequest);
                 if (modifyResponse.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS) {


[3/8] airavata git commit: AIRAVATA-2500 Fix bug deriving ssh hostname

Posted by ma...@apache.org.
AIRAVATA-2500 Fix bug deriving ssh hostname


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/596eb5ba
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/596eb5ba
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/596eb5ba

Branch: refs/heads/AIRAVATA-2500
Commit: 596eb5ba21bec45cdd5eb92a7b09f0249eddcceb
Parents: 8f68bc1
Author: Marcus Christie <ma...@apache.org>
Authored: Mon Sep 25 09:24:41 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Mon Sep 25 09:42:24 2017 -0400

----------------------------------------------------------------------
 .../airavata/accountprovisioning/SSHAccountManager.java     | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/596eb5ba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
index 61deb49..e7e9052 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
@@ -183,6 +183,15 @@ public class SSHAccountManager {
         return userComputeResourcePreference;
     }
 
+    private static String getSSHHostname(ComputeResourceDescription computeResourceDescription, SSHJobSubmission sshJobSubmission) {
+        String alternativeSSHHostName = sshJobSubmission.getAlternativeSSHHostName();
+        if (alternativeSSHHostName != null && !"".equals(alternativeSSHHostName.trim())) {
+            return alternativeSSHHostName;
+        } else {
+            return computeResourceDescription.getHostName();
+        }
+    }
+
     private static SSHAccountProvisioner createSshAccountProvisioner(String gatewayId, ComputeResourcePreference computeResourcePreference) throws InvalidSetupException {
         String provisionerName = computeResourcePreference.getSshAccountProvisioner();
         Map<ConfigParam,String> provisionerConfig = convertConfigParams(provisionerName, computeResourcePreference.getSshAccountProvisionerConfig());


[5/8] airavata git commit: AIRAVATA-2500 Add 'validated' flag to UserComputeResourcePreference

Posted by ma...@apache.org.
AIRAVATA-2500 Add 'validated' flag to UserComputeResourcePreference


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/20fc3fdb
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/20fc3fdb
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/20fc3fdb

Branch: refs/heads/AIRAVATA-2500
Commit: 20fc3fdbbd7928c63c0ee6abf1382d9970bbef67
Parents: 596eb5b
Author: Marcus Christie <ma...@apache.org>
Authored: Mon Sep 25 09:24:01 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Mon Sep 25 09:57:28 2017 -0400

----------------------------------------------------------------------
 .../accountprovisioning/SSHAccountManager.java  |  1 +
 .../catalog/impl/UsrResourceProfileImpl.java    |  2 ++
 .../model/UserComputeResourcePreference.java    | 10 ++++++
 .../UserComputeHostPreferenceResource.java      | 11 ++++++
 .../app/catalog/util/AppCatalogJPAUtils.java    |  1 +
 .../util/AppCatalogThriftConversion.java        |  1 +
 .../src/main/resources/appcatalog-derby.sql     | 38 +++++++++++++++++++-
 .../src/main/resources/appcatalog-mysql.sql     | 38 ++++++++++++++++++++
 .../DeltaScripts/appCatalog_schema_delta.sql    |  2 ++
 .../user_resource_profile_model.thrift          |  8 ++++-
 10 files changed, 110 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
index e7e9052..136bbee 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
@@ -180,6 +180,7 @@ public class SSHAccountManager {
         userComputeResourcePreference.setComputeResourceId(computeResourceId);
         userComputeResourcePreference.setLoginUserName(username);
         userComputeResourcePreference.setScratchLocation(scratchLocation);
+        userComputeResourcePreference.setValidated(true);
         return userComputeResourcePreference;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
index b7a95f8..a7366ca 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
@@ -83,6 +83,7 @@ public class UsrResourceProfileImpl implements UsrResourceProfile {
                     if (preference.getReservationEndTime() > 0) {
                         resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
                     }
+                    resource.setValidated(preference.isValidated());
                     resource.save();
                 }
             }
@@ -142,6 +143,7 @@ public class UsrResourceProfileImpl implements UsrResourceProfile {
                     if (preference.getReservationEndTime() > 0) {
                         resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
                     }
+                    resource.setValidated(preference.isValidated());
                     resource.save();
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserComputeResourcePreference.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserComputeResourcePreference.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserComputeResourcePreference.java
index e86248f..81ef75a 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserComputeResourcePreference.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserComputeResourcePreference.java
@@ -54,6 +54,8 @@ public class UserComputeResourcePreference {
     private Timestamp reservationStartTime;
     @Column(name = "RESERVATION_END_TIME")
     private Timestamp reservationEndTime;
+    @Column(name = "VALIDATED")
+    private boolean validated;
 
 
     @ManyToOne(cascade= CascadeType.MERGE)
@@ -184,4 +186,12 @@ public class UserComputeResourcePreference {
     public void setReservationEndTime(Timestamp reservationEndTime) {
         this.reservationEndTime = reservationEndTime;
     }
+
+    public boolean isValidated() {
+        return validated;
+    }
+
+    public void setValidated(boolean validated) {
+        this.validated = validated;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/UserComputeHostPreferenceResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/UserComputeHostPreferenceResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/UserComputeHostPreferenceResource.java
index 3f215c2..9c8cbf0 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/UserComputeHostPreferenceResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/UserComputeHostPreferenceResource.java
@@ -49,6 +49,7 @@ public class UserComputeHostPreferenceResource extends AppCatAbstractResource {
     private String reservation;
     private Timestamp reservationStartTime;
     private Timestamp reservationEndTime;
+    private boolean validated = false;
 
     private UserResourceProfileResource userResourceProfileResource;
     private ComputeResourceResource computeHostResource;
@@ -166,6 +167,14 @@ public class UserComputeHostPreferenceResource extends AppCatAbstractResource {
         this.reservationEndTime = reservationEndTime;
     }
 
+    public boolean isValidated() {
+        return validated;
+    }
+
+    public void setValidated(boolean validated) {
+        this.validated = validated;
+    }
+
     @Override
     public void remove(Object identifier) throws AppCatalogException {
         CompositeIdentifier ids;
@@ -378,6 +387,7 @@ public class UserComputeHostPreferenceResource extends AppCatAbstractResource {
                 existingPreference.setReservation(reservation);
                 existingPreference.setReservationStartTime(reservationStartTime);
                 existingPreference.setReservationEndTime(reservationEndTime);
+                existingPreference.setValidated(validated);
                 em.merge(existingPreference);
             } else {
                 UserComputeResourcePreference resourcePreference = new UserComputeResourcePreference();
@@ -394,6 +404,7 @@ public class UserComputeHostPreferenceResource extends AppCatAbstractResource {
                 resourcePreference.setReservation(reservation);
                 resourcePreference.setReservationStartTime(reservationStartTime);
                 resourcePreference.setReservationEndTime(reservationEndTime);
+                resourcePreference.setValidated(validated);
                 em.persist(resourcePreference);
             }
             em.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
index c41e8a2..2efd419 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
@@ -987,6 +987,7 @@ public class AppCatalogJPAUtils {
             resource.setReservation(o.getReservation());
             resource.setReservationStartTime(o.getReservationStartTime());
             resource.setReservationEndTime(o.getReservationEndTime());
+            resource.setValidated(o.isValidated());
         }
         return resource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
index 09258a2..944ad77 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
@@ -901,6 +901,7 @@ public class AppCatalogThriftConversion {
         if (resource.getReservationEndTime() != null) {
             preference.setReservationEndTime(resource.getReservationEndTime().getTime());
         }
+        preference.setValidated(resource.isValidated());
         return preference;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
index c57549e..db9e261 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
@@ -532,7 +532,43 @@ CREATE TABLE WORKFLOW_OUTPUT
          FOREIGN KEY (WF_TEMPLATE_ID) REFERENCES WORKFLOW(WF_TEMPLATE_ID) ON DELETE CASCADE
 );
 
-
+CREATE TABLE USER_RESOURCE_PROFILE (
+  USER_ID varchar(255) NOT NULL,
+  CREATION_TIME TIMESTAMP DEFAULT NULL,
+  CS_TOKEN varchar(255) DEFAULT NULL,
+  GATEWAY_ID varchar(255) DEFAULT NULL,
+  IDENTITY_SERVER_PWD_CRED_TOKEN varchar(255) DEFAULT NULL,
+  IDENTITY_SERVER_TENANT varchar(255) DEFAULT NULL,
+  UPDATE_TIME TIMESTAMP DEFAULT NULL,
+  PRIMARY KEY (USER_ID,GATEWAY_ID)
+);
+
+CREATE TABLE USER_STORAGE_PREFERENCE (
+  STORAGE_RESOURCE_ID varchar(255) NOT NULL,
+  USER_ID varchar(255) NOT NULL,
+  RESOURCE_CS_TOKEN varchar(255) DEFAULT NULL,
+  FS_ROOT_LOCATION varchar(255) DEFAULT NULL,
+  GATEWAY_ID varchar(255) DEFAULT NULL,
+  LOGIN_USERNAME varchar(255) DEFAULT NULL,
+  PRIMARY KEY (STORAGE_RESOURCE_ID,USER_ID,GATEWAY_ID)
+);
+
+CREATE TABLE USER_COMPUTE_RESOURCE_PREFERENCE (
+  RESOURCE_ID varchar(255) NOT NULL,
+  USER_ID varchar(255) NOT NULL,
+  PREFERED_BATCH_QUEUE varchar(255) DEFAULT NULL,
+  RESOURCE_CS_TOKEN varchar(255) DEFAULT NULL,
+  GATEWAY_ID varchar(255) DEFAULT NULL,
+  LOGIN_USERNAME varchar(255) DEFAULT NULL,
+  ALLOCATION_PROJECT_NUMBER varchar(255) DEFAULT NULL,
+  QUALITY_OF_SERVICE varchar(255) DEFAULT NULL,
+  RESERVATION varchar(255) DEFAULT NULL,
+  RESERVATION_END_TIME TIMESTAMP DEFAULT NULL,
+  RESERVATION_START_TIME TIMESTAMP DEFAULT NULL,
+  SCRATCH_LOCATION varchar(255) DEFAULT NULL,
+  VALIDATED SMALLINT NOT NULL DEFAULT 0,
+  PRIMARY KEY (RESOURCE_ID,USER_ID,GATEWAY_ID)
+);
 
 CREATE TABLE CONFIGURATION
 (

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
index 6c07499..3664a63 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
@@ -530,6 +530,44 @@ CREATE TABLE WORKFLOW_OUTPUT
          FOREIGN KEY (WF_TEMPLATE_ID) REFERENCES WORKFLOW(WF_TEMPLATE_ID) ON DELETE CASCADE
 );
 
+CREATE TABLE USER_RESOURCE_PROFILE (
+  USER_ID varchar(255) NOT NULL,
+  CREATION_TIME datetime DEFAULT NULL,
+  CS_TOKEN varchar(255) DEFAULT NULL,
+  GATEWAY_ID varchar(255) DEFAULT NULL,
+  IDENTITY_SERVER_PWD_CRED_TOKEN varchar(255) DEFAULT NULL,
+  IDENTITY_SERVER_TENANT varchar(255) DEFAULT NULL,
+  UPDATE_TIME datetime DEFAULT NULL,
+  PRIMARY KEY (USER_ID,GATEWAY_ID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE USER_STORAGE_PREFERENCE (
+  STORAGE_RESOURCE_ID varchar(255) NOT NULL,
+  USER_ID varchar(255) NOT NULL,
+  RESOURCE_CS_TOKEN varchar(255) DEFAULT NULL,
+  FS_ROOT_LOCATION varchar(255) DEFAULT NULL,
+  GATEWAY_ID varchar(255) DEFAULT NULL,
+  LOGIN_USERNAME varchar(255) DEFAULT NULL,
+  PRIMARY KEY (STORAGE_RESOURCE_ID,USER_ID,GATEWAY_ID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE USER_COMPUTE_RESOURCE_PREFERENCE (
+  RESOURCE_ID varchar(255) NOT NULL,
+  USER_ID varchar(255) NOT NULL,
+  PREFERED_BATCH_QUEUE varchar(255) DEFAULT NULL,
+  RESOURCE_CS_TOKEN varchar(255) DEFAULT NULL,
+  GATEWAY_ID varchar(255) DEFAULT NULL,
+  LOGIN_USERNAME varchar(255) DEFAULT NULL,
+  ALLOCATION_PROJECT_NUMBER varchar(255) DEFAULT NULL,
+  QUALITY_OF_SERVICE varchar(255) DEFAULT NULL,
+  RESERVATION varchar(255) DEFAULT NULL,
+  RESERVATION_END_TIME datetime DEFAULT NULL,
+  RESERVATION_START_TIME datetime DEFAULT NULL,
+  SCRATCH_LOCATION varchar(255) NOT NULL DEFAULT NULL,
+  VALIDATED TINYINT(1) DEFAULT 0,
+  PRIMARY KEY (RESOURCE_ID,USER_ID,GATEWAY_ID)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
 CREATE TABLE CONFIGURATION
 (
           CONFIG_KEY VARCHAR(255),

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
----------------------------------------------------------------------
diff --git a/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql b/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
index 36fc66b..04241e2 100644
--- a/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
@@ -30,3 +30,5 @@ CREATE TABLE SSH_ACCOUNT_PROVISIONER_CONFIG
         PRIMARY KEY (GATEWAY_ID, RESOURCE_ID, CONFIG_NAME),
         FOREIGN KEY (GATEWAY_ID, RESOURCE_ID) REFERENCES COMPUTE_RESOURCE_PREFERENCE (GATEWAY_ID, RESOURCE_ID) ON DELETE CASCADE
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+alter table USER_COMPUTE_RESOURCE_PREFERENCE add VALIDATED tinyint(1) NOT NULL DEFAULT 0;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/20fc3fdb/thrift-interface-descriptions/data-models/resource-catalog-models/user_resource_profile_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/user_resource_profile_model.thrift b/thrift-interface-descriptions/data-models/resource-catalog-models/user_resource_profile_model.thrift
index 3dcb53b..6bac85d 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/user_resource_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/user_resource_profile_model.thrift
@@ -53,6 +53,11 @@ include "../user-tenant-group-models/user_profile_model.thrift"
  *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
  *   default credential store.
  *
+ * validated:
+ *  If true the the configuration has been validated in the sense that the username and credential can be used to
+ *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+ *  Should be treated as read-only and only mutated by Airavata middleware.
+ *
 */
 struct UserComputeResourcePreference {
     1: required string computeResourceId,
@@ -64,7 +69,8 @@ struct UserComputeResourcePreference {
     7: optional string qualityOfService,
     8: optional string reservation,
     9: optional i64 reservationStartTime,
-    10: optional i64 reservationEndTime
+    10: optional i64 reservationEndTime,
+    11: optional bool validated = false
 }
 
 struct UserStoragePreference {


[7/8] airavata git commit: AIRAVATA-2500 data migration for new validated flag

Posted by ma...@apache.org.
AIRAVATA-2500 data migration for new validated flag


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/ba4982c1
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/ba4982c1
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/ba4982c1

Branch: refs/heads/AIRAVATA-2500
Commit: ba4982c1fe90b841b250f085a5b536c21c4f3201
Parents: 29fedaf
Author: Marcus Christie <ma...@apache.org>
Authored: Mon Sep 25 10:38:28 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Mon Sep 25 10:38:28 2017 -0400

----------------------------------------------------------------------
 .../0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql           | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/ba4982c1/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
----------------------------------------------------------------------
diff --git a/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql b/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
index 04241e2..672b43b 100644
--- a/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
@@ -31,4 +31,6 @@ CREATE TABLE SSH_ACCOUNT_PROVISIONER_CONFIG
         FOREIGN KEY (GATEWAY_ID, RESOURCE_ID) REFERENCES COMPUTE_RESOURCE_PREFERENCE (GATEWAY_ID, RESOURCE_ID) ON DELETE CASCADE
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-alter table USER_COMPUTE_RESOURCE_PREFERENCE add VALIDATED tinyint(1) NOT NULL DEFAULT 0;
\ No newline at end of file
+alter table USER_COMPUTE_RESOURCE_PREFERENCE add VALIDATED tinyint(1) NOT NULL DEFAULT 0;
+-- VALIDATED defaults to false (0) but set all existing ones to be true (1)
+update USER_COMPUTE_RESOURCE_PREFERENCE set VALIDATED = 1;
\ No newline at end of file


[2/8] airavata git commit: AIRAVATA-2500 Adding try/catch around doesUserHaveSSHAccount

Posted by ma...@apache.org.
AIRAVATA-2500 Adding try/catch around doesUserHaveSSHAccount


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/8f68bc1a
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/8f68bc1a
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/8f68bc1a

Branch: refs/heads/AIRAVATA-2500
Commit: 8f68bc1a9fdef0f980c7ae47ef671366fdb4373b
Parents: 42059ec
Author: Marcus Christie <ma...@apache.org>
Authored: Wed Sep 20 16:42:37 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Wed Sep 20 16:42:37 2017 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java    | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/8f68bc1a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index febb703..162260e 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -19,10 +19,7 @@
  */
 package org.apache.airavata.api.server.handler;
 
-import org.apache.airavata.accountprovisioning.ConfigParam;
-import org.apache.airavata.accountprovisioning.SSHAccountManager;
-import org.apache.airavata.accountprovisioning.SSHAccountProvisionerFactory;
-import org.apache.airavata.accountprovisioning.SSHAccountProvisionerProvider;
+import org.apache.airavata.accountprovisioning.*;
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.airavata_apiConstants;
 import org.apache.airavata.api.server.util.ThriftClientPool;
@@ -4008,8 +4005,18 @@ public class AiravataServerHandler implements Airavata.Iface {
     @Override
     @SecurityCheck
     public boolean doesUserHaveSSHAccount(AuthzToken authzToken, String computeResourceId, String userId) throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
-        String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
-        return SSHAccountManager.doesUserHaveSSHAccount(gatewayId, computeResourceId, userId);
+        try {
+            String gatewayId = authzToken.getClaimsMap().get(Constants.GATEWAY_ID);
+            return SSHAccountManager.doesUserHaveSSHAccount(gatewayId, computeResourceId, userId);
+        } catch (Exception e) {
+            String errorMessage = "Error occurred while checking if [" + userId + "] has an SSH Account on [" +
+                    computeResourceId + "].";
+            logger.error(errorMessage, e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage(errorMessage + " More info : " + e.getMessage());
+            throw exception;
+        }
     }
 
     @Override


[8/8] airavata git commit: AIRAVATA-2500 Returning/using username of cluster account

Posted by ma...@apache.org.
AIRAVATA-2500 Returning/using username of cluster account


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/50d7bb6a
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/50d7bb6a
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/50d7bb6a

Branch: refs/heads/AIRAVATA-2500
Commit: 50d7bb6a5b90966eb6cb78c1a5d95f7647345e1b
Parents: ba4982c
Author: Marcus Christie <ma...@apache.org>
Authored: Mon Sep 25 16:17:54 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Mon Sep 25 16:17:54 2017 -0400

----------------------------------------------------------------------
 .../accountprovisioning/SSHAccountManager.java  | 45 ++++++++++++++------
 .../SSHAccountProvisioner.java                  |  6 ++-
 .../IULdapSSHAccountProvisioner.java            |  5 ++-
 .../provisioner/TestSSHAccountProvisioner.java  |  6 ++-
 4 files changed, 44 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/50d7bb6a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
index 136bbee..d6b9eb1 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
@@ -50,7 +50,16 @@ public class SSHAccountManager {
 
     private final static Logger logger = LoggerFactory.getLogger(SSHAccountManager.class);
 
-    public static boolean doesUserHaveSSHAccount(String gatewayId, String computeResourceId, String username) throws InvalidSetupException, InvalidUsernameException {
+    /**
+     * Check if user has an SSH account on the compute resource.
+     * @param gatewayId
+     * @param computeResourceId
+     * @param userId Airavata user id
+     * @return
+     * @throws InvalidSetupException
+     * @throws InvalidUsernameException
+     */
+    public static boolean doesUserHaveSSHAccount(String gatewayId, String computeResourceId, String userId) throws InvalidSetupException, InvalidUsernameException {
 
         // get compute resource preferences for the gateway and hostname
         RegistryService.Client registryServiceClient = getRegistryServiceClient();
@@ -75,15 +84,25 @@ public class SSHAccountManager {
         SSHAccountProvisioner sshAccountProvisioner = createSshAccountProvisioner(gatewayId, computeResourcePreference);
 
         try {
-            return sshAccountProvisioner.hasAccount(username);
+            return sshAccountProvisioner.hasAccount(userId);
         } catch (InvalidUsernameException e) {
             throw e;
         } catch (Exception e) {
-            throw new RuntimeException("hasAccount call failed for username [" + username + "]: " + e.getMessage(), e);
+            throw new RuntimeException("hasAccount call failed for userId [" + userId + "]: " + e.getMessage(), e);
         }
     }
 
-    public static UserComputeResourcePreference setupSSHAccount(String gatewayId, String computeResourceId, String username, SSHCredential sshCredential) throws InvalidSetupException, InvalidUsernameException {
+    /**
+     * Add SSH key to compute resource on behalf of user.
+     * @param gatewayId
+     * @param computeResourceId
+     * @param userId Airavata user id
+     * @param sshCredential
+     * @return a populated but not persisted UserComputeResourcePreference instance
+     * @throws InvalidSetupException
+     * @throws InvalidUsernameException
+     */
+    public static UserComputeResourcePreference setupSSHAccount(String gatewayId, String computeResourceId, String userId, SSHCredential sshCredential) throws InvalidSetupException, InvalidUsernameException {
 
         // get compute resource preferences for the gateway and hostname
         RegistryService.Client registryServiceClient = getRegistryServiceClient();
@@ -127,32 +146,34 @@ public class SSHAccountManager {
         SSHAccountProvisioner sshAccountProvisioner = createSshAccountProvisioner(gatewayId, computeResourcePreference);
         boolean canCreateAccount = SSHAccountProvisionerFactory.canCreateAccount(computeResourcePreference.getSshAccountProvisioner());
 
-        // First check if username has an account
+        // First check if userId has an account
         boolean hasAccount = false;
         try {
-            hasAccount = sshAccountProvisioner.hasAccount(username);
+            hasAccount = sshAccountProvisioner.hasAccount(userId);
         } catch (InvalidUsernameException e) {
             throw e;
         } catch (Exception e) {
-            throw new RuntimeException("hasAccount call failed for username [" + username + "]: " + e.getMessage(), e);
+            throw new RuntimeException("hasAccount call failed for userId [" + userId + "]: " + e.getMessage(), e);
         }
 
         if (!hasAccount && !canCreateAccount) {
-            throw new InvalidSetupException("User [" + username + "] doesn't have account and [" + computeResourceId + "] doesn't " +
+            throw new InvalidSetupException("User [" + userId + "] doesn't have account and [" + computeResourceId + "] doesn't " +
                     "have a SSH Account Provisioner that supports creating accounts.");
         }
+        // TODO: create account for user if user doesn't have account
 
+        String username = null;
         // Install SSH key
         try {
-            sshAccountProvisioner.installSSHKey(username, sshCredential.getPublicKey());
+            username = sshAccountProvisioner.installSSHKey(userId, sshCredential.getPublicKey());
         } catch (InvalidUsernameException e) {
             throw e;
         } catch (Exception e) {
-            throw new RuntimeException("installSSHKey call failed for username [" + username + "]: " + e.getMessage(), e);
+            throw new RuntimeException("installSSHKey call failed for userId [" + userId + "]: " + e.getMessage(), e);
         }
 
         // Verify can authenticate to host
-        String sshHostname = sshJobSubmission.getAlternativeSSHHostName() != null ? sshJobSubmission.getAlternativeSSHHostName() : computeResourceDescription.getHostName();
+        String sshHostname = getSSHHostname(computeResourceDescription, sshJobSubmission);
         int sshPort = sshJobSubmission.getSshPort();
         boolean validated = false;
         try {
@@ -168,7 +189,7 @@ public class SSHAccountManager {
         }
 
         // create the scratch location on the host
-        String scratchLocation = sshAccountProvisioner.getScratchLocation(username);
+        String scratchLocation = sshAccountProvisioner.getScratchLocation(userId);
         try {
             SSHUtil.execute(sshHostname, sshPort, username, sshCredential, "mkdir -p " + scratchLocation);
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/50d7bb6a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
index 395b622..6ad076d 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountProvisioner.java
@@ -50,17 +50,19 @@ public interface SSHAccountProvisioner {
      * unimplemented for this SSHAccountProvisioner.
      * @param userId the Airavata user id
      * @param sshPublicKey the public key part of an Airavata managed SSH credential
+     * @return username
      * @throws InvalidUsernameException
      */
-    void createAccount(String userId, String sshPublicKey) throws InvalidUsernameException;
+    String createAccount(String userId, String sshPublicKey) throws InvalidUsernameException;
 
     /**
      * Install an SSH key for the user on the compute host.
      * @param userId the Airavata user id
      * @param sshPublicKey the public key part of an Airavata managed SSH credential
+     * @return username
      * @throws InvalidUsernameException
      */
-    void installSSHKey(String userId, String sshPublicKey) throws InvalidUsernameException;
+    String installSSHKey(String userId, String sshPublicKey) throws InvalidUsernameException;
 
     /**
      * Get the scratch location that should be created for the user. Note: this method doesn't create the scratch

http://git-wip-us.apache.org/repos/asf/airavata/blob/50d7bb6a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
index 69ed3f6..8e717c3 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/provisioner/IULdapSSHAccountProvisioner.java
@@ -76,13 +76,13 @@ public class IULdapSSHAccountProvisioner implements SSHAccountProvisioner  {
     }
 
     @Override
-    public void createAccount(String userId, String sshPublicKey) throws InvalidUsernameException {
+    public String createAccount(String userId, String sshPublicKey) throws InvalidUsernameException {
 
         throw new UnsupportedOperationException("IULdapSSHAccountProvisioner does not support creating cluster accounts at this time.");
     }
 
     @Override
-    public void installSSHKey(String userId, String sshPublicKey) throws InvalidUsernameException {
+    public String installSSHKey(String userId, String sshPublicKey) throws InvalidUsernameException {
         String username = getUsername(userId);
         boolean success = withLdapConnection(ldapConnection -> {
             try {
@@ -127,6 +127,7 @@ public class IULdapSSHAccountProvisioner implements SSHAccountProvisioner  {
                 throw new RuntimeException(e);
             }
         });
+        return username;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/airavata/blob/50d7bb6a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
index f4f9958..4cdcbd6 100644
--- a/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
+++ b/modules/compute-account-provisioning/src/test/java/org/apache/airavata/accountprovisioning/provisioner/TestSSHAccountProvisioner.java
@@ -42,13 +42,15 @@ public class TestSSHAccountProvisioner implements SSHAccountProvisioner {
     }
 
     @Override
-    public void createAccount(String userId, String sshPublicKey) throws InvalidUsernameException {
+    public String createAccount(String userId, String sshPublicKey) throws InvalidUsernameException {
 
+        return userId;
     }
 
     @Override
-    public void installSSHKey(String userId, String sshPublicKey) throws InvalidUsernameException {
+    public String installSSHKey(String userId, String sshPublicKey) throws InvalidUsernameException {
 
+        return userId;
     }
 
     @Override


[6/8] airavata git commit: AIRAVATA-2500 fixing order of arguments

Posted by ma...@apache.org.
AIRAVATA-2500 fixing order of arguments


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/29fedaf5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/29fedaf5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/29fedaf5

Branch: refs/heads/AIRAVATA-2500
Commit: 29fedaf52435c5ab97b524298bfa52a476fd80ce
Parents: e5dcade
Author: Marcus Christie <ma...@apache.org>
Authored: Mon Sep 25 10:33:24 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Mon Sep 25 10:33:24 2017 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/airavata/accountprovisioning/SSHUtil.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/29fedaf5/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHUtil.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHUtil.java b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHUtil.java
index 4ac60bf..f823648 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHUtil.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHUtil.java
@@ -148,7 +148,7 @@ public class SSHUtil {
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
-        boolean result = validate(username, hostname, 22, sshCredential);
+        boolean result = validate(hostname, 22, username, sshCredential);
         System.out.println(result);
     }
 }


[4/8] airavata git commit: AIRAVATA-2500 Thrift stub code generation

Posted by ma...@apache.org.
AIRAVATA-2500 Thrift stub code generation


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/e5dcade0
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/e5dcade0
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/e5dcade0

Branch: refs/heads/AIRAVATA-2500
Commit: e5dcade08f7a91bf7bd135647358202475f37620
Parents: 20fc3fd
Author: Marcus Christie <ma...@apache.org>
Authored: Mon Sep 25 09:45:47 2017 -0400
Committer: Marcus Christie <ma...@apache.org>
Committed: Mon Sep 25 09:57:28 2017 -0400

----------------------------------------------------------------------
 .../resources/lib/Airavata/API/Airavata.php     |  10 ++
 .../AppCatalog/UserResourceProfile/Types.php    |  28 +++++
 .../UserComputeResourcePreference.java          | 114 ++++++++++++++++++-
 3 files changed, 148 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e5dcade0/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index c8976ba..a22ef84 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -3485,6 +3485,11 @@ interface AiravataIf {
    *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
    *   default credential store.
    * 
+   * validated:
+   *  If true the the configuration has been validated in the sense that the username and credential can be used to
+   *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+   *  Should be treated as read-only and only mutated by Airavata middleware.
+   * 
    * 
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException
@@ -3717,6 +3722,11 @@ interface AiravataIf {
    *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
    *   default credential store.
    * 
+   * validated:
+   *  If true the the configuration has been validated in the sense that the username and credential can be used to
+   *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+   *  Should be treated as read-only and only mutated by Airavata middleware.
+   * 
    * 
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\AiravataClientException

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5dcade0/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
index 8ab78a0..c4a0a9c 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/AppCatalog/UserResourceProfile/Types.php
@@ -43,6 +43,11 @@ use Thrift\Exception\TApplicationException;
  *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
  *   default credential store.
  * 
+ * validated:
+ *  If true the the configuration has been validated in the sense that the username and credential can be used to
+ *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+ *  Should be treated as read-only and only mutated by Airavata middleware.
+ * 
  */
 class UserComputeResourcePreference {
   static $_TSPEC;
@@ -87,6 +92,10 @@ class UserComputeResourcePreference {
    * @var int
    */
   public $reservationEndTime = null;
+  /**
+   * @var bool
+   */
+  public $validated = false;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -131,6 +140,10 @@ class UserComputeResourcePreference {
           'var' => 'reservationEndTime',
           'type' => TType::I64,
           ),
+        11 => array(
+          'var' => 'validated',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -164,6 +177,9 @@ class UserComputeResourcePreference {
       if (isset($vals['reservationEndTime'])) {
         $this->reservationEndTime = $vals['reservationEndTime'];
       }
+      if (isset($vals['validated'])) {
+        $this->validated = $vals['validated'];
+      }
     }
   }
 
@@ -256,6 +272,13 @@ class UserComputeResourcePreference {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 11:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->validated);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -319,6 +342,11 @@ class UserComputeResourcePreference {
       $xfer += $output->writeI64($this->reservationEndTime);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->validated !== null) {
+      $xfer += $output->writeFieldBegin('validated', TType::BOOL, 11);
+      $xfer += $output->writeBool($this->validated);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5dcade0/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java
index 276b7ca..674b5c3 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/userresourceprofile/UserComputeResourcePreference.java
@@ -77,6 +77,11 @@ import org.slf4j.LoggerFactory;
  *  Resource specific credential store token. If this token is specified, then it is superceeded by the gateway's
  *   default credential store.
  * 
+ * validated:
+ *  If true the the configuration has been validated in the sense that the username and credential can be used to
+ *  login to the remote host and the scratchLocation is a valid location that the user has permission to write to.
+ *  Should be treated as read-only and only mutated by Airavata middleware.
+ * 
  */
 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
 public class UserComputeResourcePreference implements org.apache.thrift.TBase<UserComputeResourcePreference, UserComputeResourcePreference._Fields>, java.io.Serializable, Cloneable, Comparable<UserComputeResourcePreference> {
@@ -92,6 +97,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
   private static final org.apache.thrift.protocol.TField RESERVATION_FIELD_DESC = new org.apache.thrift.protocol.TField("reservation", org.apache.thrift.protocol.TType.STRING, (short)8);
   private static final org.apache.thrift.protocol.TField RESERVATION_START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("reservationStartTime", org.apache.thrift.protocol.TType.I64, (short)9);
   private static final org.apache.thrift.protocol.TField RESERVATION_END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("reservationEndTime", org.apache.thrift.protocol.TType.I64, (short)10);
+  private static final org.apache.thrift.protocol.TField VALIDATED_FIELD_DESC = new org.apache.thrift.protocol.TField("validated", org.apache.thrift.protocol.TType.BOOL, (short)11);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -109,6 +115,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
   private String reservation; // optional
   private long reservationStartTime; // optional
   private long reservationEndTime; // optional
+  private boolean validated; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -121,7 +128,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
     QUALITY_OF_SERVICE((short)7, "qualityOfService"),
     RESERVATION((short)8, "reservation"),
     RESERVATION_START_TIME((short)9, "reservationStartTime"),
-    RESERVATION_END_TIME((short)10, "reservationEndTime");
+    RESERVATION_END_TIME((short)10, "reservationEndTime"),
+    VALIDATED((short)11, "validated");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -156,6 +164,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
           return RESERVATION_START_TIME;
         case 10: // RESERVATION_END_TIME
           return RESERVATION_END_TIME;
+        case 11: // VALIDATED
+          return VALIDATED;
         default:
           return null;
       }
@@ -198,8 +208,9 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
   // isset id assignments
   private static final int __RESERVATIONSTARTTIME_ISSET_ID = 0;
   private static final int __RESERVATIONENDTIME_ISSET_ID = 1;
+  private static final int __VALIDATED_ISSET_ID = 2;
   private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.LOGIN_USER_NAME,_Fields.PREFERRED_BATCH_QUEUE,_Fields.SCRATCH_LOCATION,_Fields.ALLOCATION_PROJECT_NUMBER,_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN,_Fields.QUALITY_OF_SERVICE,_Fields.RESERVATION,_Fields.RESERVATION_START_TIME,_Fields.RESERVATION_END_TIME};
+  private static final _Fields optionals[] = {_Fields.LOGIN_USER_NAME,_Fields.PREFERRED_BATCH_QUEUE,_Fields.SCRATCH_LOCATION,_Fields.ALLOCATION_PROJECT_NUMBER,_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN,_Fields.QUALITY_OF_SERVICE,_Fields.RESERVATION,_Fields.RESERVATION_START_TIME,_Fields.RESERVATION_END_TIME,_Fields.VALIDATED};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -223,11 +234,15 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.RESERVATION_END_TIME, new org.apache.thrift.meta_data.FieldMetaData("reservationEndTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.VALIDATED, new org.apache.thrift.meta_data.FieldMetaData("validated", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserComputeResourcePreference.class, metaDataMap);
   }
 
   public UserComputeResourcePreference() {
+    this.validated = false;
+
   }
 
   public UserComputeResourcePreference(
@@ -268,6 +283,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
     }
     this.reservationStartTime = other.reservationStartTime;
     this.reservationEndTime = other.reservationEndTime;
+    this.validated = other.validated;
   }
 
   public UserComputeResourcePreference deepCopy() {
@@ -288,6 +304,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
     this.reservationStartTime = 0;
     setReservationEndTimeIsSet(false);
     this.reservationEndTime = 0;
+    this.validated = false;
+
   }
 
   public String getComputeResourceId() {
@@ -518,6 +536,28 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESERVATIONENDTIME_ISSET_ID, value);
   }
 
+  public boolean isValidated() {
+    return this.validated;
+  }
+
+  public void setValidated(boolean validated) {
+    this.validated = validated;
+    setValidatedIsSet(true);
+  }
+
+  public void unsetValidated() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALIDATED_ISSET_ID);
+  }
+
+  /** Returns true if field validated is set (has been assigned a value) and false otherwise */
+  public boolean isSetValidated() {
+    return EncodingUtils.testBit(__isset_bitfield, __VALIDATED_ISSET_ID);
+  }
+
+  public void setValidatedIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALIDATED_ISSET_ID, value);
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case COMPUTE_RESOURCE_ID:
@@ -600,6 +640,14 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
       }
       break;
 
+    case VALIDATED:
+      if (value == null) {
+        unsetValidated();
+      } else {
+        setValidated((Boolean)value);
+      }
+      break;
+
     }
   }
 
@@ -635,6 +683,9 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
     case RESERVATION_END_TIME:
       return getReservationEndTime();
 
+    case VALIDATED:
+      return isValidated();
+
     }
     throw new IllegalStateException();
   }
@@ -666,6 +717,8 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
       return isSetReservationStartTime();
     case RESERVATION_END_TIME:
       return isSetReservationEndTime();
+    case VALIDATED:
+      return isSetValidated();
     }
     throw new IllegalStateException();
   }
@@ -773,6 +826,15 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
         return false;
     }
 
+    boolean this_present_validated = true && this.isSetValidated();
+    boolean that_present_validated = true && that.isSetValidated();
+    if (this_present_validated || that_present_validated) {
+      if (!(this_present_validated && that_present_validated))
+        return false;
+      if (this.validated != that.validated)
+        return false;
+    }
+
     return true;
   }
 
@@ -830,6 +892,11 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
     if (present_reservationEndTime)
       list.add(reservationEndTime);
 
+    boolean present_validated = true && (isSetValidated());
+    list.add(present_validated);
+    if (present_validated)
+      list.add(validated);
+
     return list.hashCode();
   }
 
@@ -941,6 +1008,16 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetValidated()).compareTo(other.isSetValidated());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetValidated()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validated, other.validated);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -1050,6 +1127,12 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
       sb.append(this.reservationEndTime);
       first = false;
     }
+    if (isSetValidated()) {
+      if (!first) sb.append(", ");
+      sb.append("validated:");
+      sb.append(this.validated);
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -1179,6 +1262,14 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 11: // VALIDATED
+            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+              struct.validated = iprot.readBool();
+              struct.setValidatedIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1256,6 +1347,11 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
         oprot.writeI64(struct.reservationEndTime);
         oprot.writeFieldEnd();
       }
+      if (struct.isSetValidated()) {
+        oprot.writeFieldBegin(VALIDATED_FIELD_DESC);
+        oprot.writeBool(struct.validated);
+        oprot.writeFieldEnd();
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1302,7 +1398,10 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
       if (struct.isSetReservationEndTime()) {
         optionals.set(8);
       }
-      oprot.writeBitSet(optionals, 9);
+      if (struct.isSetValidated()) {
+        optionals.set(9);
+      }
+      oprot.writeBitSet(optionals, 10);
       if (struct.isSetLoginUserName()) {
         oprot.writeString(struct.loginUserName);
       }
@@ -1330,6 +1429,9 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
       if (struct.isSetReservationEndTime()) {
         oprot.writeI64(struct.reservationEndTime);
       }
+      if (struct.isSetValidated()) {
+        oprot.writeBool(struct.validated);
+      }
     }
 
     @Override
@@ -1337,7 +1439,7 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
       TTupleProtocol iprot = (TTupleProtocol) prot;
       struct.computeResourceId = iprot.readString();
       struct.setComputeResourceIdIsSet(true);
-      BitSet incoming = iprot.readBitSet(9);
+      BitSet incoming = iprot.readBitSet(10);
       if (incoming.get(0)) {
         struct.loginUserName = iprot.readString();
         struct.setLoginUserNameIsSet(true);
@@ -1374,6 +1476,10 @@ public class UserComputeResourcePreference implements org.apache.thrift.TBase<Us
         struct.reservationEndTime = iprot.readI64();
         struct.setReservationEndTimeIsSet(true);
       }
+      if (incoming.get(9)) {
+        struct.validated = iprot.readBool();
+        struct.setValidatedIsSet(true);
+      }
     }
   }