Bläddra i källkod

SEC-2963: Update to latest Google AppEngine

Rob Winch 10 år sedan
förälder
incheckning
e25b84c902

+ 0 - 26
buildSrc/src/main/groovy/gae/GaePlugin.groovy

@@ -1,26 +0,0 @@
-package gae;
-
-import com.google.appengine.tools.admin.AppCfg
-import org.gradle.api.*;
-
-class GaePlugin implements Plugin<Project> {
-	public void apply(Project project) {
-		if (!project.hasProperty('appEngineSdkRoot')) {
-			println "'appEngineSdkRoot' must be set in gradle.properties"
-		} else {
-			System.setProperty('appengine.sdk.root', project.property('appEngineSdkRoot'))
-		}
-
-		File explodedWar = new File(project.buildDir, "gae-exploded")
-
-		project.task('gaeDeploy') << {
-			AppCfg.main("update", explodedWar.toString())
-		}
-
-		project.gaeDeploy.dependsOn project.war
-
-		project.war.doLast {
-			ant.unzip(src: project.war.archivePath, dest: explodedWar)
-		}
-	}
-}

+ 0 - 1
buildSrc/src/main/resources/META-INF/gradle-plugins/gae.properties

@@ -1 +0,0 @@
-implementation-class=gae.GaePlugin

+ 5 - 0
samples/gae-xml/README.adoc

@@ -0,0 +1,5 @@
+A sample using Google App Engine. To run it use:
+
+----
+$ ../../gradlew appengineRun
+----

+ 13 - 11
samples/gae-xml/gae.gradle

@@ -1,26 +1,28 @@
 apply plugin: 'war'
 apply plugin: 'jetty'
-apply plugin: 'gae'
+apply plugin: 'appengine'
 
-def gaeVersion="1.4.2"
+def gaeVersion="1.9.23"
 
-repositories {
-	maven {
-		// Hibernate Validator
-		name =	'JBoss'
-		url = 'https://repository.jboss.org/nexus/content/repositories/releases'
+buildscript {
+	repositories {
+		mavenCentral()
 	}
-	maven {
-		// GAE Jars
-		name =	'GAE'
-		url = 'http://maven-gae-plugin.googlecode.com/svn/repository'
+	dependencies {
+		classpath 'com.google.appengine:gradle-appengine-plugin:1.9.23'
 	}
 }
 
+appengine {
+	downloadSdk = true
+}
+
 // Remove logback as it causes security issues with GAE.
 configurations.runtime.exclude(group: 'ch.qos.logback')
 
 dependencies {
+	appengineSdk "com.google.appengine:appengine-java-sdk:$gaeVersion"
+
 	providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
 
 	compile project(':spring-security-core'),

+ 1 - 1
samples/gae-xml/src/main/java/samples/gae/security/AppRole.java

@@ -27,6 +27,6 @@ public enum AppRole implements GrantedAuthority {
 	}
 
 	public String getAuthority() {
-		return toString();
+		return "ROLE_"+toString();
 	}
 }

+ 1 - 0
samples/gae-xml/src/main/webapp/WEB-INF/appengine-web.xml

@@ -3,6 +3,7 @@
 	<application>gaespringsec</application>
 	<version>1</version>
 	<sessions-enabled>true</sessions-enabled>
+	<threadsafe>true</threadsafe>
 
 	<system-properties>
 		<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>

+ 1 - 0
samples/gae-xml/src/main/webapp/WEB-INF/applicationContext-security.xml

@@ -6,6 +6,7 @@
 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 	http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
 
+	<http pattern="/_ah/**" security="none"/>
 	<http pattern="/static/**" security="none" />
 	<http pattern="/favicon.ico" security="none" />
 	<http pattern="/loggedout.htm" security="none" />