From 82a02a1d1d4b688aa699101d15c5e3c3c43ab43e Mon Sep 17 00:00:00 2001
From: Justin Richer <jricher@mitre.org>
Date: Tue, 13 Dec 2011 12:50:50 -0500
Subject: [PATCH] moved to Spring Security 3.1, local build against spring
 security oauth checkout

---
 .classpath                                    |  39 ++++---
 .gitignore                                    |   4 +-
 .project                                      | 107 +++++++++---------
 .settings/org.eclipse.jdt.core.prefs          |   9 +-
 ...clipse.jst.common.project.facet.core.prefs |   3 -
 .settings/org.eclipse.wst.common.component    |   9 +-
 ....eclipse.wst.common.project.facet.core.xml |   2 +-
 pom.xml                                       |  92 ++++++---------
 .../openid/connect/web/UserInfoEndpoint.java  |   1 +
 .../WEB-INF/spring/application-context.xml    |   2 +-
 .../WEB-INF/spring/security-context.xml       |   2 +-
 11 files changed, 133 insertions(+), 137 deletions(-)
 delete mode 100644 .settings/org.eclipse.jst.common.project.facet.core.prefs

diff --git a/.classpath b/.classpath
index 9b2c5f43a..4cea5050d 100644
--- a/.classpath
+++ b/.classpath
@@ -1,15 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/main/java"/>
-	<classpathentry kind="src" path="src/main/resources"/>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-		<attributes>
-			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry combineaccessrules="false" kind="src" path="/spring-security-oauth2"/>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry kind="src" path="spring-security-oauth/spring-security-oauth2/src/main/java"/>
+	<classpathentry kind="src" path="spring-security-oauth/spring-security-oauth2/src/main/resources"/>
+	<classpathentry kind="src" path="spring-security-oauth/spring-security-oauth2/src/test/java"/>
+	<classpathentry kind="src" path="spring-security-oauth/spring-security-oauth2/src/test/resources"/>
+	<classpathentry kind="src" path="spring-security-oauth/spring-security-oauth/src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/.gitignore b/.gitignore
index 7c5d2d0e8..5ce74ab6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-
-/local-values.conf
\ No newline at end of file
+/local-values.conf
+/target
diff --git a/.project b/.project
index 57efee624..9e70fd3c0 100644
--- a/.project
+++ b/.project
@@ -1,51 +1,56 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>OpenIDConnect</name>
-	<comment></comment>
-	<projects>
-		<project>Servers</project>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.ajdt.core.ajbuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.wst.common.project.facet.core.builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.wst.validation.validationbuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.springframework.ide.eclipse.core.springbuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.m2e.core.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.ajdt.ui.ajnature</nature>
-		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
-		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
-		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
-		<nature>org.springframework.ide.eclipse.core.springnature</nature>
-		<nature>com.springsource.sts.roo.core.nature</nature>
-		<nature>org.eclipse.m2e.core.maven2Nature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>OpenIDConnect</name>
+	<comment></comment>
+	<projects>
+		<project>Servers</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.springframework.ide.eclipse.core.springbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+		<nature>org.springframework.ide.eclipse.core.springnature</nature>
+		<nature>com.springsource.sts.roo.core.nature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 9ec44e3e6..a96f78e59 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,13 @@
-#Tue Mar 17 10:00:21 EDT 2009
+#Mon Dec 12 16:22:28 EST 2011
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/.settings/org.eclipse.jst.common.project.facet.core.prefs b/.settings/org.eclipse.jst.common.project.facet.core.prefs
deleted file mode 100644
index 763a1503d..000000000
--- a/.settings/org.eclipse.jst.common.project.facet.core.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Mar 17 09:59:19 EDT 2009
-classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.launching.macosx.MacOSXType\:\:JVM\ 1.5.0\ (MacOS\ X\ Default)/owners=jst.java\:5.0
-eclipse.preferences.version=1
diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
index 2f06ea1ff..4f15f0bfa 100644
--- a/.settings/org.eclipse.wst.common.component
+++ b/.settings/org.eclipse.wst.common.component
@@ -1,10 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project-modules id="moduleCoreId" project-version="1.5.0">
 	<wb-module deploy-name="OpenIDConnect">
-		<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
 		<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
 		<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+        <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/spring-security-oauth/spring-security-oauth2/src/main/java"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/spring-security-oauth/spring-security-oauth2/src/main/resources"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/spring-security-oauth/spring-security-oauth2/src/test/java"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/spring-security-oauth/spring-security-oauth2/src/test/resources"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/spring-security-oauth/spring-security-oauth/src/main/java"/>
 		<property name="java-output-path" value="target/classes"/>
-		<property name="context-root" value="OpenIDConnect"/>
+        <property name="context-root" value="openid"/>
 	</wb-module>
 </project-modules>
diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml
index d24a733bd..43b1e0cbd 100644
--- a/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -2,6 +2,6 @@
 <faceted-project>
   <fixed facet="jst.web"/>
   <fixed facet="jst.java"/>
-  <installed facet="jst.java" version="5.0"/>
   <installed facet="jst.web" version="2.5"/>
+  <installed facet="jst.java" version="1.6"/>
 </faceted-project>
diff --git a/pom.xml b/pom.xml
index ca452fe61..4ae8fa1da 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,8 +9,9 @@
     <version>0.1</version>
     <properties>
         <java-version>1.6</java-version>
