airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1526315 - in /airavata/trunk: ./ modules/distribution/airavata-server/ modules/distribution/airavata-server/src/main/assembly/ modules/rest/webapp/ modules/rest/webapp/src/main/webapp/WEB-INF/ modules/server/ modules/server/src/main/java/o...
Date Wed, 25 Sep 2013 21:44:36 GMT
Author: chathuri
Date: Wed Sep 25 21:44:36 2013
New Revision: 1526315

URL: http://svn.apache.org/r1526315
Log:
committing viknesh's patch for AIRAVATA-870

Modified:
    airavata/trunk/modules/distribution/airavata-server/pom.xml
    airavata/trunk/modules/distribution/airavata-server/src/main/assembly/bin-assembly.xml
    airavata/trunk/modules/rest/webapp/pom.xml
    airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
    airavata/trunk/modules/server/pom.xml
    airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
    airavata/trunk/pom.xml

Modified: airavata/trunk/modules/distribution/airavata-server/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/airavata-server/pom.xml?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/airavata-server/pom.xml (original)
+++ airavata/trunk/modules/distribution/airavata-server/pom.xml Wed Sep 25 21:44:36 2013
@@ -617,6 +617,11 @@
             <artifactId>jopt-simple</artifactId>
             <version>3.2</version>
         </dependency>
+        <dependency>
+            <groupId>org.ebaysf.web</groupId>
+            <artifactId>cors-filter</artifactId>
+            <version>${ebay.cors.filter}</version>
+        </dependency>
     </dependencies>
 
 

Modified: airavata/trunk/modules/distribution/airavata-server/src/main/assembly/bin-assembly.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/distribution/airavata-server/src/main/assembly/bin-assembly.xml?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/modules/distribution/airavata-server/src/main/assembly/bin-assembly.xml
(original)
+++ airavata/trunk/modules/distribution/airavata-server/src/main/assembly/bin-assembly.xml
Wed Sep 25 21:44:36 2013
@@ -284,6 +284,7 @@
                 <include>org.apache.httpcomponents:httpclient:jar:4.1</include>
                 <include>de.odysseus.staxon:staxon:jar:1.2</include>
                 <include>de.odysseus.staxon:staxon-jackson:jar:1.2</include>
+                <include>org.ebaysf.web:cors-filter:jar:1.0.0</include>
             </includes>
         </dependencySet>
         <dependencySet>

Modified: airavata/trunk/modules/rest/webapp/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/pom.xml?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/modules/rest/webapp/pom.xml (original)
+++ airavata/trunk/modules/rest/webapp/pom.xml Wed Sep 25 21:44:36 2013
@@ -150,6 +150,11 @@
             <artifactId>jackson-core-asl</artifactId>
             <version>1.9.2</version>
         </dependency>
+        <dependency>
+            <groupId>org.ebaysf.web</groupId>
+            <artifactId>cors-filter</artifactId>
+            <version>${ebay.cors.filter}</version>
+        </dependency>
 
         <!-- Airavata -->
 		<!--dependency>

Modified: airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml Wed Sep 25 21:44:36
2013
@@ -82,8 +82,48 @@
             <param-value>org.apache.airavata.services.server;org.codehaus.jackson.jaxrs</param-value>
         </init-param>
         <load-on-startup>1</load-on-startup>
-    </servlet>
+    </servlet>	
+	
     <!-- ========================= Security Related Configurations go here ==================================
-->
+    
+    <filter>
+		<filter-name>CORS Filter</filter-name>
+		<filter-class>org.ebaysf.web.cors.CORSFilter</filter-class>
+		<init-param>
+			<description>A comma separated list of allowed origins. Note: An '*' cannot be used
for an allowed origin when using credentials.</description>
+			<param-name>cors.allowed.origins</param-name>
+			<param-value>*</param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.allowed.methods</param-name>
+			<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.allowed.headers</param-name>
+			<param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization</param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.exposed.headers</param-name>
+			<param-value></param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.support.credentials</param-name>
+			<param-value>true</param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.logging.enabled</param-name>
+			<param-value>false</param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.preflight.maxage</param-name>
+			<param-value>1800</param-value>
+		</init-param>
+		<init-param>
+			<param-name>cors.request.decorate</param-name>
+			<param-value>true</param-value>
+		</init-param>
+	</filter>
+	
     <filter>
         <filter-name>AuthenticationFilter</filter-name>
         <filter-class>org.apache.airavata.services.registry.rest.security.HttpAuthenticatorFilter</filter-class>
@@ -92,14 +132,22 @@
             <param-value>authenticators.xml</param-value>
         </init-param>
     </filter>
