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 2018/10/01 15:05:34 UTC

[airavata] branch develop updated: AIRAVATA-2865 Add defaultCredentialStoreToken to GroupResourceProfile

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9ab9644  AIRAVATA-2865 Add defaultCredentialStoreToken to GroupResourceProfile
9ab9644 is described below

commit 9ab9644e17831b1334216da350b02b526b56fe34
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Oct 1 11:04:36 2018 -0400

    AIRAVATA-2865 Add defaultCredentialStoreToken to GroupResourceProfile
---
 .../api/server/handler/AiravataServerHandler.java  |   3 +
 .../appcatalog/groupresourceprofile/ttypes.py      |  16 ++-
 .../groupresourceprofile/GroupResourceProfile.java | 115 ++++++++++++++++++++-
 .../appcatalog/GroupResourceProfileEntity.java     |  11 ++
 .../src/main/resources/appcatalog-derby.sql        |   1 +
 .../src/main/resources/appcatalog-mysql.sql        |   1 +
 .../GroupResourceProfileRepositoryTest.java        |   3 +
 .../src/test/resources/appcatalog-derby.sql        |   1 +
 .../group_resource_profile_model.thrift            |   5 +-
 9 files changed, 150 insertions(+), 6 deletions(-)

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 b883acd..1cafbd1 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
@@ -5397,6 +5397,9 @@ public class AiravataServerHandler implements Airavata.Iface {
                 }
             }
         }
