Skip to content

Commit 5356a52

Browse files
authored
Merge pull request #167 from AtlasOfLivingAustralia/develop
Merge develop to master
2 parents b983f74 + 958a64c commit 5356a52

28 files changed

+834
-136
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
language: groovy
22
jdk:
3-
- openjdk8
3+
- openjdk11
44
sudo: false
55
branches:
66
only:
77
- master
88
- develop
9+
- feature_oidcIntegration
910
before_cache:
1011
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
1112
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
@@ -21,5 +22,6 @@ after_success:
2122
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && travis_retry ./gradlew publish'
2223
env:
2324
global:
25+
- JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2
2426
- secure: OqyYLYoeTw2ifeopsXEQnLDF8DA5j12iSH9mKGXjE6abkrhXCghWOtb+jGstRvJr/ZrpJfFK3VOkistgkf6y8/RYxB7a0MJsr+1GUXtdHhtPbUcShJDybj6AlbgPCI2J4VdIQSB+ey2XZKOMOO3+XwbsczrTHBh5KpBHdI7Tw8I=
2527
- secure: XvAZn/Iv/HVBcR3DiDrNhOvMy4LVvrH0eM7jims9Kyhwb6YvZc8aD2MpgfR9pEcKpyy5zSx/EKYKbB6rf5tzjjEOSgCCrYfoqNB2e1/pqNnzMsblEpRC3IsHOYs7bQwckKOclQ1pP/6BzjxSKzZNQG+dQT+KhfPPmWj4Ky+hmN0=

build.gradle

+25-20
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,29 @@ buildscript {
1919
}
2020
dependencies {
2121
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
22-
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.1"
23-
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
22+
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.3.2"
23+
classpath "org.grails.plugins:hibernate5:7.0.2"
24+
classpath 'org.grails.plugins:quartz:2.0.13'
2425
}
2526
}
2627

2728
plugins {
2829
id "com.gorylenko.gradle-git-properties" version "1.4.17"
2930
}
3031

31-
version "1.6"
32+
33+
version "2.0.0-SNAPSHOT"
3234
group "au.org.ala"
3335

3436
apply plugin:"eclipse"
3537
apply plugin:"idea"
3638
apply plugin:"war"
3739
apply plugin:"org.grails.grails-web"
3840
apply plugin:"org.grails.grails-gsp"
39-
apply plugin:"asset-pipeline"
41+
apply plugin:"com.bertramlabs.asset-pipeline"
4042

41-
apply from: 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/travis_grails_publish.gradle'
43+
//apply from: 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/travis_grails_publish.gradle'
44+
apply from: "${project.projectDir}/gradle/publish.gradle"
4245