-        <org.springframework-version>3.0.5.RELEASE</org.springframework-version>
+        <org.springframework-version>3.0.6.RELEASE</org.springframework-version>
         <org.slf4j-version>1.5.10</org.slf4j-version>
+        <spring.security.version>3.1.0.RELEASE</spring.security.version>
     </properties>
     <dependencies>
         <!-- Spring -->
@@ -153,58 +154,48 @@
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-core</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-acl</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-aspects</artifactId>
-            <version>${org.springframework-version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.security</groupId>
-            <artifactId>spring-security-cas-client</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-config</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-ldap</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-openid</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-taglibs</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-web</artifactId>
-            <version>${org.springframework-version}</version>
+            <version>${spring.security.version}</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
             <version>1.7.1</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.security.oauth</groupId>
-            <artifactId>spring-security-oauth</artifactId>
-            <version>1.0.0.M3</version>
-        </dependency>
         <dependency>
             <groupId>org.eclipse.persistence</groupId>
             <artifactId>javax.persistence</artifactId>
@@ -250,29 +241,34 @@
         	<artifactId>jackson-mapper-asl</artifactId>
         	<version>1.6.4</version>
         </dependency>
+        <dependency>
+        	<groupId>commons-codec</groupId>
+        	<artifactId>commons-codec</artifactId>
+        	<version>1.3</version>
+        </dependency>
     </dependencies>
     <repositories>
         <!-- For testing against latest Spring snapshots -->
-        <repository>
-            <id>org.springframework.maven.snapshot</id>
-            <name>Spring Maven Snapshot Repository</name>
-            <url>http://maven.springframework.org/snapshot</url>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </repository>
-        <!-- For developing against latest Spring milestones -->
-        <repository>
-            <id>org.springframework.maven.milestone</id>
-            <name>Spring Maven Milestone Repository</name>
-            <url>http://maven.springframework.org/milestone</url>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
+<!--         <repository> -->
+<!--             <id>org.springframework.maven.snapshot</id> -->
+<!--             <name>Spring Maven Snapshot Repository</name> -->
+<!--             <url>http://maven.springframework.org/snapshot</url> -->
+<!--             <releases> -->
+<!--                 <enabled>false</enabled> -->
+<!--             </releases> -->
+<!--             <snapshots> -->
+<!--                 <enabled>true</enabled> -->
+<!--             </snapshots> -->
+<!--         </repository> -->
+<!--         For developing against latest Spring milestones -->
+<!--         <repository> -->
+<!--             <id>org.springframework.maven.milestone</id> -->
+<!--             <name>Spring Maven Milestone Repository</name> -->
+<!--             <url>http://maven.springframework.org/milestone</url> -->
+<!--             <snapshots> -->
+<!--                 <enabled>false</enabled> -->
+<!--             </snapshots> -->
+<!--         </repository> -->
         <repository>
             <id>com.google.code.gson</id>
             <name>GSON repository</name>
@@ -372,24 +368,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-            	<groupId>com.google.code.maven-replacer-plugin</groupId>
-            	<artifactId>maven-replacer-plugin</artifactId>
-            	<version>1.3.8</version>
-            	<executions>
-            		<execution>
-            			<phase>prepare-package</phase>
-            			<goals>
-            				<goal>replace</goal>
-            			</goals>
-            		</execution>
-            	</executions>
-            	<!-- Replace database key/value pairs if there -->
-            	<configuration>
-            		<filesToInclude>target/${project.artifactId}-${project.version}/WEB-INF/spring/data-context.xml,target/${project.artifactId}-${project.version}/WEB-INF/spring/security-context.xml</filesToInclude>
-            		<tokenValueMap>local-values.conf</tokenValueMap>
-            	</configuration>
-            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java b/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java
index 43d76f0d1..6154757ba 100644
--- a/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java
+++ b/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java
@@ -1,5 +1,6 @@
 package org.mitre.openid.connect.web;
 
+import org.mitre.openid.connect.model.UserInfo;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
diff --git a/src/main/webapp/WEB-INF/spring/application-context.xml b/src/main/webapp/WEB-INF/spring/application-context.xml
index 2c1fffd46..dbe8cd518 100644
--- a/src/main/webapp/WEB-INF/spring/application-context.xml
+++ b/src/main/webapp/WEB-INF/spring/application-context.xml
@@ -6,7 +6,7 @@
 	xmlns:security="http://www.springframework.org/schema/security"
 	xmlns:task="http://www.springframework.org/schema/task"
 	xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
-		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.4.xsd
+		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
 		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
 		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
diff --git a/src/main/webapp/WEB-INF/spring/security-context.xml b/src/main/webapp/WEB-INF/spring/security-context.xml
index 3beed913f..a3b661d46 100644
--- a/src/main/webapp/WEB-INF/spring/security-context.xml
+++ b/src/main/webapp/WEB-INF/spring/security-context.xml
@@ -5,7 +5,7 @@
 	xmlns="http://www.springframework.org/schema/beans"
 	xmlns:security="http://www.springframework.org/schema/security"
 	xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2.xsd
-		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.4.xsd
+		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
 		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 
 	<security:global-method-security pre-post-annotations="enabled" proxy-target-class="true"/>