+        if (groupResourceProfile.getDefaultCredentialStoreToken() != null) {
+            tokenIds.add(groupResourceProfile.getDefaultCredentialStoreToken());
+        }
         for (String tokenId : tokenIds) {
             if (!userHasAccessInternal(sharingClient, authzToken, tokenId, ResourcePermissionType.READ)) {
                 throw new AuthorizationException("User does not have permission to a credential token in this resource.");
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
index f757db1..e2841da 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/airavata/model/appcatalog/groupresourceprofile/ttypes.py
@@ -663,6 +663,8 @@ class GroupResourceProfile(object):
     batchQueueResourcePolicies:
      List of enforced policies on registered batch queues
 
+    defaultCredentialStoreToken:
+     The default credential store token to use for compute resources that don't specify a resource specific credential store token.
 
 
     Attributes:
@@ -674,6 +676,7 @@ class GroupResourceProfile(object):
      - batchQueueResourcePolicies
      - creationTime
      - updatedTime
+     - defaultCredentialStoreToken
     """
 
     thrift_spec = (
@@ -686,9 +689,10 @@ class GroupResourceProfile(object):
         (6, TType.LIST, 'batchQueueResourcePolicies', (TType.STRUCT, (BatchQueueResourcePolicy, BatchQueueResourcePolicy.thrift_spec), False), None, ),  # 6
         (7, TType.I64, 'creationTime', None, None, ),  # 7
         (8, TType.I64, 'updatedTime', None, None, ),  # 8
+        (9, TType.STRING, 'defaultCredentialStoreToken', 'UTF8', None, ),  # 9
     )
 
-    def __init__(self, gatewayId=None, groupResourceProfileId=thrift_spec[2][4], groupResourceProfileName=None, computePreferences=None, computeResourcePolicies=None, batchQueueResourcePolicies=None, creationTime=None, updatedTime=None,):
+    def __init__(self, gatewayId=None, groupResourceProfileId=thrift_spec[2][4], groupResourceProfileName=None, computePreferences=None, computeResourcePolicies=None, batchQueueResourcePolicies=None, creationTime=None, updatedTime=None, defaultCredentialStoreToken=None,):
         self.gatewayId = gatewayId
         self.groupResourceProfileId = groupResourceProfileId
         self.groupResourceProfileName = groupResourceProfileName
@@ -697,6 +701,7 @@ class GroupResourceProfile(object):
         self.batchQueueResourcePolicies = batchQueueResourcePolicies
         self.creationTime = creationTime
         self.updatedTime = updatedTime
+        self.defaultCredentialStoreToken = defaultCredentialStoreToken
 
     def read(self, iprot):
         if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -765,6 +770,11 @@ class GroupResourceProfile(object):
                     self.updatedTime = iprot.readI64()
                 else:
                     iprot.skip(ftype)
+            elif fid == 9:
+                if ftype == TType.STRING:
+                    self.defaultCredentialStoreToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+                else:
+                    iprot.skip(ftype)
             else:
                 iprot.skip(ftype)
             iprot.readFieldEnd()
@@ -816,6 +826,10 @@ class GroupResourceProfile(object):
             oprot.writeFieldBegin('updatedTime', TType.I64, 8)
             oprot.writeI64(self.updatedTime)
             oprot.writeFieldEnd()
+        if self.defaultCredentialStoreToken is not None:
+            oprot.writeFieldBegin('defaultCredentialStoreToken', TType.STRING, 9)
+            oprot.writeString(self.defaultCredentialStoreToken.encode('utf-8') if sys.version_info[0] == 2 else self.defaultCredentialStoreToken)
+            oprot.writeFieldEnd()
         oprot.writeFieldStop()
         oprot.writeStructEnd()
 
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
index f3dcd7e..e9eef80 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupResourceProfile.java
@@ -41,6 +41,8 @@ package org.apache.airavata.model.appcatalog.groupresourceprofile;
  * batchQueueResourcePolicies:
  *  List of enforced policies on registered batch queues
  * 
+ * defaultCredentialStoreToken:
+ *  The default credential store token to use for compute resources that don't specify a resource specific credential store token.
  * 
  */
 @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
@@ -55,6 +57,7 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
   private static final org.apache.thrift.protocol.TField BATCH_QUEUE_RESOURCE_POLICIES_FIELD_DESC = new org.apache.thrift.protocol.TField("batchQueueResourcePolicies", org.apache.thrift.protocol.TType.LIST, (short)6);
   private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)7);
   private static final org.apache.thrift.protocol.TField UPDATED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedTime", org.apache.thrift.protocol.TType.I64, (short)8);
+  private static final org.apache.thrift.protocol.TField DEFAULT_CREDENTIAL_STORE_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultCredentialStoreToken", org.apache.thrift.protocol.TType.STRING, (short)9);
 
   private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GroupResourceProfileStandardSchemeFactory();
   private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GroupResourceProfileTupleSchemeFactory();
@@ -67,6 +70,7 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
   private java.util.List<BatchQueueResourcePolicy> batchQueueResourcePolicies; // optional
   private long creationTime; // optional
   private long updatedTime; // optional
+  private java.lang.String defaultCredentialStoreToken; // 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 {
@@ -77,7 +81,8 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
     COMPUTE_RESOURCE_POLICIES((short)5, "computeResourcePolicies"),
     BATCH_QUEUE_RESOURCE_POLICIES((short)6, "batchQueueResourcePolicies"),
     CREATION_TIME((short)7, "creationTime"),
-    UPDATED_TIME((short)8, "updatedTime");
+    UPDATED_TIME((short)8, "updatedTime"),
+    DEFAULT_CREDENTIAL_STORE_TOKEN((short)9, "defaultCredentialStoreToken");
 
     private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
@@ -108,6 +113,8 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
           return CREATION_TIME;
         case 8: // UPDATED_TIME
           return UPDATED_TIME;
+        case 9: // DEFAULT_CREDENTIAL_STORE_TOKEN
+          return DEFAULT_CREDENTIAL_STORE_TOKEN;
         default:
           return null;
       }
@@ -151,7 +158,7 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
   private static final int __CREATIONTIME_ISSET_ID = 0;
   private static final int __UPDATEDTIME_ISSET_ID = 1;
   private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.GROUP_RESOURCE_PROFILE_NAME,_Fields.COMPUTE_PREFERENCES,_Fields.COMPUTE_RESOURCE_POLICIES,_Fields.BATCH_QUEUE_RESOURCE_POLICIES,_Fields.CREATION_TIME,_Fields.UPDATED_TIME};
+  private static final _Fields optionals[] = {_Fields.GROUP_RESOURCE_PROFILE_NAME,_Fields.COMPUTE_PREFERENCES,_Fields.COMPUTE_RESOURCE_POLICIES,_Fields.BATCH_QUEUE_RESOURCE_POLICIES,_Fields.CREATION_TIME,_Fields.UPDATED_TIME,_Fields.DEFAULT_CREDENTIAL_STORE_TOKEN};
   public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -174,6 +181,8 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.UPDATED_TIME, new org.apache.thrift.meta_data.FieldMetaData("updatedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.DEFAULT_CREDENTIAL_STORE_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("defaultCredentialStoreToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GroupResourceProfile.class, metaDataMap);
   }
@@ -229,6 +238,9 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
     }
     this.creationTime = other.creationTime;
     this.updatedTime = other.updatedTime;
+    if (other.isSetDefaultCredentialStoreToken()) {
+      this.defaultCredentialStoreToken = other.defaultCredentialStoreToken;
+    }
   }
 
   public GroupResourceProfile deepCopy() {
@@ -248,6 +260,7 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
     this.creationTime = 0;
     setUpdatedTimeIsSet(false);
     this.updatedTime = 0;
+    this.defaultCredentialStoreToken = null;
   }
 
   public java.lang.String getGatewayId() {
@@ -477,6 +490,29 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
     __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATEDTIME_ISSET_ID, value);
   }
 
+  public java.lang.String getDefaultCredentialStoreToken() {
+    return this.defaultCredentialStoreToken;
+  }
+
+  public void setDefaultCredentialStoreToken(java.lang.String defaultCredentialStoreToken) {
+    this.defaultCredentialStoreToken = defaultCredentialStoreToken;
+  }
+
+  public void unsetDefaultCredentialStoreToken() {
+    this.defaultCredentialStoreToken = null;
+  }
+
+  /** Returns true if field defaultCredentialStoreToken is set (has been assigned a value) and false otherwise */
+  public boolean isSetDefaultCredentialStoreToken() {
+    return this.defaultCredentialStoreToken != null;
+  }
+
+  public void setDefaultCredentialStoreTokenIsSet(boolean value) {
+    if (!value) {
+      this.defaultCredentialStoreToken = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, java.lang.Object value) {
     switch (field) {
     case GATEWAY_ID:
@@ -543,6 +579,14 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
       }
       break;
 
+    case DEFAULT_CREDENTIAL_STORE_TOKEN:
+      if (value == null) {
+        unsetDefaultCredentialStoreToken();
+      } else {
+        setDefaultCredentialStoreToken((java.lang.String)value);
+      }
+      break;
+
     }
   }
 
@@ -572,6 +616,9 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
     case UPDATED_TIME:
       return getUpdatedTime();
 
+    case DEFAULT_CREDENTIAL_STORE_TOKEN:
+      return getDefaultCredentialStoreToken();
+
     }
     throw new java.lang.IllegalStateException();
   }
@@ -599,6 +646,8 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
       return isSetCreationTime();
     case UPDATED_TIME:
       return isSetUpdatedTime();
+    case DEFAULT_CREDENTIAL_STORE_TOKEN:
+      return isSetDefaultCredentialStoreToken();
     }
     throw new java.lang.IllegalStateException();
   }
@@ -690,6 +739,15 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
         return false;
     }
 
+    boolean this_present_defaultCredentialStoreToken = true && this.isSetDefaultCredentialStoreToken();
+    boolean that_present_defaultCredentialStoreToken = true && that.isSetDefaultCredentialStoreToken();
+    if (this_present_defaultCredentialStoreToken || that_present_defaultCredentialStoreToken) {
+      if (!(this_present_defaultCredentialStoreToken && that_present_defaultCredentialStoreToken))
+        return false;
+      if (!this.defaultCredentialStoreToken.equals(that.defaultCredentialStoreToken))
+        return false;
+    }
+
     return true;
   }
 
@@ -729,6 +787,10 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
     if (isSetUpdatedTime())
       hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(updatedTime);
 
+    hashCode = hashCode * 8191 + ((isSetDefaultCredentialStoreToken()) ? 131071 : 524287);
+    if (isSetDefaultCredentialStoreToken())
+      hashCode = hashCode * 8191 + defaultCredentialStoreToken.hashCode();
+
     return hashCode;
   }
 
@@ -820,6 +882,16 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
         return lastComparison;
       }
     }
+    lastComparison = java.lang.Boolean.valueOf(isSetDefaultCredentialStoreToken()).compareTo(other.isSetDefaultCredentialStoreToken());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDefaultCredentialStoreToken()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defaultCredentialStoreToken, other.defaultCredentialStoreToken);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -907,6 +979,16 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
       sb.append(this.updatedTime);
       first = false;
     }
+    if (isSetDefaultCredentialStoreToken()) {
+      if (!first) sb.append(", ");
+      sb.append("defaultCredentialStoreToken:");
+      if (this.defaultCredentialStoreToken == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.defaultCredentialStoreToken);
+      }
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -1057,6 +1139,14 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 9: // DEFAULT_CREDENTIAL_STORE_TOKEN
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.defaultCredentialStoreToken = iprot.readString();
+              struct.setDefaultCredentialStoreTokenIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1139,6 +1229,13 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
         oprot.writeI64(struct.updatedTime);
         oprot.writeFieldEnd();
       }
+      if (struct.defaultCredentialStoreToken != null) {
+        if (struct.isSetDefaultCredentialStoreToken()) {
+          oprot.writeFieldBegin(DEFAULT_CREDENTIAL_STORE_TOKEN_FIELD_DESC);
+          oprot.writeString(struct.defaultCredentialStoreToken);
+          oprot.writeFieldEnd();
+        }
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1177,7 +1274,10 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
       if (struct.isSetUpdatedTime()) {
         optionals.set(5);
       }
-      oprot.writeBitSet(optionals, 6);
+      if (struct.isSetDefaultCredentialStoreToken()) {
+        optionals.set(6);
+      }
+      oprot.writeBitSet(optionals, 7);
       if (struct.isSetGroupResourceProfileName()) {
         oprot.writeString(struct.groupResourceProfileName);
       }
@@ -1214,6 +1314,9 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
       if (struct.isSetUpdatedTime()) {
         oprot.writeI64(struct.updatedTime);
       }
+      if (struct.isSetDefaultCredentialStoreToken()) {
+        oprot.writeString(struct.defaultCredentialStoreToken);
+      }
     }
 
     @Override
@@ -1223,7 +1326,7 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
       struct.setGatewayIdIsSet(true);
       struct.groupResourceProfileId = iprot.readString();
       struct.setGroupResourceProfileIdIsSet(true);
-      java.util.BitSet incoming = iprot.readBitSet(6);
+      java.util.BitSet incoming = iprot.readBitSet(7);
       if (incoming.get(0)) {
         struct.groupResourceProfileName = iprot.readString();
         struct.setGroupResourceProfileNameIsSet(true);
@@ -1278,6 +1381,10 @@ public class GroupResourceProfile implements org.apache.thrift.TBase<GroupResour
         struct.updatedTime = iprot.readI64();
         struct.setUpdatedTimeIsSet(true);
       }
+      if (incoming.get(6)) {
+        struct.defaultCredentialStoreToken = iprot.readString();
+        struct.setDefaultCredentialStoreTokenIsSet(true);
+      }
     }
   }
 
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfileEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfileEntity.java
index 35e0734..3add1b1 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfileEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfileEntity.java
@@ -49,6 +49,9 @@ public class GroupResourceProfileEntity implements Serializable {
     @Column(name = "UPDATE_TIME")
     private Long updatedTime;
 
+    @Column(name = "DEFAULT_CREDENTIAL_STORE_TOKEN")
+    private String defaultCredentialStoreToken;
+
     @OneToMany(targetEntity = GroupComputeResourcePrefEntity.class, cascade = CascadeType.ALL,
             mappedBy = "groupResourceProfile", fetch = FetchType.EAGER)
     private List<GroupComputeResourcePrefEntity> computePreferences;
@@ -104,6 +107,14 @@ public class GroupResourceProfileEntity implements Serializable {
         this.updatedTime = updatedTime;
     }
 
+    public String getDefaultCredentialStoreToken() {
+        return defaultCredentialStoreToken;
+    }
+
+    public void setDefaultCredentialStoreToken(String defaultCredentialStoreToken) {
+        this.defaultCredentialStoreToken = defaultCredentialStoreToken;
+    }
+
     public List<GroupComputeResourcePrefEntity> getComputePreferences() {
         return computePreferences;
     }
diff --git a/modules/registry-refactoring/src/main/resources/appcatalog-derby.sql b/modules/registry-refactoring/src/main/resources/appcatalog-derby.sql
index 0fbc682..bda7c88 100644
--- a/modules/registry-refactoring/src/main/resources/appcatalog-derby.sql
+++ b/modules/registry-refactoring/src/main/resources/appcatalog-derby.sql
@@ -576,6 +576,7 @@ CREATE TABLE GROUP_RESOURCE_PROFILE (
   GROUP_RESOURCE_PROFILE_NAME varchar(255) DEFAULT NULL,
   CREATION_TIME BIGINT NOT NULL,
   UPDATE_TIME BIGINT NOT NULL,
+  DEFAULT_CREDENTIAL_STORE_TOKEN varchar(255) DEFAULT NULL,
   PRIMARY KEY (GROUP_RESOURCE_PROFILE_ID),
   UNIQUE (GATEWAY_ID, GROUP_RESOURCE_PROFILE_NAME)
 );
diff --git a/modules/registry-refactoring/src/main/resources/appcatalog-mysql.sql b/modules/registry-refactoring/src/main/resources/appcatalog-mysql.sql
index 22cf506..86f1f7b 100644
--- a/modules/registry-refactoring/src/main/resources/appcatalog-mysql.sql
+++ b/modules/registry-refactoring/src/main/resources/appcatalog-mysql.sql
@@ -575,6 +575,7 @@ CREATE TABLE GROUP_RESOURCE_PROFILE (
   GROUP_RESOURCE_PROFILE_NAME varchar(255) DEFAULT NULL,
   CREATION_TIME BIGINT NOT NULL,
   UPDATE_TIME BIGINT NOT NULL,
+  DEFAULT_CREDENTIAL_STORE_TOKEN varchar(255) DEFAULT NULL,
   PRIMARY KEY (GROUP_RESOURCE_PROFILE_ID),
   UNIQUE (GATEWAY_ID, GROUP_RESOURCE_PROFILE_NAME)
 )ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
index 80cff5d..3815dad 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
@@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory;
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 public class GroupResourceProfileRepositoryTest extends TestBase {
@@ -110,6 +111,7 @@ public class GroupResourceProfileRepositoryTest extends TestBase {
         GroupResourceProfile groupResourceProfile = new GroupResourceProfile();
         groupResourceProfile.setGatewayId(gatewayId);
         groupResourceProfile.setGroupResourceProfileName("TEST_GROUP_PROFILE_NAME");
+        groupResourceProfile.setDefaultCredentialStoreToken("test-cred-store-token");
 
         GroupAccountSSHProvisionerConfig groupAccountSSHProvisionerConfig = new GroupAccountSSHProvisionerConfig();
         groupAccountSSHProvisionerConfig.setResourceId(resourceId1);
@@ -170,6 +172,7 @@ public class GroupResourceProfileRepositoryTest extends TestBase {
 
             assertTrue(getGroupResourceProfile.getGatewayId().equals(gatewayId));
             assertTrue(getGroupResourceProfile.getGroupResourceProfileId().equals(groupResourceProfileId));
+            assertEquals("test-cred-store-token", getGroupResourceProfile.getDefaultCredentialStoreToken());
 
             assertTrue(getGroupResourceProfile.getComputePreferences().size() == 2);
             assertTrue(getGroupResourceProfile.getComputeResourcePolicies().size() == 2);
diff --git a/modules/registry-refactoring/src/test/resources/appcatalog-derby.sql b/modules/registry-refactoring/src/test/resources/appcatalog-derby.sql
index d37dd61..792f1e1 100644
--- a/modules/registry-refactoring/src/test/resources/appcatalog-derby.sql
+++ b/modules/registry-refactoring/src/test/resources/appcatalog-derby.sql
@@ -582,6 +582,7 @@ CREATE TABLE GROUP_RESOURCE_PROFILE (
   GROUP_RESOURCE_PROFILE_NAME varchar(255) DEFAULT NULL,
   CREATION_TIME BIGINT NOT NULL,
   UPDATE_TIME BIGINT NOT NULL,
+  DEFAULT_CREDENTIAL_STORE_TOKEN varchar(255) DEFAULT NULL,
   PRIMARY KEY (GROUP_RESOURCE_PROFILE_ID),
   UNIQUE (GATEWAY_ID, GROUP_RESOURCE_PROFILE_NAME)
 );
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift b/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
index 5106ebc..0f4b950 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/group_resource_profile_model.thrift
@@ -89,6 +89,8 @@ struct BatchQueueResourcePolicy {
  * batchQueueResourcePolicies:
  *  List of enforced policies on registered batch queues
  *
+ * defaultCredentialStoreToken:
+ *  The default credential store token to use for compute resources that don't specify a resource specific credential store token.
  *
 */
 
@@ -100,5 +102,6 @@ struct GroupResourceProfile {
     5: optional list<ComputeResourcePolicy> computeResourcePolicies,
     6: optional list<BatchQueueResourcePolicy> batchQueueResourcePolicies
     7: optional i64 creationTime,
-    8: optional i64 updatedTime
+    8: optional i64 updatedTime,
+    9: optional string defaultCredentialStoreToken
 }
\ No newline at end of file