Skip to content

Commit

Permalink
Upgrading to the latest versions of Grails and Spring Security Core
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosanchez committed Mar 3, 2018
1 parent e20dc39 commit 75d026f
Show file tree
Hide file tree
Showing 39 changed files with 104 additions and 120 deletions.
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ subprojects { Project project ->
compile "org.grails:grails-core"

provided "org.grails:grails-plugin-services"
provided "org.grails:grails-plugin-domain-class"

testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails:grails-web-testing-support"
testCompile('com.athaydes:spock-reports:1.2.13') {
transitive = false
}
Expand Down Expand Up @@ -96,7 +99,9 @@ subprojects { Project project ->
userOrg = 'grails'
repo = 'plugins'
githubSlug = 'alvarosanchez/grails-spring-security-rest'
license = 'APACHE 2.0'
license {
name = 'Apache-2.0'
}
title = "Spring Security REST plugin"
desc = "Grails plugin to implement token-based, RESTful authentication using Spring Security"
developers = [
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
grailsVersion=3.2.3
gradleWrapperVersion=3.2.1
grailsVersion=3.3.2
springSecurityCoreVersion=3.2.1
gradleWrapperVersion=3.5
bintrayUser=alvarosanchez
pluginPortalUser=alvaro.sanchez
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Nov 30 17:05:28 EST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
7 changes: 0 additions & 7 deletions spring-security-rest-gorm/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

dependencies {
compile project(":spring-security-rest")
profile "org.grails.profiles:plugin:${grailsVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package grails.plugin.springsecurity.rest.gorm

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
import grails.plugins.metadata.PluginSource

@PluginSource
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
Expand Down
7 changes: 0 additions & 7 deletions spring-security-rest-grailscache/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

dependencies {
compile project(":spring-security-rest")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package grails.plugin.springsecurity.rest.grailscache

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
import grails.plugins.metadata.PluginSource

@PluginSource
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
package grails.plugin.springsecurity.rest.token.storage

import grails.plugin.cache.GrailsCacheManager
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.grails.plugin.cache.GrailsCacheManager
import org.springframework.cache.Cache
import org.springframework.security.core.userdetails.UserDetails

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
*/
package grails.plugin.springsecurity.rest.token.storage

import grails.plugin.cache.GrailsCacheManager
import grails.plugin.cache.GrailsConcurrentMapCacheManager
import grails.plugin.springsecurity.rest.token.storage.GrailsCacheTokenStorageService
import grails.plugin.springsecurity.rest.token.storage.TokenNotFoundException
import org.grails.plugin.cache.GrailsCacheManager
import org.springframework.security.core.userdetails.User
import spock.lang.Specification

Expand Down
8 changes: 0 additions & 8 deletions spring-security-rest-memcached/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

dependencies {
compile project(":spring-security-rest")
compile "net.spy:spymemcached:2.12.3"


profile "org.grails.profiles:plugin:${grailsVersion}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package grails.plugin.springsecurity.rest.memcached

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
import grails.plugins.metadata.PluginSource

@PluginSource
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
Expand Down
7 changes: 0 additions & 7 deletions spring-security-rest-redis/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

dependencies {
compile project(":spring-security-rest")
compile "org.grails.plugins:grails-redis:2.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package grails.plugin.springsecurity.rest.redis

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
import grails.plugins.metadata.PluginSource

@PluginSource
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
Expand Down
2 changes: 1 addition & 1 deletion spring-security-rest-testapp-profile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}

dependencies {
runtime "org.grails.profiles:web:3.2.1"
runtime "org.grails.profiles:web:${grailsVersion}"
}

task installKeys << {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
description: First configuration of GORM
dependencies:
build:
- "org.grails.plugins:hibernate5:6.0.4"
- "org.grails.plugins:hibernate5:6.1.8"
compile:
- "org.grails.plugins:hibernate5"
- "org.hibernate:hibernate-core:5.1.1.Final"
- "org.hibernate:hibernate-ehcache:5.1.1.Final"
- "org.hibernate:hibernate-core:5.1.5.Final"
- "org.hibernate:hibernate-ehcache:5.1.5.Final"
- "org.hibernate:hibernate-ehcache"
- "org.grails.plugins:spring-security-rest-gorm:${pluginVersion}"
runtime:
- "com.h2database:h2"
- "com.h2database:h2"
- "org.apache.tomcat:tomcat-jdbc"
- "org.glassfish.web:el-impl:2.1.2-b03"
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
hibernate:
cache:
queries: false
use_second_level_cache: true
use_second_level_cache: false
use_query_cache: false
region.factory_class: 'org.hibernate.cache.ehcache.EhCacheRegionFactory'

dataSource:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
username: sa
password:
password: ''

environments:
development:
Expand All @@ -23,7 +21,7 @@ environments:
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
dbCreate: update
dbCreate: none
url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
description: Second configuration of GORM
dependencies:
build:
- "org.grails.plugins:hibernate5:6.0.4"
- "org.grails.plugins:hibernate5:6.1.8"
compile:
- "org.grails.plugins:hibernate5"
- "org.hibernate:hibernate-core:5.1.1.Final"
- "org.hibernate:hibernate-ehcache:5.1.1.Final"
- "org.hibernate:hibernate-core:5.1.5.Final"
- "org.hibernate:hibernate-ehcache:5.1.5.Final"
- "org.hibernate:hibernate-ehcache"
- "org.grails.plugins:spring-security-rest-gorm:${pluginVersion}"
runtime:
- "com.h2database:h2"
- "com.h2database:h2"
- "org.apache.tomcat:tomcat-jdbc"
- "org.glassfish.web:el-impl:2.1.2-b03"
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
hibernate:
cache:
queries: false
use_second_level_cache: true
use_second_level_cache: false
use_query_cache: false
region.factory_class: 'org.hibernate.cache.ehcache.EhCacheRegionFactory'

dataSource:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
username: sa
password:
password: ''

environments:
development:
Expand All @@ -23,7 +21,7 @@ environments:
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
dbCreate: update
dbCreate: none
url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ package redis
import grails.plugin.springsecurity.rest.token.storage.RedisTokenStorageService
import grails.plugin.springsecurity.rest.token.storage.TokenNotFoundException
import grails.plugins.redis.RedisService
import grails.test.mixin.integration.Integration
import grails.testing.mixin.integration.Integration
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.security.core.userdetails.User
import org.springframework.security.core.userdetails.UserDetails
import spock.lang.Specification

import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT

@Integration
@SpringBootTest(webEnvironment = DEFINED_PORT)
class RedisSpec extends Specification {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ package redis
import grails.plugin.springsecurity.rest.token.storage.RedisTokenStorageService
import grails.plugin.springsecurity.rest.token.storage.TokenNotFoundException
import grails.plugins.redis.RedisService
import grails.test.mixin.integration.Integration
import grails.testing.mixin.integration.Integration
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.security.core.userdetails.User
import org.springframework.security.core.userdetails.UserDetails
import spock.lang.Specification

import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT

@Integration
@SpringBootTest(webEnvironment = DEFINED_PORT)
class RedisSpec extends Specification {

@Autowired
Expand Down
4 changes: 2 additions & 2 deletions spring-security-rest-testapp-profile/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
grailsVersion=3.2.3
gradleWrapperVersion=3.2.1
grailsVersion=3.3.2
gradleWrapperVersion=3.5
3 changes: 2 additions & 1 deletion spring-security-rest-testapp-profile/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ build:
- org.grails.grails-core
dependencies:
compile:
- "org.grails.plugins:spring-security-rest:2.0.0.BUILD-SNAPSHOT"
- "org.grails.plugins:spring-security-rest:2.0.0.RC1"
- "org.grails:grails-datastore-rest-client"
testCompile:
- "org.grails.plugins:geb"
- "com.codeborne:phantomjsdriver:1.2.1"
- "org.seleniumhq.selenium:selenium-api:2.47.1"
- "org.seleniumhq.selenium:selenium-remote-driver:2.47.1"
Expand Down
1 change: 1 addition & 0 deletions spring-security-rest-testapp-profile/profile.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- "org.grails.plugins:spring-security-rest:${pluginVersion}"
- "org.grails:grails-datastore-rest-client"
testCompile:
- "org.grails.plugins:geb"
- "com.codeborne:phantomjsdriver:1.2.1"
- "org.seleniumhq.selenium:selenium-api:2.47.1"
- "org.seleniumhq.selenium:selenium-remote-driver:2.47.1"
Expand Down
2 changes: 2 additions & 0 deletions spring-security-rest-testapp-profile/skeleton/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ integrationTest {

systemProperty 'geb.build.reportsDir', "${buildDir}/geb-reports"

systemProperty "geb.env", System.getProperty('geb.env')

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
package rest

import grails.plugins.rest.client.RestBuilder
import grails.test.mixin.integration.Integration
import org.springframework.boot.test.WebIntegrationTest
import grails.testing.mixin.integration.Integration
import org.springframework.boot.test.context.SpringBootTest
import spock.lang.Shared
import spock.lang.Specification

import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT

@Integration
@WebIntegrationTest(randomPort=false)
@SpringBootTest(webEnvironment = DEFINED_PORT)
abstract class AbstractRestSpec extends Specification {

@Shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
*/
package rest

import grails.testing.mixin.integration.Integration
import org.springframework.boot.test.context.SpringBootTest
import geb.spock.GebReportingSpec
import grails.test.mixin.integration.Integration
import org.springframework.boot.test.WebIntegrationTest
import spock.lang.IgnoreIf
import spock.lang.Ignore

import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT

@Integration
@WebIntegrationTest(randomPort=false)
//@IgnoreIf({ !System.getProperty('useFacebook', 'false').toBoolean() || !System.getenv('FB_PASSWORD') })
@Ignore // TODO: Need to update the Facebook credentials used on Travis CI as this test currently fails with an OAuthException
@SpringBootTest(webEnvironment = DEFINED_PORT)
@IgnoreIf({ !System.getProperty('useFacebook', 'false').toBoolean() || !System.getenv('FB_PASSWORD') })
class FacebookSpec extends GebReportingSpec {

void "it can sign users in with Facebook"() {
Expand Down
Loading

0 comments on commit 75d026f

Please sign in to comment.