SEC-2194: Polish java config sample apps

This commit is contained in:
Rob Winch 2013-08-06 11:31:45 -05:00
parent d20a8e0373
commit 976d9a9016
108 changed files with 23770 additions and 82 deletions

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>aopalliance</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jasig.cas.client</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>aopalliance</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>aopalliance</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>

View File

@ -34,15 +34,4 @@ configure(javaProjects) {
}
}
}
tasks.withType(org.gradle.plugins.ide.eclipse.GenerateEclipseWtpComponent) {
project.eclipse.classpath.file.whenMerged { classpath->
project.eclipse.wtp.component.file.whenMerged { wtpComponent ->
def context = project.tasks.findByName('jettyRun')?.contextPath?.replaceFirst('/','')
if(context) {
wtpComponent.contextPath = context
}
}
}
}
}

View File

@ -35,8 +35,12 @@ def customizePom(pom, gradleProject) {
"$dep.scope:$dep.optional:$dep.groupId:$dep.artifactId"
}
}
def isWar = project.hasProperty('war')
pom.project {
name = gradleProject.name
if(isWar) {
packaging = "war"
}
description = gradleProject.name
url = 'http://springsource.org/spring-security'
organization {
@ -62,6 +66,31 @@ def customizePom(pom, gradleProject) {
email = 'rwinch@vmware.com'
}
}
if(isWar) {
properties {
'm2eclipse.wtp.contextRoot' '/' + project.war.baseName
}
}
if(!project.releaseBuild) {
repositories {
repository {
id 'spring-snasphot'
url 'http://repo.springsource.org/libs-snapshot'
}
}
}
build {
plugins {
plugin {
groupId = 'org.apache.maven.plugins'
artifactId = 'maven-compiler-plugin'
configuration {
source = '1.7'
target = '1.7'
}
}
}
}
}
}

View File

@ -1,6 +1,10 @@
apply plugin: 'war'
apply from: TOMCAT_GRADLE
war {
baseName = "sample"
}
sonarRunner {
skipProject = true
}

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>aopalliance</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.ldap</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.inject</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>aopalliance</groupId>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-cassample-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-cassample-xml</name>
<description>spring-security-samples-cassample-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jasig.cas.client</groupId>
@ -172,4 +190,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/spring-security-samples-cassample-xml</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-casserver</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-casserver</name>
<description>spring-security-samples-casserver</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
@ -88,4 +106,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/spring-security-samples-casserver</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "concurrency"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-concurrency-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-concurrency-jc</name>
<description>spring-security-samples-concurrency-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -184,4 +202,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -1,8 +1,6 @@
// Contacts sample build file
apply plugin: 'war'
apply plugin: 'jetty'
apply from: WAR_SAMPLE_GRADLE
dependencies {
providedCompile "org.apache.tomcat:tomcat-servlet-api:$servletApiVersion"
@ -29,7 +27,3 @@ dependencies {
optional "net.sf.ehcache:ehcache:$ehcacheVersion"
}
jettyRun {
contextPath = "/contacts"
}

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-contacts-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-contacts-xml</name>
<description>spring-security-samples-contacts-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
@ -191,4 +209,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-gae-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-gae-xml</name>
<description>spring-security-samples-gae-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.appengine</groupId>
@ -196,4 +214,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/spring-security-samples-gae-xml</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,24 @@
apply from: WAR_SAMPLE_GRADLE
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"
compile project(":spring-security-config"),
project(":spring-security-samples-messages-jc"),
project(":spring-security-core"),
project(":spring-security-web"),
"org.springframework:spring-webmvc:$springVersion",
"org.springframework:spring-jdbc:$springVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"org.slf4j:log4j-over-slf4j:$slf4jVersion",
"org.slf4j:jul-to-slf4j:$slf4jVersion",
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
"javax.servlet:jstl:1.2",
"javax.validation:validation-api:1.0.0.GA",
"org.hibernate:hibernate-validator:4.2.0.Final"
runtime "opensymphony:sitemesh:2.4.2",
'cglib:cglib-nodep:2.2.2',
'ch.qos.logback:logback-classic:0.9.30'
}

208
samples/hellomvc-jc/pom.xml Normal file
View File