4346
sourceCompatibility = 1.8
4447
targetCompatibility = 1.8
@@ -75,20 +78,21 @@ dependencies {
7578
compile "org.grails:grails-plugin-services"
7679
compile "org.grails:grails-plugin-url-mappings"
7780
compile "org.grails:grails-plugin-interceptors"
78-
compile "org.grails.plugins:cache"
7981
compile "org.grails.plugins:async"
8082
compile "org.grails.plugins:scaffolding"
8183
compile "org.grails.plugins:events"
8284
compile "org.grails.plugins:hibernate5"
83-
compile "org.hibernate:hibernate-core:5.1.16.Final"
84-
compile "org.hibernate:hibernate-ehcache:5.1.16.Final"
85+
// compile "org.hibernate:hibernate-core:5.4.0.Final"
86+
// compile "org.hibernate:hibernate-ehcache:5.4.0.Final"
87+
compile "org.hibernate:hibernate-jcache"
88+
8589
compile "org.grails.plugins:gsp"
8690
console "org.grails:grails-console"
8791
profile "org.grails.profiles:web"
8892
runtime "org.glassfish.web:el-impl:2.1.2-b03"
8993
runtime "com.h2database:h2"
9094
runtime "org.apache.tomcat:tomcat-jdbc"
91-
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
95+
runtime "com.bertramlabs.plugins:asset-pipeline-grails:3.3.2"
9296

9397
//compile "org.grails.plugins:grails-plugin-converters" // only needed for grails 3.3
9498
//testCompile "org.grails:grails-plugin-testing"
@@ -98,20 +102,20 @@ dependencies {
98102
testCompile "org.grails:grails-test-mixins:3.3.0"
99103

100104
// Grails plugin dependencies
101-
runtime "org.grails.plugins:ala-bootstrap3:3.2.3", noCache
102-
compile "org.grails.plugins:ala-ws-security-plugin:2.0", noCache
103-
compile "org.grails.plugins:ala-ws-plugin:2.0", noCache
104-
compile "org.grails.plugins:ala-auth:3.1.3", noCache
105-
compile "org.grails.plugins:ala-admin-plugin:2.1"
105+
runtime "org.grails.plugins:ala-bootstrap3:4.1.0", noCache
106+
compile "org.grails.plugins:ala-ws-security-plugin:4.1.1", noCache
107+
compile "org.grails.plugins:ala-ws-plugin:3.1.0", noCache
108+
compile "org.grails.plugins:ala-auth:5.1.0", noCache
109+
compile "org.grails.plugins:ala-admin-plugin:2.3.0"
106110
//compile 'au.org.ala:userdetails-service-client:1.4.0' // TODO remove this line once updated version is included in ala-auth
107111

108-
compile 'org.grails.plugins:external-config:1.1.1'
109-
compile 'org.grails.plugins:mail:2.0.0.RC6'
112+
compile 'org.grails.plugins:external-config:2.0.0'
113+
compile 'org.grails.plugins:mail:3.0.0'
110114
compile 'org.grails.plugins:http-builder-helper:1.0.2.ALA'
111115
compile 'org.grails.plugins:schwartz-monitor:2.0.1.ALA-SNAPSHOT'
112-
compile 'org.grails.plugins:quartz:2.0.12'
113-
compile 'org.grails.plugins:cache:4.0.1'
114-
compile 'org.grails.plugins:cache-ehcache:3.0.0.M1'
116+
compile 'org.grails.plugins:quartz:2.0.13'
117+
compile 'org.grails.plugins:cache:4.0.2'
118+
compile 'org.grails.plugins:cache-ehcache:3.0.0'
115119

116120
// regular JAR dependencies
117121
runtime 'mysql:mysql-connector-java:8.0.25'
@@ -127,11 +131,12 @@ dependencies {
127131
//runtime 'org.apache.httpcomponents:httpclient:4.2.2'
128132
compile 'com.jayway.jsonpath:json-path:0.5.6'
129133
compile 'com.jayway.jsonpath:json-path-assert:0.5.6'
134+
compile 'au.org.ala.plugins:openapi:1.1.0'
130135
}
131136

132137
bootRun {
133138
jvmArgs('-Dspring.output.ansi.enabled=always')
134-
addResources = true
139+
sourceResources sourceSets.main
135140
String springProfilesActive = 'spring.profiles.active'
136141
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
137142
}

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
grailsVersion=3.3.9
2-
gormVersion=6.1.11.RELEASE
3-
gradleWrapperVersion=3.5
1+
grailsVersion=4.1.1
2+
gormVersion=7.0.8.RELEASE
3+
gradleWrapperVersion=5.0

gradle/publish.gradle

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apply plugin:"maven-publish"
2+
3+
publishing {
4+
repositories {
5+
maven {
6+
name 'Nexus'
7+
url "https://nexus.ala.org.au/content/repositories/${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'releases' }"
8+
credentials {
9+
username = System.getenv('TRAVIS_DEPLOY_USERNAME')
10+
password = System.getenv('TRAVIS_DEPLOY_PASSWORD')
11+
}
12+
}
13+
}
14+
publications {
15+
mavenJar(MavenPublication) {
16+
pom.withXml {
17+
def pomNode = asNode()
18+
pomNode.dependencyManagement.replaceNode {}
19+
20+
// simply remove dependencies without a version
21+
// version-less dependencies are handled with dependencyManagement
22+
// see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
23+
pomNode.dependencies.dependency.findAll {
24+
it.version.text().isEmpty()
25+
}.each {
26+
it.replaceNode {}
27+
}
28+
}
29+
from components.web
30+
}
31+
}
32+
}

gradle/wrapper/gradle-wrapper.jar

1.49 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Tue Aug 08 11:44:31 AEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip

gradlew

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ APP_NAME="Gradle"
2828
APP_BASE_NAME=`basename "$0"`
2929

3030
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
31+
DEFAULT_JVM_OPTS='"-Xmx64m"'
3232

3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
3535

36-
warn ( ) {
36+
warn () {
3737
echo "$*"
3838
}
3939

40-
die ( ) {
40+
die () {
4141
echo
4242
echo "$*"
4343
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155155
fi
156156

157157
# Escape application args
158-
save ( ) {
158+
save () {
159159
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160160
echo " "
161161
}
@@ -169,4 +169,4 @@ if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169169
cd "$(dirname "$0")"
170170
fi
171171

172-
exec "$JAVACMD" "$@"
172+
exec "$JAVACMD" "$@"

gradlew.bat

+4-10
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
@rem Set local scope for the variables with windows NT shell
99
if "%OS%"=="Windows_NT" setlocal
1010

11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
1411
set DIRNAME=%~dp0
1512
if "%DIRNAME%" == "" set DIRNAME=.
1613
set APP_BASE_NAME=%~n0
1714
set APP_HOME=%DIRNAME%
1815

16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS="-Xmx64m"
18+
1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome
2121

@@ -46,10 +46,9 @@ echo location of your Java installation.
4646
goto fail
4747

4848
:init
49-
@rem Get command-line arguments, handling Windowz variants
49+
@rem Get command-line arguments, handling Windows variants
5050

5151
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5352

5453
:win9xME_args
5554
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
6059
if "x%~1" == "x" goto execute
6160

6261
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6862

6963
:execute
7064
@rem Setup the command line

grails-app/conf/application.yml

+36-11
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ spring:
3838
groovy:
3939
template:
4040
check-template-location: false
41-
4241
# Spring Actuator Endpoints are Disabled by Default
43-
endpoints:
44-
enabled: true
4542
jmx:
46-
enabled: true
43+
unique-names: true
44+
management:
45+
endpoints:
46+
enabled-by-default: true
4747

4848
---
4949
grails:
@@ -97,10 +97,6 @@ grails:
9797
scriptlets: html
9898
taglib: none
9999
staticparts: none
100-
endpoints:
101-
jmx:
102-
unique-names: true
103-
enabled: true
104100
---
105101
headerAndFooter:
106102
baseURL: "https://www.ala.org.au/commonui-bs3-2019"
@@ -117,7 +113,7 @@ siteDefaultLanguage: "en"
117113
security:
118114
cas:
119115
adminRole: ROLE_ADMIN
120-
uriFilterPattern: "/,/alaAdmin.*,/testAuth.*,/query/.*,/admin/?.*,/admin/user/.*,/admin/user/debug/.*,/admin/debug/all,/notification/myAlerts,/notification/changeFrequency,/notification/addMyAlert,/notification/addMyAlert/.*,/notification/deleteMyAlert/.*,/notification/deleteMyAlert/.*,/notification/deleteMyAlertWR/.*,/webservice/.*,/webservice/createTaxonAlert,/webservice/taxonAlerts,/webservice/createRegionAlert,/webservice/regionAlerts,/webservice/deleteTaxonAlert/.*,/webservice/create*,/webservice/createSpeciesGroupRegionAlert,/ws/.*,/ws/createTaxonAlert,/ws/taxonAlerts,/ws/createRegionAlert,/ws/regionAlerts,/ws/deleteTaxonAlert/.*,/ws/createTaxonRegionAlert,/ws/createSpeciesGroupRegionAlert,/admin/runChecksNow"
116+
uriFilterPattern: ["/","/alaAdmin/*","/testAuth/*","/query/*","/admin/*","/admin/user/*","/admin/user/debug/*","/admin/debug/all","/notification/myAlerts","/notification/changeFrequency","/notification/addMyAlert","/notification/addMyAlert/*","/notification/deleteMyAlert/*","/notification/deleteMyAlert/*","/notification/deleteMyAlertWR/*","/webservice/*","/webservice/createTaxonAlert","/webservice/taxonAlerts","/webservice/createRegionAlert","/webservice/regionAlerts","/webservice/deleteTaxonAlert/*","/webservice/create*","/webservice/createSpeciesGroupRegionAlert","/ws/*","/ws/createTaxonAlert","/ws/taxonAlerts","/ws/createRegionAlert","/ws/regionAlerts","/ws/deleteTaxonAlert/*","/ws/createTaxonRegionAlert","/ws/createSpeciesGroupRegionAlert","/admin/runChecksNow"]
121117

122118
postie:
123119
emailSender: "atlas-alerts@ala.org.au"
@@ -195,7 +191,7 @@ hibernate:
195191
use_second_level_cache: true
196192
use_query_cache: true
197193
region:
198-
factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
194+
factory_class: org.hibernate.cache.jcache.internal.JCacheRegionFactory
199195

200196
dataSource:
201197
pooled: true
@@ -249,4 +245,33 @@ environments:
249245
dbCreate: none
250246

251247
myannotation:
252-
enabled: false
248+
enabled: false
249+
250+
security:
251+
cas:
252+
enabled: false
253+
oidc:
254+
enabled: true
255+
discoveryUri: https://auth-dev.ala.org.au/cas/oidc/.well-known
256+
scope: openid,profile,email,ala,roles,user_defined
257+
# allowUnsignedIdTokens: true
258+
jwt:
259+
enabled: true
260+
discoveryUri: https://auth-dev.ala.org.au/cas/oidc/.well-known
261+
fallbackToLegacyBehaviour: true
262+
263+
openapi:
264+
title: Alerts REST services
265+
description: REST services for interacting with the alerts webapp
266+
terms: https://www.ala.org.au/terms
267+
contact:
268+
name: Support
269+
email: support@ala.org.au
270+
license:
271+
name: Mozilla Public License 1.1
272+
url: https://www.mozilla.org/en-US/MPL/1.1/
273+
version: '@info.app.version@'
274+
cachetimeoutms: 0
275+
276+
webservice:
277+
jwt: true

grails-app/conf/logback.groovy

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ root(WARN, [APPENDER])
118118
// 'au.org.ala'
119119
],
120120
(DEBUG): [ // DEBUG and TRACE should only be enabled for non-production environments
121+
'au.org.ala.alerts'
121122
],
122123
(TRACE): [
123124
]

grails-app/controllers/au/org/ala/alerts/AdminController.groovy

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
package au.org.ala.alerts
1515

1616
import au.org.ala.web.AlaSecured
17+
import grails.gorm.transactions.Transactional
1718
import grails.util.Holders
1819
import groovy.json.JsonSlurper
1920
import org.apache.http.client.methods.HttpPost
2021
import org.apache.http.impl.client.DefaultHttpClient
2122

23+
@Transactional
2224
@AlaSecured(value = 'ROLE_ADMIN', redirectController = 'notification', redirectAction = 'myAlerts', message = "You don't have permission to view that page.")
2325
class AdminController {
2426

@@ -253,7 +255,7 @@ class AdminController {
253255
def query = Query.get(1)
254256
def frequency = Frequency.get(1)
255257
def queryResult = QueryResult.findByQuery(query) ?: new QueryResult(query: query, frequency: frequency)
256-
emailService.sendGroupEmail(query, [user.email], queryResult, [], frequency, 0, "", "")
258+
emailService.sendGroupEmail(query, [user.email], queryResult, [], frequency, 0, "", "", [:], [:])
257259
msg = "Email was sent to ${user.email} - check tomcat logs for ERROR message with value \"Error sending email to addresses:\""
258260
} else {
259261
msg = "User was not found or not logged in"

grails-app/controllers/au/org/ala/alerts/NotificationController.groovy

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package au.org.ala.alerts
22

33
import grails.converters.JSON
44
import org.apache.http.HttpStatus
5+
import grails.gorm.transactions.Transactional
56

7+
@Transactional
68
class NotificationController {
79

810
def notificationService
@@ -94,7 +96,7 @@ class NotificationController {
9496
}
9597

9698
def changeFrequency = {
97-
def user = userService.getUser()
99+
def user = getUser()
98100
log.debug("Changing frequency to: " + params.frequency + " for user ${user}")
99101
notificationService.updateFrequency(user, params.frequency)
100102
return null

grails-app/controllers/au/org/ala/alerts/QueryController.groovy

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package au.org.ala.alerts
22

33
import au.org.ala.web.AlaSecured
4+
import grails.gorm.transactions.Transactional
45
import grails.util.Holders
56
import org.springframework.dao.DataIntegrityViolationException
67

8+
@Transactional
79
class QueryController {
810

911
static allowedMethods = [save: "POST", update: "POST", update: "PUT", delete: "POST"]

0 commit comments

Comments
 (0)