airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] branch group-based-auth updated: AIRAVATA-2781 Allow users to call userHasAccess
Date Tue, 05 Jun 2018 16:57:46 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/group-based-auth by this push:
     new 21fc75e  AIRAVATA-2781 Allow users to call userHasAccess
21fc75e is described below

commit 21fc75ec27051d83feb006a3a1c61e0c01b849bb
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Tue Jun 5 12:56:48 2018 -0400

    AIRAVATA-2781 Allow users to call userHasAccess
---
 .../airavata/service/security/KeyCloakSecurityManager.java     |  2 +-
 .../airavata/service/security/KeyCloakSecurityManagerTest.java | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/airavata-services/services-security/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
b/airavata-services/services-security/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
index ed80830..fbea9d9 100644
--- a/airavata-services/services-security/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
+++ b/airavata-services/services-security/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
@@ -72,7 +72,7 @@ public class KeyCloakSecurityManager implements AiravataSecurityManager
{
             "|/airavata/deleteUserComputeResourcePreference|/airavata/deleteUserStoragePreference"
+
             "|/airavata/generateAndRegisterSSHKeys|/airavata/getAllCredentialSummaryForUsersInGateway"
+
             "|/airavata/deleteSSHPubKey";
-    private final static String SHARING_RESOURCE_METHODS = "/airavata/shareResourceWithUsers|/airavata/revokeSharingOfResourceFromUsers|/airavata/getAllAccessibleUsers";
+    private final static String SHARING_RESOURCE_METHODS = "/airavata/shareResourceWithUsers|/airavata/revokeSharingOfResourceFromUsers|/airavata/getAllAccessibleUsers|/airavata/userHasAccess";
     private final static String SSH_ACCOUNT_PROVISIONER_METHODS =
             "/airavata/getSSHAccountProvisioners|/airavata/doesUserHaveSSHAccount|/airavata"
+
                     "/setupUserComputeResourcePreferencesForSSH|" +
diff --git a/airavata-services/services-security/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
b/airavata-services/services-security/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
index a7732bf..b22ba0c 100644
--- a/airavata-services/services-security/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
+++ b/airavata-services/services-security/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
@@ -107,6 +107,16 @@ public class KeyCloakSecurityManagerTest {
     }
 
     @Test
+    public void testAllowedGatewayUserMethod2(@Mocked URL anyURL, @Mocked HttpURLConnection
openidConfigHttpURLConnection, @Mocked HttpURLConnection userinfoHttpURLConnection) throws
AiravataSecurityException, ApplicationSettingsException, IOException, TException {
+
+        createExpectationsForTokenVerification(openidConfigHttpURLConnection, userinfoHttpURLConnection);
+        createExpectationsForAuthzCacheDisabled();
+        createExpectationsForGatewayGroupsMembership(false, false);
+
+        runIsUserAuthorizedTest("userHasAccess", true);
+    }
+
+    @Test
     public void testAllowedAdminUserMethod(@Mocked URL anyURL, @Mocked HttpURLConnection
openidConfigHttpURLConnection, @Mocked HttpURLConnection userinfoHttpURLConnection) throws
AiravataSecurityException, ApplicationSettingsException, IOException, TException {
 
         createExpectationsForTokenVerification(openidConfigHttpURLConnection, userinfoHttpURLConnection);

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.

Mime
View raw message