airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: fixing AIRAVATA-1555
Date Mon, 02 Feb 2015 15:50:49 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 3ad520553 -> f339c2eae


fixing AIRAVATA-1555


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

Branch: refs/heads/master
Commit: f339c2eae9c9545af27f1a28aac6c382fecf1908
Parents: 3ad5205
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Mon Feb 2 10:50:42 2015 -0500
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Mon Feb 2 10:50:42 2015 -0500

----------------------------------------------------------------------
 .../credential-store-webapp/pom.xml              |  6 +++++-
 .../servlet/CredentialStoreStartServlet.java     | 19 +++++++++++++++++++
 .../test/resources/credential-store/client.xml   |  4 ++--
 pom.xml                                          |  5 +++++
 4 files changed, 31 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f339c2ea/modules/credential-store-service/credential-store-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store-webapp/pom.xml b/modules/credential-store-service/credential-store-webapp/pom.xml
index d5a05ca..8122f9e 100644
--- a/modules/credential-store-service/credential-store-webapp/pom.xml
+++ b/modules/credential-store-service/credential-store-webapp/pom.xml
@@ -88,7 +88,11 @@
             <artifactId>airavata-credential-store</artifactId>
             <version>${project.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>net.oauth.core</groupId>
+            <artifactId>oauth-httpclient4</artifactId>
+            <version>20090617</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-security</artifactId>

http://git-wip-us.apache.org/repos/asf/airavata/blob/f339c2ea/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
index f5358b2..3b70242 100644
--- a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/servlet/CredentialStoreStartServlet.java
@@ -21,7 +21,9 @@
 
 package org.apache.airavata.credential.store.servlet;
 
+import edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment;
 import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPResponse;
+import edu.uiuc.ncsa.myproxy.oa4mp.client.OA4MPService;
 import edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.ClientServlet;
 import edu.uiuc.ncsa.security.servlet.JSPUtil;
 import org.apache.airavata.credential.store.store.CredentialStoreException;
@@ -35,6 +37,7 @@ import org.slf4j.LoggerFactory;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
@@ -49,6 +52,7 @@ public class CredentialStoreStartServlet extends ClientServlet {
     private static ConfigurationReader configurationReader = null;
 
     private static Logger log = LoggerFactory.getLogger(CredentialStoreStartServlet.class);
+    private OA4MPService oa4mpService;
 
     protected String decorateURI(URI inputURI, Map<String, String> parameters) {
 
@@ -91,6 +95,17 @@ public class CredentialStoreStartServlet extends ClientServlet {
     }
 
     @Override
+    public OA4MPService getOA4MPService() {
+        return oa4mpService;
+    }
+
+    @Override
+    public void loadEnvironment() throws IOException {
+        environment = getConfigurationLoader().load();
+        oa4mpService = new OA4MPService((ClientEnvironment) environment);
+    }
+
+    @Override
     protected void doIt(HttpServletRequest request, HttpServletResponse response) throws
Throwable {
 
         String gatewayName
@@ -130,6 +145,10 @@ public class CredentialStoreStartServlet extends ClientServlet {
 
         Map<String, String> additionalParameters = new HashMap<String, String>();
 
+        if (getOA4MPService() == null) {
+            loadEnvironment();
+        }
+
         String modifiedCallbackUri = decorateURI(getOA4MPService().getEnvironment().getCallback(),
queryParameters);
 
         info("The modified callback URI - " + modifiedCallbackUri);

http://git-wip-us.apache.org/repos/asf/airavata/blob/f339c2ea/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
b/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
index 53ba0ab..8b934e6 100644
--- a/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
+++ b/modules/credential-store-service/credential-store/src/test/resources/credential-store/client.xml
@@ -19,8 +19,8 @@
                 logFileCount="2"
                 debug="true"/>
         <id>myproxy:oa4mp,2012:/client/24c45c2eb65d93231d02d423e94d0362</id>
-        <serviceUri>https://portal.xsede.org/oauth</serviceUri>
-        <callbackUri>https://156.56.179.169:8443/airavata/callback</callbackUri>
+        <serviceUri>https://oa4mp.xsede.org/oauth</serviceUri>
+        <callbackUri>https://localhost:8443/airavata/callback</callbackUri>
         <lifetime>864000</lifetime>
         <publicKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-pubkey.pem</publicKeyFile>
         <privateKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-privkey.pk8</privateKeyFile>

http://git-wip-us.apache.org/repos/asf/airavata/blob/f339c2ea/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8e16e40..82ea635 100644
--- a/pom.xml
+++ b/pom.xml
@@ -431,6 +431,11 @@
 				<enabled>false</enabled>
 			</snapshots>
 		</repository>
+        <repository>
+            <id>oauth</id>
+            <name>OAuth Repository</name>
+            <url>http://oauth.googlecode.com/svn/code/maven</url>
+        </repository>
 	</repositories>
 
 	<profiles>


Mime
View raw message