-
-    <filter-mapping>
-        <filter-name>AuthenticationFilter</filter-name>
-        <url-pattern>/user-store/*</url-pattern>
-        <url-pattern>/services/registry/*</url-pattern>
-        <url-pattern>/services/experiment/*</url-pattern>
-        <url-pattern>/services/server/*</url-pattern>
-    </filter-mapping>
+    
+	<filter-mapping>
+		<filter-name>CORS Filter</filter-name>
+		<url-pattern>/user-store/*</url-pattern>
+		<url-pattern>/services/registry/*</url-pattern>
+		<url-pattern>/services/experiment/*</url-pattern>
+		<url-pattern>/services/server/*</url-pattern>
+	</filter-mapping>
+	
+	<filter-mapping>
+		<filter-name>AuthenticationFilter</filter-name>
+		<url-pattern>/user-store/*</url-pattern>
+		<url-pattern>/services/registry/*</url-pattern>
+		<url-pattern>/services/experiment/*</url-pattern>
+		<url-pattern>/services/server/*</url-pattern>
+	</filter-mapping>
 
     <!-- ================================ End Security Related Configurations ===============================
-->
 

Modified: airavata/trunk/modules/server/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/server/pom.xml?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/modules/server/pom.xml (original)
+++ airavata/trunk/modules/server/pom.xml Wed Sep 25 21:44:36 2013
@@ -81,8 +81,13 @@
             <artifactId>airavata-rest-mappings</artifactId>
             <version>${project.version}</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.ebaysf.web</groupId>
+            <artifactId>cors-filter</artifactId>
+            <version>${ebay.cors.filter}</version>
+        </dependency>
     </dependencies>
+    
     <build>
         <plugins>
             <plugin>

Modified: airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
(original)
+++ airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
Wed Sep 25 21:44:36 2013
@@ -69,12 +69,33 @@ public class ServerMain {
         Wrapper registryServlet = tomcat.addServlet("/airavata", "Airavata Registry Service",
"com.sun.jersey.spi.container.servlet.ServletContainer");
         registryServlet.addInitParameter("com.sun.jersey.config.property.packages", "org.apache.airavata.services.registry.rest;org.codehaus.jackson.jaxrs");
         registryServlet.setLoadOnStartup(1);
+        
+        FilterDef corsFilter = new FilterDef();
+        corsFilter.setFilterName("CORS Filter");
+        corsFilter.setFilterClass("org.ebaysf.web.cors.CORSFilter");
+        corsFilter.addInitParameter("cors.allowed.origins","*");
+        corsFilter.addInitParameter("cors.allowed.methods","GET,POST,HEAD,PUT,OPTIONS");
+        corsFilter.addInitParameter("cors.allowed.headers","Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization");
+        corsFilter.addInitParameter("cors.exposed.headers","");
+        corsFilter.addInitParameter("cors.preflight.maxage","1800");
+        corsFilter.addInitParameter("cors.support.credentials","true");
+        corsFilter.addInitParameter("cors.logging.enabled","false");
+        corsFilter.addInitParameter("cors.request.decorate","true");
+        context.addFilterDef(corsFilter);
 
         FilterDef filter1definition = new FilterDef();
         filter1definition.setFilterName("AuthenticationFilter");
         filter1definition.setFilterClass("org.apache.airavata.services.registry.rest.security.HttpAuthenticatorFilter");
         filter1definition.addInitParameter("authenticatorConfigurations","authenticators.xml");
         context.addFilterDef(filter1definition);
+        
+        FilterMap corsFilterMapping = new FilterMap();
+        corsFilterMapping.setFilterName("CORS Filter");
+        corsFilterMapping.addURLPattern("/user-store/*");
+        corsFilterMapping.addURLPattern("/services/registry/*");
+        corsFilterMapping.addURLPattern("/services/server/*");
+        corsFilterMapping.addURLPattern("/services/experiment/*");
+        context.addFilterMap(corsFilterMapping);
 
         FilterMap filter1mapping = new FilterMap();
         filter1mapping.setFilterName("AuthenticationFilter");

Modified: airavata/trunk/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/pom.xml?rev=1526315&r1=1526314&r2=1526315&view=diff
==============================================================================
--- airavata/trunk/pom.xml (original)
+++ airavata/trunk/pom.xml Wed Sep 25 21:44:36 2013
@@ -89,6 +89,7 @@
         <antrun.version>1.6</antrun.version>
         <bouncy.castle.version>1.45</bouncy.castle.version>
         <jglobus.version>2.0.6</jglobus.version>
+        <ebay.cors.filter>1.0.0</ebay.cors.filter>
         <skipTests>false</skipTests>
     </properties>
 



Mime
View raw message