airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: fixing bug
Date Mon, 02 May 2016 19:40:57 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 9f44797ca -> e3cdfd18a


fixing bug


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

Branch: refs/heads/develop
Commit: e3cdfd18a85521d48b88c2f5a8a6e3625e0783e1
Parents: 9f44797
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Mon May 2 15:40:53 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Mon May 2 15:40:53 2016 -0400

----------------------------------------------------------------------
 .../apache/airavata/api/server/AiravataAPIServer.java   | 12 ++++++++++++
 .../server/security/DefaultAiravataSecurityManager.java |  6 +++---
 .../api/server/security/interceptor/SecurityModule.java | 10 ++++++----
 3 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e3cdfd18/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
index 5df73dc..6c429d2 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
@@ -25,6 +25,8 @@ import com.google.inject.Guice;
 import com.google.inject.Injector;
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.server.handler.AiravataServerHandler;
+import org.apache.airavata.api.server.security.AiravataSecurityManager;
+import org.apache.airavata.api.server.security.SecurityManagerFactory;
 import org.apache.airavata.api.server.security.interceptor.SecurityModule;
 import org.apache.airavata.api.server.util.*;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
@@ -32,6 +34,7 @@ import org.apache.airavata.common.utils.IServer;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.model.error.AiravataErrorType;
 import org.apache.airavata.model.error.AiravataSystemException;
+import org.apache.airavata.security.AiravataSecurityException;
 import org.apache.thrift.server.TServer;
 import org.apache.thrift.server.TThreadPoolServer;
 import org.apache.thrift.transport.TSSLTransportFactory;
@@ -159,6 +162,12 @@ public class AiravataAPIServer implements IServer{
                 }.start();
                 logger.info("Airavata API server starter over TLS on Port: " + ServerSettings.getTLSServerPort());
             }
+
+            /*perform any security related initialization at the server startup, according
to the underlying security
+             manager implementation being used.*/
+			AiravataSecurityManager securityManager = SecurityManagerFactory.getSecurityManager();
+			securityManager.initializeSecurityInfra();
+
         } catch (TTransportException e) {
             logger.error(e.getMessage());
             setStatus(ServerStatus.FAILED);
@@ -170,6 +179,9 @@ public class AiravataAPIServer implements IServer{
         } catch (UnknownHostException e) {
             logger.error(e.getMessage(), e);
             throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+        } catch (AiravataSecurityException e) {
+            logger.error(e.getMessage(), e);
+            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
         }
     }
     public static void main(String[] args) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/e3cdfd18/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/DefaultAiravataSecurityManager.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/DefaultAiravataSecurityManager.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/DefaultAiravataSecurityManager.java
index 5482b76..2b8c501 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/DefaultAiravataSecurityManager.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/DefaultAiravataSecurityManager.java
@@ -84,7 +84,7 @@ public class DefaultAiravataSecurityManager implements AiravataSecurityManager
{
 
                 for(GatewayResourceProfile gwrp : gwProfiles){
                     if(gwrp.getIdentityServerPwdCredToken() != null && gwrp.getIdentityServerTenant()
!= null){
-                        PasswordCredential credential = csClient.getPasswordCredential(gwrp.getCredentialStoreToken(),
gwrp.getGatewayID());
+                        PasswordCredential credential = csClient.getPasswordCredential(gwrp.getIdentityServerPwdCredToken(),
gwrp.getGatewayID());
                         String username = credential.getLoginUserName();
                         if(gwrp.getIdentityServerTenant() != null && !gwrp.getIdentityServerTenant().isEmpty())
                             username = username + "@" + gwrp.getIdentityServerTenant();
@@ -155,7 +155,7 @@ public class DefaultAiravataSecurityManager implements AiravataSecurityManager
{
                     CredentialStoreService.Client csClient = getCredentialStoreServiceClient();
                     AppCatalog appCatalog = RegistryFactory.getAppCatalog();
                     GatewayResourceProfile gwrp = appCatalog.getGatewayProfile().getGatewayProfile(gatewayId);
-                    PasswordCredential credential = csClient.getPasswordCredential(gwrp.getCredentialStoreToken(),
gwrp.getGatewayID());
+                    PasswordCredential credential = csClient.getPasswordCredential(gwrp.getIdentityServerPwdCredToken(),
gwrp.getGatewayID());
                     String username = credential.getLoginUserName();
                     if(gwrp.getIdentityServerTenant() != null && !gwrp.getIdentityServerTenant().isEmpty())
                         username = username + "@" + gwrp.getIdentityServerTenant();
@@ -197,7 +197,7 @@ public class DefaultAiravataSecurityManager implements AiravataSecurityManager
{
                 CredentialStoreService.Client csClient = getCredentialStoreServiceClient();
                 AppCatalog appCatalog = RegistryFactory.getAppCatalog();
                 GatewayResourceProfile gwrp = appCatalog.getGatewayProfile().getGatewayProfile(gatewayId);
-                PasswordCredential credential = csClient.getPasswordCredential(gwrp.getCredentialStoreToken(),
gwrp.getGatewayID());
+                PasswordCredential credential = csClient.getPasswordCredential(gwrp.getIdentityServerPwdCredToken(),
gwrp.getGatewayID());
                 String username = credential.getLoginUserName();
                 if(gwrp.getIdentityServerTenant() != null && !gwrp.getIdentityServerTenant().isEmpty())
                     username = username + "@" + gwrp.getIdentityServerTenant();

http://git-wip-us.apache.org/repos/asf/airavata/blob/e3cdfd18/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/interceptor/SecurityModule.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/interceptor/SecurityModule.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/interceptor/SecurityModule.java
index f30dc9b..92ca167 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/interceptor/SecurityModule.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/security/interceptor/SecurityModule.java
@@ -20,18 +20,20 @@
  */
 package org.apache.airavata.api.server.security.interceptor;
 
-import com.google.inject.matcher.Matchers;
 import com.google.inject.AbstractModule;
-import org.apache.airavata.api.server.security.interceptor.SecurityCheck;
-import org.apache.airavata.api.server.security.interceptor.SecurityInterceptor;
+import com.google.inject.matcher.Matchers;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This does the plumbing work of integrating the interceptor with Guice framework for the
methods to be
  * intercepted upon their invocation.
  */
 public class SecurityModule extends AbstractModule {
+    private final static Logger logger = LoggerFactory.getLogger(SecurityModule.class);
+
     public void configure(){
-        System.out.println("Security module reached...");
+        logger.info("Security module reached...");
         SecurityInterceptor interceptor = new SecurityInterceptor();
         //requestInjection(interceptor);
 


Mime
View raw message