Skip to content

Commit

Permalink
Merge pull request #215 from AtlasOfLivingAustralia/epic/cognito/develop
Browse files Browse the repository at this point in the history
Epic/cognito/develop
  • Loading branch information
yasima-csiro authored Feb 18, 2025
2 parents a87881b + 69b078a commit d3a3ebb
Show file tree
Hide file tree
Showing 299 changed files with 13,221 additions and 2,934 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: groovy
jdk:
- openjdk11
- openjdk17
sudo: false
branches:
only:
Expand All @@ -11,6 +11,11 @@ branches:
- grails3
- experimental_jwt
- /^feature.*$/
- epic/cognito/userServiceRefactor&PasswordReset
- epic/cognito/develop
- epic/cognito/cleanup-2
- epic/cognito/fix-asset-pipeline-issue
- epic/cognito/openapi_fix
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
Expand All @@ -21,6 +26,10 @@ cache:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

install:
- 'travis_wait 30 ./gradlew clean'
- './gradlew assemble'

after_success:
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && travis_retry ./gradlew publish'
env:
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use Ubuntu 24.04 as the base image
FROM ubuntu:24.04

# Set environment variables for non-interactive installations
ENV DEBIAN_FRONTEND=noninteractive

# Update package list and install OpenJDK 17
RUN apt-get update && apt-get install -y \
openjdk-17-jdk \
&& rm -rf /var/lib/apt/lists/*

# Set JAVA_HOME environment variable
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV PATH=$JAVA_HOME/bin:$PATH

WORKDIR /app
COPY userdetails-cognito/build/libs/*-exec.war app.war
CMD ["java", "-jar", "app.war"]
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ userdetails

## Note

v2.0 of userdetails requires [ALA CAS 5](https://github.com/AtlasOfLivingAustralia/ala-cas-5)
v4.0 of userdetails requires [ALA CAS 5](https://github.com/AtlasOfLivingAustralia/ala-cas-5) v6.6+ or AWS Cognito

## About
The Atlas user management app (userdetails) manages profile information for users.
Expand All @@ -13,11 +13,15 @@ This application is the central repository for user information for Atlas system

Userdetails works hand in hand with [ALA CAS 5](https://github.com/AtlasOfLivingAustralia/ala-cas-5) and both share the same underlying database.

CAS manages the local authentication as well as third party auth provider integrtion.
CAS manages the local authentication as well as third party auth provider integration.


## General Information

### Builds

This project will build 3 artifacts, 2 concrete implementations of the user details app (userdetails-gorm for CAS and userdetails-cognito for AWS Cognito) and the userdetails-plugin that handles all commmon functions.

### Technologies
* Grails framework: 3.2.11
* JQuery
Expand Down
249 changes: 3 additions & 246 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,247 +1,4 @@
//import static org.springframework.boot.gradle.SpringBootPluginExtension.LayoutType.*

buildscript {
repositories {
maven { url "https://nexus.ala.org.au/content/groups/public/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.6"
classpath "org.grails.plugins:hibernate5:7.3.0"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.6"
}
}

plugins {
id "com.gorylenko.gradle-git-properties" version "2.4.1"
}

version "3.3.0-SNAPSHOT"
group "au.org.ala"

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:"com.bertramlabs.asset-pipeline"
apply plugin:"org.grails.grails-gsp"
apply plugin:"maven-publish"

sourceCompatibility = 1.11
targetCompatibility = 1.11

repositories {
mavenLocal()
maven { url "https://nexus.ala.org.au/content/groups/public/" }
maven { url "https://repo.grails.org/grails/core" }
mavenCentral()
}

configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}

//grails {
// plugins {
// compile project(':openapi-plugin')
// }
//}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
compileOnly "io.micronaut:micronaut-inject-groovy"
console "org.grails:grails-console"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.grails:grails-core"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
implementation "org.grails:grails-web-boot"
implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails.plugins:cache"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:scaffolding"
implementation "org.grails.plugins:events"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:5.6.9.Final"
implementation "org.hibernate:hibernate-jcache"
runtimeOnly 'org.ehcache:ehcache'
implementation "org.grails.plugins:gsp"
profile "org.grails.profiles:web"
runtimeOnly "org.glassfish.web:el-impl:2.2.1-b05"
// runtimeOnly "com.h2database:h2"
// runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.4.6"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails.plugins:geb"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:4.0.0"
testImplementation "org.seleniumhq.selenium:selenium-api:4.0.0"
testImplementation "org.seleniumhq.selenium:selenium-support:4.0.0"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:4.0.0"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:4.0.0"

// Groovy backwards compat
runtimeOnly 'org.codehaus.groovy:groovy-dateutil'

// Grails plugin dependencies

implementation "org.grails.plugins:ala-bootstrap3:4.1.0"
implementation "org.grails.plugins:ala-ws-plugin:3.1.1"
implementation "org.grails.plugins:ala-ws-security-plugin:4.1.1"
implementation "org.grails.plugins:ala-auth:5.1.1"
implementation "org.grails.plugins:ala-admin-plugin:2.3.0"

implementation 'dk.glasius:external-config:3.1.0'
implementation 'org.grails.plugins:http-builder-helper:1.1.0'
implementation "org.grails.plugins:csv:1.0.1"
implementation 'org.grails.plugins:mail:3.0.0'

implementation "org.grails.plugins:oauth:4.0.0"
// transitive oauth plugin deps used in code
implementation "com.github.scribejava:scribejava-core:4.0.0"
implementation "com.github.scribejava:scribejava-apis:4.0.0"

implementation "domurtag.plugins:grails-simple-captcha:1.0.0-grails3"
implementation "org.grails.plugins:export:2.0.0"
implementation 'org.grails.plugins:grails-markdown:3.0.0'

// regular JAR dependencies

implementation 'com.zaxxer:HikariCP:5.0.1'
implementation 'mysql:mysql-connector-java:8.0.29'
testRuntimeOnly "com.h2database:h2"
implementation 'com.google.guava:guava:21.0'
implementation 'org.apache.httpcomponents:httpcore:4.3.3'
implementation 'org.apache.httpcomponents:httpclient:4.3.3'
implementation 'org.apache.httpcomponents:httpmime:4.3.3'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'commons-io:commons-io:2.6'
implementation 'commons-beanutils:commons-beanutils:1.8.3'
implementation 'org.mindrot:jbcrypt:0.4'
implementation 'com.opencsv:opencsv:5.5.2'

implementation 'org.springframework.session:spring-session-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.grails.plugins:spring-session-helper:2.0.1'
implementation 'org.mongodb:mongodb-driver-sync:4.6.0' // versions mismatch as transitive deps for
implementation 'org.mongodb:mongodb-driver-core:4.6.0'
implementation 'org.mongodb:bson:4.6.0'

// implementation "com.auth0:java-jwt:3.18.2"
// implementation "com.auth0:jwks-rsa:0.20.0"

// Spring Security to secure actuator endpoints
// TODO Upgrade or decommission boot admin
// compile 'de.codecentric:spring-boot-admin-starter-client:2.6.2'
// compile 'org.springframework.boot:spring-boot-starter-security'
// compile 'org.springframework.security:spring-security-web'

implementation('org.webjars.bower:chosen:1.8.3')
implementation('org.webjars.bower:chosen-bootstrap:1.1.0') {
exclude module: 'jquery' // dependency from skin
exclude module: 'bootstrap' // dependency from skin
}

implementation 'org.passay:passay:1.6.0'

implementation('au.org.ala.plugins:openapi:1.1.0')

testImplementation('com.squareup.retrofit2:retrofit-mock:2.9.0')
}

springBoot {
buildInfo()
}

bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}

bootWar {
launchScript()
classifier = 'exec'
}

tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}

tasks.withType(Test) {
useJUnitPlatform()
}

webdriverBinaries {
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
chromedriver {
version = '2.45.0'
fallbackTo32Bit = true
}
geckodriver '0.30.0'
}
}

tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}


assets {
minifyJs = true
minifyCss = true
}

publishing {
repositories {
maven {
name 'Nexus'
url "https://nexus.ala.org.au/content/repositories/${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'releases' }"
credentials {
username = System.getenv('TRAVIS_DEPLOY_USERNAME')
password = System.getenv('TRAVIS_DEPLOY_PASSWORD')
}
}
}
publications {
mavenJar(MavenPublication) {
artifact bootWar
}
}
subprojects {
version=projectVersion
group="au.org.ala"
}
10 changes: 10 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repositories {
maven { url "https://nexus.ala.org.au/content/groups/public/" }
// mavenCentral()
maven { url "https://repo.grails.org/grails/core/" }
}
dependencies {
implementation("com.bertramlabs.plugins:asset-pipeline-gradle:4.3.0")
implementation("org.grails:grails-gradle-plugin:6.2.0")
implementation("org.grails.plugins:hibernate5:8.1.0")
}
2 changes: 2 additions & 0 deletions cicd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## About
This enables containerization of userdetails app using AWS services.
Loading

0 comments on commit d3a3ebb

Please sign in to comment.