diff --git a/config/config.gradle b/config/config.gradle index af0693637f..733289d391 100644 --- a/config/config.gradle +++ b/config/config.gradle @@ -26,7 +26,8 @@ dependencies { "org.springframework.ldap:spring-ldap-core:$springLdapVersion", "org.springframework:spring-jdbc:$springVersion", "org.springframework:spring-tx:$springVersion", - 'org.spockframework:spock-core:0.4-groovy-1.7' + 'org.spockframework:spock-core:0.4-groovy-1.7', + "org.slf4j:jcl-over-slf4j:$slf4jVersion" testRuntime "hsqldb:hsqldb:$hsqlVersion", "cglib:cglib-nodep:2.2" diff --git a/gradle/javaprojects.gradle b/gradle/javaprojects.gradle index ec753ef85d..1ec4b722de 100644 --- a/gradle/javaprojects.gradle +++ b/gradle/javaprojects.gradle @@ -20,6 +20,7 @@ configurations { provided compile.extendsFrom provided compile.transitive = false + testCompile.transitive = false } dependencies { @@ -38,9 +39,7 @@ dependencies { "org.springframework:spring-test:$springVersion" // Use slf4j/logback for logging - testRuntime "org.slf4j:slf4j-api:$slf4jVersion", - "org.slf4j:jcl-over-slf4j:$slf4jVersion", - "ch.qos.logback:logback-core:$logbackVersion", + testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion", "ch.qos.logback:logback-classic:$logbackVersion" } diff --git a/openid/openid.gradle b/openid/openid.gradle index 6a01b39729..8d5f6b5870 100644 --- a/openid/openid.gradle +++ b/openid/openid.gradle @@ -12,4 +12,4 @@ dependencies { provided 'javax.servlet:servlet-api:2.5' runtime 'commons-httpclient:commons-httpclient:3.1' -} \ No newline at end of file +} diff --git a/samples/cas/cas.gradle b/samples/cas/cas.gradle index ebd59e42aa..2ff975bf68 100644 --- a/samples/cas/cas.gradle +++ b/samples/cas/cas.gradle @@ -1,9 +1,55 @@ +// CAS sample build file + apply plugin: 'war' apply plugin: 'jetty' + +configurations { + casServer +} + dependencies { - runtime project(':spring-security-core'), - project(':spring-security-web'), + casServer "org.jasig.cas:cas-server-webapp:3.4.2.1@war" + + runtime project(':spring-security-web'), + project(':spring-security-cas'), project(':spring-security-config'), - 'log4j:log4j:1.2.15@jar' -} \ No newline at end of file + "org.slf4j:jcl-over-slf4j:$slf4jVersion", + "ch.qos.logback:logback-classic:$logbackVersion" +} + + +def keystore = "$rootDir/samples/certificates/server.jks" + +jettyRun { + contextPath = "/cas" + def httpConnector = new org.mortbay.jetty.nio.SelectChannelConnector(); + httpConnector.port = 8080 + httpConnector.confidentialPort = 8443 + def httpsConnector = new org.mortbay.jetty.security.SslSocketConnector(); + httpsConnector.port = 8443 + httpsConnector.keystore = httpsConnector.truststore = keystore + httpsConnector.keyPassword = httpsConnector.trustPassword = 'password' + + connectors = [httpConnector, httpsConnector] +} + +task casServer (type: org.gradle.api.plugins.jetty.JettyRunWar) { + contextPath = "/cas" + connectors = [new org.mortbay.jetty.security.SslSocketConnector()] + connectors[0].port = 9443 + connectors[0].keystore = connectors[0].truststore = keystore + connectors[0].keyPassword = connectors[0].trustPassword = 'password' + connectors[0].wantClientAuth = true + connectors[0].needClientAuth = false + webApp = configurations.casServer.resolve().toArray()[0] + doFirst() { + System.setProperty('javax.net.ssl.trustStore', keystore) + System.setProperty('javax.net.ssl.trustStorePassword', 'password') + } +} + +task cas (dependsOn: jettyRun) { + jettyRun.dependsOn(casServer) + casServer.daemon = true +} diff --git a/samples/cas/client/pom.xml b/samples/cas/client/pom.xml deleted file mode 100644 index 186beca0f6..0000000000 --- a/samples/cas/client/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - 4.0.0 - - org.springframework.security - spring-security-samples-cas - 3.1.0.CI-SNAPSHOT - - org.springframework.security - spring-security-samples-cas-client - Spring Security - CAS Sample Client Web Application - war - - - org.springframework.security - spring-security-core - ${project.version} - - - org.springframework.security - spring-security-config - ${project.version} - - - org.springframework.security - spring-security-cas-client - ${project.version} - - - org.springframework - spring-web - - - org.springframework - spring-webmvc - - - org.springframework - spring-jdbc - runtime - - - org.springframework - spring-aop - runtime - - - - org.slf4j - slf4j-log4j12 - 1.4.3 - runtime - true - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.mortbay.jetty - maven-jetty-plugin - ${jetty.version} - - /cas-sample - - - 8080 - 8443 - - - 8443 - ../../certificates/server.jks - password - password - ../../certificates/server.jks - password - - - - - javax.net.ssl.trustStore - ../../certificates/server.jks - - - javax.net.ssl.trustStorePassword - password - - - - - - - - diff --git a/samples/cas/client/src/main/webapp/WEB-INF/classes/log4j.properties b/samples/cas/client/src/main/webapp/WEB-INF/classes/log4j.properties deleted file mode 100644 index 25c0b7ce8d..0000000000 --- a/samples/cas/client/src/main/webapp/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Global logging configuration -log4j.rootLogger=INFO, stdout, fileout - -log4j.logger.org.springframework.security=DEBUG - -# Console output... -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n - -# Rolling log file output... -log4j.appender.fileout=org.apache.log4j.RollingFileAppender -log4j.appender.fileout.File=spring-security-cas-client.log -log4j.appender.fileout.MaxFileSize=1024KB -log4j.appender.fileout.MaxBackupIndex=1 -log4j.appender.fileout.layout=org.apache.log4j.PatternLayout -log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n - - diff --git a/samples/cas/pom.xml b/samples/cas/pom.xml deleted file mode 100644 index 273db60a66..0000000000 --- a/samples/cas/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - 4.0.0 - - org.springframework.security - spring-security-samples - 3.1.0.CI-SNAPSHOT - - org.springframework.security - spring-security-samples-cas - Spring Security - CAS Sample Parent - pom - - client - server - - diff --git a/samples/cas/server/pom.xml b/samples/cas/server/pom.xml deleted file mode 100644 index 47bfc96228..0000000000 --- a/samples/cas/server/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - 4.0.0 - - org.springframework.security - spring-security-samples-cas - 3.1.0.CI-SNAPSHOT - - org.springframework.security - spring-security-samples-cas-server - Spring Security - CAS Server for CAS Sample Application - pom - - - - org.mortbay.jetty - maven-jetty-plugin - ${jetty.version} - - /cas - ${basedir}/cas-server-webapp-3.3.5.war - - - 9443 - ../../certificates/server.jks - password - password - ../../certificates/server.jks - password - true - false - - - - - javax.net.ssl.trustStore - ../../certificates/server.jks - - - javax.net.ssl.trustStorePassword - password - - - - - - - \ No newline at end of file diff --git a/samples/cas/client/src/main/java/Dummy.java b/samples/cas/src/main/java/Dummy.java similarity index 100% rename from samples/cas/client/src/main/java/Dummy.java rename to samples/cas/src/main/java/Dummy.java diff --git a/samples/cas/client/src/main/webapp/WEB-INF/applicationContext-security.xml b/samples/cas/src/main/webapp/WEB-INF/applicationContext-security.xml similarity index 100% rename from samples/cas/client/src/main/webapp/WEB-INF/applicationContext-security.xml rename to samples/cas/src/main/webapp/WEB-INF/applicationContext-security.xml diff --git a/samples/cas/client/src/main/webapp/WEB-INF/web.xml b/samples/cas/src/main/webapp/WEB-INF/web.xml similarity index 87% rename from samples/cas/client/src/main/webapp/WEB-INF/web.xml rename to samples/cas/src/main/webapp/WEB-INF/web.xml index eddd6aac17..037d044d57 100644 --- a/samples/cas/client/src/main/webapp/WEB-INF/web.xml +++ b/samples/cas/src/main/webapp/WEB-INF/web.xml @@ -21,11 +21,6 @@ - - log4jConfigLocation - /WEB-INF/classes/log4j.properties - - webAppRootKey cas.root @@ -64,10 +59,6 @@ org.springframework.web.context.ContextLoaderListener - - org.springframework.web.util.Log4jConfigListener - - 403 /casfailed.jsp diff --git a/samples/cas/client/src/main/webapp/cas-logout.jsp b/samples/cas/src/main/webapp/cas-logout.jsp similarity index 100% rename from samples/cas/client/src/main/webapp/cas-logout.jsp rename to samples/cas/src/main/webapp/cas-logout.jsp diff --git a/samples/cas/client/src/main/webapp/casfailed.jsp b/samples/cas/src/main/webapp/casfailed.jsp similarity index 100% rename from samples/cas/client/src/main/webapp/casfailed.jsp rename to samples/cas/src/main/webapp/casfailed.jsp diff --git a/samples/cas/client/src/main/webapp/index.jsp b/samples/cas/src/main/webapp/index.jsp similarity index 100% rename from samples/cas/client/src/main/webapp/index.jsp rename to samples/cas/src/main/webapp/index.jsp diff --git a/samples/cas/client/src/main/webapp/secure/extreme/index.jsp b/samples/cas/src/main/webapp/secure/extreme/index.jsp similarity index 100% rename from samples/cas/client/src/main/webapp/secure/extreme/index.jsp rename to samples/cas/src/main/webapp/secure/extreme/index.jsp diff --git a/samples/cas/client/src/main/webapp/secure/index.jsp b/samples/cas/src/main/webapp/secure/index.jsp similarity index 100% rename from samples/cas/client/src/main/webapp/secure/index.jsp rename to samples/cas/src/main/webapp/secure/index.jsp diff --git a/samples/contacts/contacts.gradle b/samples/contacts/contacts.gradle index 7de196eb97..93cc158ce5 100644 --- a/samples/contacts/contacts.gradle +++ b/samples/contacts/contacts.gradle @@ -23,9 +23,10 @@ dependencies { "org.springframework:spring-context-support:$springVersion", "net.sf.ehcache:ehcache:$ehcacheVersion", "hsqldb:hsqldb:$hsqlVersion", - 'log4j:log4j:1.2.15@jar' + "org.slf4j:jcl-over-slf4j:$slf4jVersion", + "ch.qos.logback:logback-classic:$logbackVersion" } jettyRun { - contextPath = "/tutorial" -} \ No newline at end of file + contextPath = "/contacts" +} diff --git a/samples/contacts/src/main/webapp/WEB-INF/classes/log4j.properties b/samples/contacts/src/main/webapp/WEB-INF/classes/log4j.properties deleted file mode 100644 index 22cdec739e..0000000000 --- a/samples/contacts/src/main/webapp/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Global logging configuration -log4j.rootLogger=INFO, stdout, fileout - -log4j.logger.sample.contact=DEBUG -log4j.logger.org.springframework.web.*=DEBUG -log4j.logger.org.springframework.security=DEBUG - -# Console output... -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n - -# Rolling log file output... -log4j.appender.fileout=org.apache.log4j.RollingFileAppender -log4j.appender.fileout.File=contacts.log -#log4j.appender.fileout.File=${webapp.root}/WEB-INF/log4j.log -log4j.appender.fileout.MaxFileSize=1024KB -log4j.appender.fileout.MaxBackupIndex=1 -log4j.appender.fileout.layout=org.apache.log4j.PatternLayout -log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n diff --git a/samples/contacts/src/main/webapp/WEB-INF/web.xml b/samples/contacts/src/main/webapp/WEB-INF/web.xml index 8166f40687..e398ea8f86 100644 --- a/samples/contacts/src/main/webapp/WEB-INF/web.xml +++ b/samples/contacts/src/main/webapp/WEB-INF/web.xml @@ -26,11 +26,6 @@ - - log4jConfigLocation - /WEB-INF/classes/log4j.properties - - webAppRootKey contacts.root @@ -55,10 +50,6 @@ org.springframework.web.context.ContextLoaderListener - - org.springframework.web.util.Log4jConfigListener - - diff --git a/samples/dms/dms.gradle b/samples/dms/dms.gradle new file mode 100644 index 0000000000..a1c1363436 --- /dev/null +++ b/samples/dms/dms.gradle @@ -0,0 +1,16 @@ + +dependencies { + compile project(':spring-security-core'), + project(':spring-security-acl'), + "org.springframework:spring-beans:$springVersion", + "org.springframework:spring-tx:$springVersion", + "org.springframework:spring-jdbc:$springVersion" + + testCompile "org.springframework:spring-context:$springVersion" + + runtime project(':spring-security-config'), + "hsqldb:hsqldb:$hsqlVersion", + "net.sf.ehcache:ehcache:$ehcacheVersion", + "org.springframework:spring-context-support:$springVersion" + +} diff --git a/samples/dms/src/main/resources/applicationContext-dms-insecure.xml b/samples/dms/src/main/resources/applicationContext-dms-insecure.xml index 0cba9c2f76..fdda3cc9c3 100755 --- a/samples/dms/src/main/resources/applicationContext-dms-insecure.xml +++ b/samples/dms/src/main/resources/applicationContext-dms-insecure.xml @@ -1,12 +1,12 @@ - - - + diff --git a/samples/dms/src/main/resources/applicationContext-dms-secure.xml b/samples/dms/src/main/resources/applicationContext-dms-secure.xml index 457d261170..aa00d294ad 100755 --- a/samples/dms/src/main/resources/applicationContext-dms-secure.xml +++ b/samples/dms/src/main/resources/applicationContext-dms-secure.xml @@ -86,13 +86,13 @@ - org.springframework.security.acls.domain.BasePermission.ADMINISTRATION + - org.springframework.security.acls.domain.BasePermission.READ + - org.springframework.security.acls.domain.BasePermission.WRITE + @@ -123,7 +123,7 @@ - sample.dms.AbstractElement + diff --git a/samples/dms/src/main/resources/applicationContext-dms-shared.xml b/samples/dms/src/main/resources/applicationContext-dms-shared.xml index 4ab91805a0..de98911b05 100755 --- a/samples/dms/src/main/resources/applicationContext-dms-shared.xml +++ b/samples/dms/src/main/resources/applicationContext-dms-shared.xml @@ -1,15 +1,14 @@ - - - - + - + diff --git a/samples/ldap/ldap.gradle b/samples/ldap/ldap.gradle new file mode 100644 index 0000000000..0c7e1790c2 --- /dev/null +++ b/samples/ldap/ldap.gradle @@ -0,0 +1,17 @@ +// LDAP sample build file + +apply plugin: 'war' +apply plugin: 'jetty' + +dependencies { + + runtime project(':spring-security-web'), + project(':spring-security-config'), + project(':spring-security-ldap'), + "org.slf4j:jcl-over-slf4j:$slf4jVersion", + "ch.qos.logback:logback-classic:$logbackVersion" +} + +jettyRun { + contextPath = "/ldap" +} diff --git a/samples/ldap/src/main/webapp/WEB-INF/classes/log4j.properties b/samples/ldap/src/main/webapp/WEB-INF/classes/log4j.properties deleted file mode 100644 index a09253a621..0000000000 --- a/samples/ldap/src/main/webapp/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Global logging configuration -log4j.rootLogger=INFO, stdout, fileout - -log4j.logger.org.springframework.security=DEBUG - -# Console output... -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n - -# Rolling log file output... -log4j.appender.fileout=org.apache.log4j.FileAppender -log4j.appender.fileout.File=spring-security-ldap.log -log4j.appender.fileout.Append=false -log4j.appender.fileout.layout=org.apache.log4j.PatternLayout -log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n - - diff --git a/samples/ldap/src/main/webapp/WEB-INF/classes/logback.xml b/samples/ldap/src/main/webapp/WEB-INF/classes/logback.xml new file mode 100644 index 0000000000..0bbb0e3369 --- /dev/null +++ b/samples/ldap/src/main/webapp/WEB-INF/classes/logback.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + diff --git a/samples/openid/openid.gradle b/samples/openid/openid.gradle index a8d5269831..72445c1e91 100644 --- a/samples/openid/openid.gradle +++ b/samples/openid/openid.gradle @@ -12,5 +12,10 @@ dependencies { runtime project(':spring-security-web'), project(':spring-security-config'), project(':spring-security-taglibs'), - 'log4j:log4j:1.2.15@jar' -} \ No newline at end of file + "org.slf4j:jcl-over-slf4j:$slf4jVersion", + "ch.qos.logback:logback-classic:$logbackVersion" +} + +jettyRun { + contextPath = "/openid" +} diff --git a/samples/openid/src/main/webapp/WEB-INF/classes/log4j.properties b/samples/openid/src/main/webapp/WEB-INF/classes/log4j.properties deleted file mode 100644 index fb9a11852c..0000000000 --- a/samples/openid/src/main/webapp/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,12 +0,0 @@ -# Global logging configuration -log4j.rootLogger=INFO, stdout - -log4j.logger.org.springframework.security=DEBUG - -# Console output... -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.conversionPattern=[%p,%c{1}] %m%n - - - diff --git a/samples/openid/src/main/webapp/WEB-INF/web.xml b/samples/openid/src/main/webapp/WEB-INF/web.xml index 600ab6d539..8da147bfbe 100644 --- a/samples/openid/src/main/webapp/WEB-INF/web.xml +++ b/samples/openid/src/main/webapp/WEB-INF/web.xml @@ -21,11 +21,6 @@ - - log4jConfigLocation - /WEB-INF/classes/log4j.properties - - webAppRootKey openid.root @@ -50,8 +45,4 @@ org.springframework.web.context.ContextLoaderListener - - org.springframework.web.util.Log4jConfigListener - - diff --git a/samples/pom.xml b/samples/pom.xml index 0c4c7d8849..4563b207d1 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -16,7 +16,6 @@ preauth openid ldap - cas aspectj diff --git a/samples/preauth/preauth.gradle b/samples/preauth/preauth.gradle new file mode 100644 index 0000000000..74a0dac96e --- /dev/null +++ b/samples/preauth/preauth.gradle @@ -0,0 +1,17 @@ +// Preauth sample build file + +apply plugin: 'war' +apply plugin: 'jetty' + +dependencies { + + runtime project(':spring-security-web'), + project(':spring-security-config'), + "org.slf4j:jcl-over-slf4j:$slf4jVersion", + "ch.qos.logback:logback-classic:$logbackVersion" +} + +jettyRun { + contextPath = "/preauth" + userRealms = [new org.mortbay.jetty.security.HashUserRealm('Preauth Realm', "$projectDir/realm.properties")] +} diff --git a/samples/preauth/src/main/webapp/WEB-INF/classes/log4j.properties b/samples/preauth/src/main/webapp/WEB-INF/classes/log4j.properties deleted file mode 100644 index f491147825..0000000000 --- a/samples/preauth/src/main/webapp/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Global logging configuration -log4j.rootLogger=INFO, stdout, fileout - -log4j.logger.org.springframework.security=DEBUG, stdout, fileout - -# Console output... -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n - -# Rolling log file output... -log4j.appender.fileout=org.apache.log4j.RollingFileAppender -log4j.appender.fileout.File=spring-security-preauth.log -#log4j.appender.fileout.File=${webapp.root}/WEB-INF/log4j.log -log4j.appender.fileout.MaxFileSize=1024KB -log4j.appender.fileout.MaxBackupIndex=1 -log4j.appender.fileout.layout=org.apache.log4j.PatternLayout -log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n - - diff --git a/samples/tutorial/tutorial.gradle b/samples/tutorial/tutorial.gradle index 47ab84cd74..dc991eaad0 100644 --- a/samples/tutorial/tutorial.gradle +++ b/samples/tutorial/tutorial.gradle @@ -17,7 +17,6 @@ dependencies { project(':spring-security-config'), project(':spring-security-taglibs'), "org.slf4j:jcl-over-slf4j:$slf4jVersion", - "org.slf4j:slf4j-jdk14:$slf4jVersion", "ch.qos.logback:logback-core:$logbackVersion", "ch.qos.logback:logback-classic:$logbackVersion" } diff --git a/settings.gradle b/settings.gradle index b2c79a3c38..88c45c3dc3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,7 +15,11 @@ def String[] samples = [ 'contacts', 'openid', 'aspectj', - 'gae' + 'gae', + 'dms', + 'preauth', + 'cas', + 'ldap' ] def String[] docs = [ @@ -65,4 +69,4 @@ docs.each { name -> rootProject.children.each {project -> assert project.projectDir.isDirectory() assert project.buildFile.isFile() -} \ No newline at end of file +}