airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: AIRAVATA-2232 Filter by CredentialOwnerType
Date Fri, 23 Dec 2016 20:32:18 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop f40972db8 -> 5c6b70b61


AIRAVATA-2232 Filter by CredentialOwnerType

Filtering by CredentialOwnerType in new SummaryType methods.


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

Branch: refs/heads/develop
Commit: 5c6b70b61fb834295ed8358335e6f790caa09ced
Parents: f40972d
Author: Marcus Christie <machrist@iu.edu>
Authored: Tue Dec 20 11:53:38 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Dec 23 15:32:11 2016 -0500

----------------------------------------------------------------------
 .../credential/store/server/CredentialStoreServerHandler.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/5c6b70b6/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
index c8d1cf0..974a7eb 100644
--- a/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
+++ b/modules/credential-store/credential-store-service/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -342,7 +342,8 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
                 List<Credential> allCredentials = credentialReader.getAllCredentialsPerGateway(gatewayId);
                 if (allCredentials != null && !allCredentials.isEmpty()){
                     for (Credential credential : allCredentials) {
-                        if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential)
{
+                        if (credential instanceof org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential
+                                && credential.getCredentialOwnerType() == CredentialOwnerType.GATEWAY)
{
                             org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential
sshCredential = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential) credential;
                             CredentialSummary sshCredentialSummary = new CredentialSummary();
                             sshCredentialSummary.setType(SummaryType.SSH);
@@ -380,7 +381,7 @@ public class CredentialStoreServerHandler implements CredentialStoreService.Ifac
                             String portalUserName = sshCredential.getPortalUserName();
                             String gateway = sshCredential.getGateway();
                             if (portalUserName != null && gateway != null){
-                                if (portalUserName.equals(userId) && gateway.equals(gatewayId))
{
+                                if (portalUserName.equals(userId) && gateway.equals(gatewayId)
&& sshCredential.getCredentialOwnerType() == CredentialOwnerType.USER) {
                                     org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential
sshCredentialKey = (org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential)
credential;
                                     CredentialSummary sshCredentialSummary = new CredentialSummary();
                                     sshCredentialSummary.setType(SummaryType.SSH);


Mime
View raw message