@ -0,0 +1,208 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-hellomvc-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-hellomvc-jc</name>
<description>spring-security-samples-hellomvc-jc</description>
<url>http://springsource.org/spring-security</url>
<organization>
<name>SpringSource</name>
<url>http://springsource.org/</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>rwinch</id>
<name>Rob Winch</name>
<email>rwinch@vmware.com</email>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/SpringSource/spring-security</connection>
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-messages-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.30</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.4.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.29</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.2.3.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -0,0 +1,32 @@
package org.springframework.security.samples.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void registerAuthentication(
AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("user").password("password").roles("USER");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/resources/**").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll();
}
}

View File

@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@ -0,0 +1,5 @@
<decorators defaultdir="/WEB-INF/decorators">
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>

View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:decorator="http://www.opensymphony.com/sitemesh/decorator"
xmlns:page="http://www.opensymphony.com/sitemesh/page"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:spring="http://www.springframework.org/tags"
xmlns:sec="http://www.springframework.org/security/tags"
xmlns:tags="urn:jsptagdir:/WEB-INF/tags" version="2.0">
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<jsp:output doctype-root-element="HTML"
doctype-system="about:legacy-compat" />
<html lang="en">
<head>
<title>SecureMail: <decorator:title/></title>
<c:url var="faviconUrl" value="/resources/img/favicon.ico"/>
<link rel="icon" type="image/x-icon" href="${faviconUrl}"/>
<c:url var="bootstrapUrl" value="/resources/css/bootstrap.css"/>
<link href="${bootstrapUrl}" rel="stylesheet"></link>
<style type="text/css">
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
.container {
width: auto;
max-width: 680px;
}
.container .credit {
margin: 20px 0;
text-align: center;
}
a {
color: green;
}
</style>
<c:url var="bootstrapResponsiveUrl" value="/resources/css/bootstrap-responsive.css"/>
<link href="${bootstrapResponsiveUrl}" rel="stylesheet"></link>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="wrap">
<div class="navbar navbar-inverse navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<c:url var="homeUrl" value="/"/>
<c:url var="logoUrl" value="/resources/img/logo.png"/>
<a class="brand" href="${homeUrl}"><img src="${logoUrl}" alt="Spring Security Sample"/></a>
<div class="nav-collapse collapse">
<ul class="nav">
<c:url var="inboxUrl" value="/"/>
<li><a href="${inboxUrl}">Inbox</a></li>
<c:url var="composeUrl" value="/?form"/>
<li><a href="${composeUrl}">Compose</a></li>
<c:url var="logoutUrl" value="/logout"/>
<li><a href="${logoutUrl}">Log out</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Begin page content -->
<div class="container">
<decorator:body/>
</div>
<div id="push"><!-- --></div>
</div>
<div id="footer">
<div class="container">
<p class="muted credit">Visit the <a href="#">Spring Security</a> site for more <a href="#">samples</a>.</p>
</div>
</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,21 @@
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:sec="http://www.springframework.org/security/tags"
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.attribute name="url" type="java.lang.String" required="true" description="The url to go to"/>
<jsp:directive.attribute name="text" type="java.lang.String" required="true" description="The text for the tab"/>
<jsp:directive.attribute name="id" type="java.lang.String" required="true" description="The id for the tab"/>
<sec:authorize url="${url}">
<c:url var="url" value="${url}"/>
<c:choose>
<c:when test="${id == tab}">
<c:set var="css" value=" selected"/>
</c:when>
<c:otherwise>
<c:set var="css" value=""/>
</c:otherwise>
</c:choose>
<li class="tab${css}"><a href="${url}">${text}</a></li>
</sec:authorize>
</jsp:root>

View File

@ -0,0 +1,18 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<c:set var="title" value="Access Denied"/>
<head>
<title>${title}</title>
</head>
<body>
<h1>${title}</h1>
<div class="errors">You do not have sufficient privileges to access this page.</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,18 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<c:set var="title" value="Page Not Found"/>
<head>
<title>${title}</title>
</head>
<body>
<h1>${title}</h1>
<div class="errors">The requested page could not be found.</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,18 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<c:set var="title" value="Internal Error"/>
<head>
<title>${title}</title>
</head>
<body>
<h1>${title}</h1>
<div class="errors">An internal error occurred.</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,39 @@
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form" version="2.0">
<jsp:directive.page language="java" contentType="text/html" />
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Please Login</title>
</head>
<body>
<c:url value="/login" var="loginUrl"/>
<form name="f" action="${loginUrl}" method="post">
<fieldset>
<legend>Please Login</legend>
<c:if test="${param.error != null}">
<div class="alert alert-error">
Failed to login.
<c:if test="${SPRING_SECURITY_LAST_EXCEPTION != null}">
Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
</c:if>
</div>
</c:if>
<c:if test="${param.logout != null}">
<div class="alert alert-success">
You have been logged out.
</div>
</c:if>
<label for="j_username">Username</label>
<input type="text" id="j_username" name="username" value="${username}"/>
<label for="j_password">Password</label>
<input type="password" id="j_password" name="password"/>
<div class="form-actions">
<button type="submit" class="btn">Log in</button>
</div>
</fieldset>
</form>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,26 @@
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form" version="2.0">
<jsp:directive.page language="java" contentType="text/html" />
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Compose</title>
</head>
<body>
<div class="container">
<h1>Messages : Create</h1>
<form:form action="./" method="post" modelAttribute="message">
<form:errors path="*" element="div" cssClass="alert alert-error" />
<label for="summary">Summary</label>
<form:input type="text" path="summary" class="input-xxlarge" />
<label for="text">Message</label>
<form:textarea path="text" class="input-xxlarge"></form:textarea>
<div class="form-actions">
<input type="submit" value="Create" />
</div>
</form:form>
</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,40 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Inbox</title>
</head>
<body>
<h1>Inbox</h1>
<table class="table">
<thead>
<tr>
<th>Created</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<c:if test="${empty messages}">
<tr>
<td colspan="2" class="msg">You have not received any mail yet.</td>
</tr>
</c:if>
<c:forEach items="${messages}" var="message">
<tr>
<td><fmt:formatDate value="${message.created.time}"/></td>
<spring:url var="messageUrl" value="/{id}">
<spring:param name="id" value="${message.id}"/>
</spring:url>
<td><a href="${messageUrl}"><c:out value="${message.summary}"/></a></td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,24 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title><c:out value="${message.summary}"/></title>
</head>
<body>
<div class="container">
<h1>Message : <c:out value="${message.summary}"/></h1>
<dl>
<dt>Created</dt>
<dd><fmt:formatDate value="${message.created.time}"/></dd>
<dt>Message</dt>
<dd><c:out value="${message.text}"/></dd>
</dl>
</div>
</body>
</html>
</jsp:root>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,33 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Rob Winch
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=SecurityConfig.class)
public class SecurityConfigTests {
@Test
public void securityConfigurationLoads() {}
}

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "helloworld"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-helloworld-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-helloworld-jc</name>
<description>spring-security-samples-helloworld-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -112,4 +130,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -1,9 +1,8 @@
package org.springframework.security.samples.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.authentication.builders.* ;
import org.springframework.security.config.annotation.web.configuration.*;
@Configuration
@EnableWebSecurity

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "inmemory"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-inmemory-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-inmemory-jc</name>
<description>spring-security-samples-inmemory-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -184,4 +202,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -0,0 +1,12 @@
apply from: WAR_SAMPLE_GRADLE
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1",
'javax.servlet.jsp:jsp-api:2.1'
compile "javax.servlet:jstl:1.2",
"org.slf4j:jcl-over-slf4j:$slf4jVersion"
runtime "ch.qos.logback:logback-classic:$logbackVersion"
}

130
samples/insecure/pom.xml Normal file
View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-insecure</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-insecure</name>
<description>spring-security-samples-insecure</description>
<url>http://springsource.org/spring-security</url>
<organization>
<name>SpringSource</name>
<url>http://springsource.org/</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>rwinch</id>
<name>Rob Winch</name>
<email>rwinch@vmware.com</email>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/SpringSource/spring-security</connection>
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.29</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.2.3.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0">
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<jsp:output doctype-root-element="HTML"
doctype-system="about:legacy-compat" />
<html lang="en">
<head>
<title>Hello World</title>
<c:url var="faviconUrl" value="/resources/img/favicon.ico"/>
<link rel="icon" type="image/x-icon" href="${faviconUrl}"/>
<c:url var="bootstrapUrl" value="/resources/css/bootstrap.css"/>
<link href="${bootstrapUrl}" rel="stylesheet"></link>
<c:url var="bootstrapResponsiveUrl" value="/resources/css/bootstrap-responsive.css"/>
<link href="${bootstrapResponsiveUrl}" rel="stylesheet"></link>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<h1>TODO Secure this</h1>
<p>We would like to secure this page</p>
</div>
</body>
</html>
</jsp:root>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,21 @@
apply from: WAR_SAMPLE_GRADLE
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"
compile project(":spring-security-samples-messages-jc"),
"org.springframework:spring-webmvc:$springVersion",
"org.springframework:spring-jdbc:$springVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"org.slf4j:log4j-over-slf4j:$slf4jVersion",
"org.slf4j:jul-to-slf4j:$slf4jVersion",
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
"javax.servlet:jstl:1.2",
"javax.validation:validation-api:1.0.0.GA",
"org.hibernate:hibernate-validator:4.2.0.Final"
runtime "opensymphony:sitemesh:2.4.2",
'cglib:cglib-nodep:2.2.2',
'ch.qos.logback:logback-classic:0.9.30'
}

190
samples/insecuremvc/pom.xml Normal file
View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-insecuremvc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-insecuremvc</name>
<description>spring-security-samples-insecuremvc</description>
<url>http://springsource.org/spring-security</url>
<organization>
<name>SpringSource</name>
<url>http://springsource.org/</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>rwinch</id>
<name>Rob Winch</name>
<email>rwinch@vmware.com</email>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/SpringSource/spring-security</connection>
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-messages-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.30</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.4.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.29</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.2.3.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@ -0,0 +1,5 @@
<decorators defaultdir="/WEB-INF/decorators">
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>

View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:decorator="http://www.opensymphony.com/sitemesh/decorator"
xmlns:page="http://www.opensymphony.com/sitemesh/page"
xmlns:form="http://www.springframework.org/tags/form"
xmlns:spring="http://www.springframework.org/tags"
xmlns:sec="http://www.springframework.org/security/tags"
xmlns:tags="urn:jsptagdir:/WEB-INF/tags" version="2.0">
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<jsp:output doctype-root-element="HTML"
doctype-system="about:legacy-compat" />
<html lang="en">
<head>
<title>SecureMail: <decorator:title/></title>
<c:url var="faviconUrl" value="/resources/img/favicon.ico"/>
<link rel="icon" type="image/x-icon" href="${faviconUrl}"/>
<c:url var="bootstrapUrl" value="/resources/css/bootstrap.css"/>
<link href="${bootstrapUrl}" rel="stylesheet"></link>
<style type="text/css">
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
.container {
width: auto;
max-width: 680px;
}
.container .credit {
margin: 20px 0;
text-align: center;
}
a {
color: green;
}
</style>
<c:url var="bootstrapResponsiveUrl" value="/resources/css/bootstrap-responsive.css"/>
<link href="${bootstrapResponsiveUrl}" rel="stylesheet"></link>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="wrap">
<div class="navbar navbar-inverse navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<c:url var="homeUrl" value="/"/>
<c:url var="logoUrl" value="/resources/img/logo.png"/>
<a class="brand" href="${homeUrl}"><img src="${logoUrl}" alt="Spring Security Sample"/></a>
<div class="nav-collapse collapse">
<ul class="nav">
<c:url var="inboxUrl" value="/"/>
<li><a href="${inboxUrl}">Inbox</a></li>
<c:url var="composeUrl" value="/?form"/>
<li><a href="${composeUrl}">Compose</a></li>
<c:url var="logoutUrl" value="/logout"/>
<li><a href="${logoutUrl}">Log out</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- Begin page content -->
<div class="container">
<decorator:body/>
</div>
<div id="push"><!-- --></div>
</div>
<div id="footer">
<div class="container">
<p class="muted credit">Visit the <a href="#">Spring Security</a> site for more <a href="#">samples</a>.</p>
</div>
</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,21 @@
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:sec="http://www.springframework.org/security/tags"
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.attribute name="url" type="java.lang.String" required="true" description="The url to go to"/>
<jsp:directive.attribute name="text" type="java.lang.String" required="true" description="The text for the tab"/>
<jsp:directive.attribute name="id" type="java.lang.String" required="true" description="The id for the tab"/>
<sec:authorize url="${url}">
<c:url var="url" value="${url}"/>
<c:choose>
<c:when test="${id == tab}">
<c:set var="css" value=" selected"/>
</c:when>
<c:otherwise>
<c:set var="css" value=""/>
</c:otherwise>
</c:choose>
<li class="tab${css}"><a href="${url}">${text}</a></li>
</sec:authorize>
</jsp:root>

View File

@ -0,0 +1,18 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<c:set var="title" value="Access Denied"/>
<head>
<title>${title}</title>
</head>
<body>
<h1>${title}</h1>
<div class="errors">You do not have sufficient privileges to access this page.</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,18 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<c:set var="title" value="Page Not Found"/>
<head>
<title>${title}</title>
</head>
<body>
<h1>${title}</h1>
<div class="errors">The requested page could not be found.</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,18 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<c:set var="title" value="Internal Error"/>
<head>
<title>${title}</title>
</head>
<body>
<h1>${title}</h1>
<div class="errors">An internal error occurred.</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,39 @@
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form" version="2.0">
<jsp:directive.page language="java" contentType="text/html" />
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Please Login</title>
</head>
<body>
<c:url value="/login" var="loginUrl"/>
<form name="f" action="${loginUrl}" method="post">
<fieldset>
<legend>Please Login</legend>
<c:if test="${param.error != null}">
<div class="alert alert-error">
Failed to login.
<c:if test="${SPRING_SECURITY_LAST_EXCEPTION != null}">
Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
</c:if>
</div>
</c:if>
<c:if test="${param.logout != null}">
<div class="alert alert-success">
You have been logged out.
</div>
</c:if>
<label for="j_username">Username</label>
<input type="text" id="j_username" name="username" value="${username}"/>
<label for="j_password">Password</label>
<input type="password" id="j_password" name="password"/>
<div class="form-actions">
<button type="submit" class="btn">Log in</button>
</div>
</fieldset>
</form>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,26 @@
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:form="http://www.springframework.org/tags/form" version="2.0">
<jsp:directive.page language="java" contentType="text/html" />
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Compose</title>
</head>
<body>
<div class="container">
<h1>Messages : Create</h1>
<form:form action="./" method="post" modelAttribute="message">
<form:errors path="*" element="div" cssClass="alert alert-error" />
<label for="summary">Summary</label>
<form:input type="text" path="summary" class="input-xxlarge" />
<label for="text">Message</label>
<form:textarea path="text" class="input-xxlarge"></form:textarea>
<div class="form-actions">
<input type="submit" value="Create" />
</div>
</form:form>
</div>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,40 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Inbox</title>
</head>
<body>
<h1>Inbox</h1>
<table class="table">
<thead>
<tr>
<th>Created</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<c:if test="${empty messages}">
<tr>
<td colspan="2" class="msg">You have not received any mail yet.</td>
</tr>
</c:if>
<c:forEach items="${messages}" var="message">
<tr>
<td><fmt:formatDate value="${message.created.time}"/></td>
<spring:url var="messageUrl" value="/{id}">
<spring:param name="id" value="${message.id}"/>
</spring:url>
<td><a href="${messageUrl}"><c:out value="${message.summary}"/></a></td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>
</jsp:root>

View File

@ -0,0 +1,24 @@
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form"
version="2.0">
<jsp:directive.page language="java" contentType="text/html"/>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title><c:out value="${message.summary}"/></title>
</head>
<body>
<div class="container">
<h1>Message : <c:out value="${message.summary}"/></h1>
<dl>
<dt>Created</dt>
<dd><fmt:formatDate value="${message.created.time}"/></dd>
<dt>Message</dt>
<dd><c:out value="${message.text}"/></dd>
</dl>
</div>
</body>
</html>
</jsp:root>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,7 +1,5 @@
// JAAS sample build file
apply plugin: 'war'
apply plugin: 'jetty'
apply from: WAR_SAMPLE_GRADLE
def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
@ -29,7 +27,3 @@ dependencies {
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
"ch.qos.logback:logback-classic:$logbackVersion"
}
jettyRun {
contextPath = "/jaas"
}

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-jaas-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-jaas-xml</name>
<description>spring-security-samples-jaas-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
@ -148,4 +166,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "jdbc"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-jdbc-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-jdbc-jc</name>
<description>spring-security-samples-jdbc-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -184,4 +202,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "ldap"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-ldap-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-ldap-jc</name>
<description>spring-security-samples-ldap-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -226,4 +244,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -1,7 +1,5 @@
// LDAP sample build file
apply plugin: 'war'
apply plugin: 'jetty'
apply from: WAR_SAMPLE_GRADLE
def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'ldapsdk']
@ -21,7 +19,3 @@ dependencies {
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
"ch.qos.logback:logback-classic:$logbackVersion"
}
jettyRun {
contextPath = "/ldap"
}

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-ldap-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-ldap-xml</name>
<description>spring-security-samples-ldap-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
@ -106,4 +124,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -6,12 +6,20 @@ dependencies {
compile project(":spring-security-web"),
project(":spring-security-config"),
"org.springframework.data:spring-data-jpa:1.2.0.RELEASE",
"org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0.Final",
"org.hibernate:hibernate-entitymanager:3.6.10.Final",
"org.hsqldb:hsqldb:2.2.8",
"opensymphony:sitemesh:2.4.2",
"javax.validation:validation-api:1.0.0.GA",
"org.hibernate:hibernate-validator:4.2.0.Final",
"org.springframework:spring-webmvc:$springVersion"
"org.springframework:spring-webmvc:$springVersion",
"org.springframework:spring-orm:$springVersion",
"org.springframework:spring-context:$springVersion",
"org.springframework:spring-aop:$springVersion",
"org.springframework:spring-tx:$springVersion",
"org.springframework:spring-beans:$springVersion",
"org.springframework:spring-instrument:$springVersion",
"org.springframework:spring-core:$springVersion",
"org.springframework:spring-aspects:$springVersion",
"org.springframework.data:spring-data-jpa:1.3.4.RELEASE"
}

View File

@ -31,6 +31,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
@ -71,7 +88,7 @@
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.2.0.RELEASE</version>
<version>1.3.4.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -86,6 +103,36 @@
<version>3.2.0.CI-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
@ -98,6 +145,24 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "openid"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-openid-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-openid-jc</name>
<description>spring-security-samples-openid-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -196,4 +214,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-openid-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-openid-xml</name>
<description>spring-security-samples-openid-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
@ -124,4 +142,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/spring-security-samples-openid-xml</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "preauth"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-preauth-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-preauth-jc</name>
<description>spring-security-samples-preauth-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -184,4 +202,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-preauth-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-preauth-xml</name>
<description>spring-security-samples-preauth-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
@ -100,4 +118,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -3,6 +3,8 @@
apply plugin: 'war'
apply plugin: 'jetty'
war.baseName = "sample"
def excludeModules = ['jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
configurations {
@ -22,6 +24,5 @@ dependencies {
}
jettyRun {
contextPath = "/preauth"
userRealms = [jettyRun.class.classLoader.loadClass('org.mortbay.jetty.security.HashUserRealm').newInstance('Preauth Realm', "$projectDir/realm.properties")]
}

View File

@ -1,9 +1,5 @@
apply from: WAR_SAMPLE_GRADLE
war {
baseName = "rememberme"
}
dependencies {
providedCompile "javax.servlet:javax.servlet-api:3.0.1"

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-rememberme-jc</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-rememberme-jc</name>
<description>spring-security-samples-rememberme-jc</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -184,4 +202,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/sample</m2eclipse.wtp.contextRoot>
</properties>
</project>

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.samples.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/**
* No customizations of {@link AbstractSecurityWebApplicationInitializer} are necessary.
*
* @author Rob Winch
*/
public class MessageSecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
}

View File

@ -5,6 +5,7 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-samples-servletapi-xml</artifactId>
<version>3.2.0.CI-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-security-samples-servletapi-xml</name>
<description>spring-security-samples-servletapi-xml</description>
<url>http://springsource.org/spring-security</url>
@ -31,6 +32,23 @@
<developerConnection>scm:git:git://github.com/SpringSource/spring-security</developerConnection>
<url>https://github.com/SpringSource/spring-security</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snasphot</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@ -154,4 +172,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<m2eclipse.wtp.contextRoot>/spring-security-samples-servletapi-xml</m2eclipse.wtp.contextRoot>
</properties>
</project>

Some files were not shown because too many files have changed in this diff Show More