Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic/cognito/develop #186

Closed
wants to merge 350 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
350 commits
Select commit Hold shift + click to select a range
6f596c0
Update build command
yasima-csiro Aug 29, 2024
012945e
Add helm set up
yasima-csiro Aug 29, 2024
89b9998
Update container
yasima-csiro Aug 30, 2024
5bf3be7
Update jvm option
yasima-csiro Aug 30, 2024
20f9e80
Disable parallel build
yasima-csiro Sep 1, 2024
4c0fc73
Disable parallel build
yasima-csiro Sep 1, 2024
230563e
Update volume mounts
yasima-csiro Sep 2, 2024
b763f98
Add kubernetes container permission
yasima-csiro Sep 3, 2024
7021731
Update service account policy
yasima-csiro Sep 4, 2024
b829faf
These config values come from Bedrock now
joe-lipson Sep 4, 2024
58838b2
Environment names
joe-lipson Sep 4, 2024
7a29115
added SSL certs as config
joe-lipson Sep 5, 2024
8518d99
export the repo URI
joe-lipson Sep 5, 2024
e6d757f
add hosted zones and subdomains as config
joe-lipson Sep 5, 2024
1bc4dc5
dont need "
joe-lipson Sep 5, 2024
cf6ef94
cleanup syntax
joe-lipson Sep 5, 2024
66e2118
USERDETAILS_ECR_REPOSITORY_NAME not used
joe-lipson Sep 5, 2024
9a78785
removed unused and hardcoded vars
joe-lipson Sep 5, 2024
2f439dc
replace hard coded values with config vars
joe-lipson Sep 5, 2024
0532e20
USERDETAILS_ECR_REPOSITORY_NAME unused
joe-lipson Sep 5, 2024
066809d
remove unused vars
joe-lipson Sep 5, 2024
2ab1d16
needs parens
joe-lipson Sep 5, 2024
837e0dc
remove unused build project
joe-lipson Sep 6, 2024
8dcde2a
export vars
joe-lipson Sep 6, 2024
b262c66
larger build container. 20 build on a SMALL instance
joe-lipson Sep 6, 2024
c72545a
auto deploy in development
joe-lipson Sep 6, 2024
6a0364f
export the base stack name
joe-lipson Sep 6, 2024
ed05e4f
debug
joe-lipson Sep 6, 2024
d281ffd
gather all vars in export config
joe-lipson Sep 6, 2024
b0a58c0
add parens
joe-lipson Sep 6, 2024
35bcab1
missing comma
joe-lipson Sep 6, 2024
fc36064
another missing comma
joe-lipson Sep 6, 2024
3997656
update region var
joe-lipson Sep 6, 2024
32ee98f
debug
joe-lipson Sep 7, 2024
a95fd3f
add missing var
joe-lipson Sep 7, 2024
891fa91
use CF params
joe-lipson Sep 7, 2024
94b54fd
remove config
joe-lipson Sep 7, 2024
ba1a373
add missing vars
joe-lipson Sep 7, 2024
c391a94
extra vars
joe-lipson Sep 7, 2024
e999b60
Fix repo var name
joe-lipson Sep 9, 2024
43205b0
Merge pull request #205 from AtlasOfLivingAustralia/feature/environme…
joe-lipson Sep 9, 2024
fe4e178
try resource tagging
joe-lipson Sep 9, 2024
d873008
update namespaces
joe-lipson Sep 9, 2024
d34389c
remove lables from spec.template
joe-lipson Sep 9, 2024
5bb5443
Merge pull request #192 from AtlasOfLivingAustralia/feature/update_email
yasima-csiro Sep 9, 2024
088a2a3
Merge pull request #204 from AtlasOfLivingAustralia/feature/add_kuber…
yasima-csiro Sep 9, 2024
b0f5714
Add aws-java-sdk-sts module
yasima-csiro Sep 10, 2024
b242d00
Add more permission to properly trust the OIDC provider from the EKS …
yasima-csiro Sep 10, 2024
a7ef352
Add permissions
yasima-csiro Sep 10, 2024
4e4b1a5
Fix permissions
yasima-csiro Sep 10, 2024
658148a
Fix AssumeRolePolicyDocument
yasima-csiro Sep 10, 2024
0a1b05d
Fix parameters
yasima-csiro Sep 10, 2024
29e911b
Add values of parameters for testing
yasima-csiro Sep 10, 2024
cfff6eb
Comment out parameters
yasima-csiro Sep 10, 2024
363e8fa
Export new configs
yasima-csiro Sep 11, 2024
fdfa6bc
Remove duplicate
yasima-csiro Sep 11, 2024
84e70b1
Update true relationship in the role
yasima-csiro Sep 11, 2024
21a2af7
var not used
joe-lipson Sep 11, 2024
2218811
cluster name and ID are now exported from the regolith stack
joe-lipson Sep 11, 2024
b2b110a
Add new vars
joe-lipson Sep 11, 2024
dfcddf2
remove cluster id
joe-lipson Sep 11, 2024
ca3f8d5
get OIDC_CONNECT_PROVIDER from regolith export
joe-lipson Sep 11, 2024
9054907
remove cluster id
joe-lipson Sep 11, 2024
1ef0f5d
remove cluster id
joe-lipson Sep 11, 2024
f377174
get the cluster name from the regolith export
joe-lipson Sep 11, 2024
dd3bb51
remove cluster name
joe-lipson Sep 11, 2024
d7c943c
missing comma
joe-lipson Sep 11, 2024
495efb7
Import the oidc cluster url in export config
joe-lipson Sep 11, 2024
392ef30
trying without '
joe-lipson Sep 11, 2024
7603172
another try
joe-lipson Sep 11, 2024
50a0b15
alternate syntax
joe-lipson Sep 11, 2024
e526609
add missing param
joe-lipson Sep 11, 2024
f696f8c
fix var names
joe-lipson Sep 11, 2024
5d20717
description must a a string
joe-lipson Sep 11, 2024
6c5928d
Try >
joe-lipson Sep 11, 2024
6c1c2a0
another alternative
joe-lipson Sep 11, 2024
6336c3d
yet another try
joe-lipson Sep 11, 2024
5c12840
remove quotes
joe-lipson Sep 11, 2024
199d64c
getting somewhere
joe-lipson Sep 11, 2024
2679362
just one
joe-lipson Sep 11, 2024
f757093
another try
joe-lipson Sep 11, 2024
55b148f
test
joe-lipson Sep 11, 2024
894e72b
couldnt get yaml format working :(
joe-lipson Sep 12, 2024
45c114f
Merge pull request #207 from AtlasOfLivingAustralia/feature/use-regol…
joe-lipson Sep 12, 2024
381dc03
Merge pull request #206 from AtlasOfLivingAustralia/feature/add_permi…
yasima-csiro Sep 12, 2024
d2648a5
add a teardown action
joe-lipson Sep 12, 2024
d46dff2
Update target port
yasima-csiro Sep 13, 2024
0426a1c
get helm
joe-lipson Sep 13, 2024
641ba50
remove unused installations from deploy project
joe-lipson Sep 13, 2024
81e11d6
simplify build installs
joe-lipson Sep 13, 2024
7967325
apt-update build
joe-lipson Sep 13, 2024
06821df
install teardown dependencies
joe-lipson Sep 13, 2024
17feed4
simplify buildspecs
joe-lipson Sep 13, 2024
4b29a3c
fix pipeline
joe-lipson Sep 13, 2024
ce785a7
update-kubeconfig
joe-lipson Sep 13, 2024
9faf45c
add time unit
joe-lipson Sep 13, 2024
efed0db
add back image name var
joe-lipson Sep 13, 2024
3d1e4c3
Add teardown loggroup, new pipeline teardown approval action
joe-lipson Sep 13, 2024
9f4352c
Use the deploy message thats set in the notification buildspec
joe-lipson Sep 13, 2024
bb059bf
Update deploy notification with URL
joe-lipson Sep 13, 2024
755eb64
fix commas
joe-lipson Sep 13, 2024
c778742
Merge pull request #208 from AtlasOfLivingAustralia/feature/add-teard…
joe-lipson Sep 13, 2024
8809798
Merge branch 'feature/containerization' into feature/labels
joe-lipson Sep 13, 2024
4a96515
Merge branch 'feature/containerization' into feature/labels
joe-lipson Sep 13, 2024
a028eda
remove resource name
joe-lipson Sep 13, 2024
f23bd50
remove hardcoding
joe-lipson Sep 13, 2024
e9aa0dc
bump the build memory
joe-lipson Sep 13, 2024
f571509
try annotations
joe-lipson Sep 16, 2024
e202b08
specific tags
joe-lipson Sep 16, 2024
75d9905
include changes to helm dir
joe-lipson Sep 16, 2024
2d33d13
test tags
joe-lipson Sep 16, 2024
b2195e0
track down tags
joe-lipson Sep 16, 2024
4fb1388
split the tags
joe-lipson Sep 16, 2024
579a674
cleanup
joe-lipson Sep 16, 2024
70dffdd
remove labels
joe-lipson Sep 16, 2024
4c68097
fix trigger typo
joe-lipson Sep 16, 2024
f2d2c76
test commit
joe-lipson Sep 16, 2024
c8d7496
test deploy
joe-lipson Sep 16, 2024
1de4507
remove test data
joe-lipson Sep 16, 2024
09ba6fb
Merge pull request #209 from AtlasOfLivingAustralia/feature/labels
joe-lipson Sep 17, 2024
9646fcd
create env vars
joe-lipson Sep 17, 2024
620f850
add primary source
joe-lipson Sep 17, 2024
abea29c
fix syntax
joe-lipson Sep 17, 2024
a1c24c4
fix env var name
joe-lipson Sep 17, 2024
7769067
populate app variables
joe-lipson Sep 17, 2024
e672046
check env vars
joe-lipson Sep 18, 2024
10068c5
unset codebuild vars
joe-lipson Sep 18, 2024
c6046d6
source the unset script
joe-lipson Sep 18, 2024
fc7812a
do it in the same command
joe-lipson Sep 18, 2024
89740c4
sort vars, add comment
joe-lipson Sep 18, 2024
c722468
remove debug
joe-lipson Sep 18, 2024
5a893b0
create the secret value on first launch only
joe-lipson Sep 24, 2024
473a261
remove errant :
joe-lipson Sep 24, 2024
6b13860
import secrets, create config map with kubectl rather than helm
joe-lipson Sep 24, 2024
ebe1072
change format of the exported env vars
joe-lipson Sep 24, 2024
e5206fb
use kubectl to teardown the configmap
joe-lipson Sep 24, 2024
bd300d7
remove configmap from helm
joe-lipson Sep 24, 2024
b1b7619
secrets belong in export config
joe-lipson Sep 24, 2024
61dc5a1
rename for consistency
joe-lipson Sep 24, 2024
ddebebd
should not have removed
joe-lipson Sep 24, 2024
16ef0fb
no secrets here
joe-lipson Sep 24, 2024
b98509e
different secrets here
joe-lipson Sep 24, 2024
56a5da6
add product name
joe-lipson Sep 24, 2024
d5ddfb5
quote secrets
joe-lipson Sep 24, 2024
ba5f842
delete the config map first to prevent error if it already exists
joe-lipson Sep 24, 2024
69e0556
configmap debug
joe-lipson Sep 24, 2024
1c8763c
make the command always succeed
joe-lipson Sep 24, 2024
4e504ac
these overwrite actual secrets
joe-lipson Sep 24, 2024
5b82244
remove debug prints
joe-lipson Sep 24, 2024
939af33
remove clean branch hardcoding
joe-lipson Sep 24, 2024
4c28e9c
Merge pull request #210 from AtlasOfLivingAustralia/feature/app-config
joe-lipson Sep 24, 2024
28af44a
production slack notification image update
joe-lipson Sep 24, 2024
a5c8124
update regolith stack name
joe-lipson Oct 28, 2024
9a178d8
Merge pull request #211 from AtlasOfLivingAustralia/feature/update-st…
joe-lipson Oct 29, 2024
5ef3d3d
Set up new pac4j library and Java 17
yasima-csiro Nov 11, 2024
33e7e54
Update API token validation to match with new pac4j changes
yasima-csiro Dec 10, 2024
916ff1b
Set up userdetails config file and oidc app clients
yasima-csiro Dec 12, 2024
5795ea3
Merge branch 'feature/containerization' of https://github.com/AtlasOf…
yasima-csiro Dec 12, 2024
529be6f
Update config
yasima-csiro Dec 12, 2024
acb210d
Add missing parameters
yasima-csiro Dec 13, 2024
0e6008d
Fix typo
yasima-csiro Dec 13, 2024
4b9d94b
Update export config
yasima-csiro Dec 17, 2024
bb163c9
Exclude unwanted configs
yasima-csiro Dec 17, 2024
a050380
Add missing property
yasima-csiro Dec 17, 2024
24d70f2
Set up cicd
yasima-csiro Jan 19, 2025
bf1ffbe
Fix build pipeline name
yasima-csiro Jan 19, 2025
bc4eb0b
Update config
yasima-csiro Jan 19, 2025
d9d7c2f
Fix pipeline variable issue
yasima-csiro Jan 20, 2025
4714522
Pass oidc client id value
yasima-csiro Jan 20, 2025
9a06605
Pass web service client id value
yasima-csiro Jan 20, 2025
688eaba
Export oidc client names
yasima-csiro Jan 20, 2025
da27b01
Add config
yasima-csiro Jan 20, 2025
1e98f59
Add configs
yasima-csiro Jan 20, 2025
d3234d8
Remove configs
yasima-csiro Jan 20, 2025
d7a675e
Remove comma
yasima-csiro Jan 20, 2025
dac37b8
Add configs
yasima-csiro Jan 20, 2025
b203d53
Add configs
yasima-csiro Jan 20, 2025
c655979
Fix configs
yasima-csiro Jan 20, 2025
0d6644f
Fix configs
yasima-csiro Jan 20, 2025
8efdf4e
Remove configs
yasima-csiro Jan 20, 2025
34ac394
Remove configs
yasima-csiro Jan 20, 2025
d9ecb27
Remove configs
yasima-csiro Jan 20, 2025
13ae940
Remove configs
yasima-csiro Jan 20, 2025
b404b8d
Add logs
yasima-csiro Jan 20, 2025
a43100a
Remove configs
yasima-csiro Jan 20, 2025
4abcc52
Add logs
yasima-csiro Jan 20, 2025
2865e7b
Fix typo
yasima-csiro Jan 21, 2025
95634d9
Set up userdetails config secret
yasima-csiro Jan 21, 2025
4143015
Add build image step to pipeline
yasima-csiro Jan 21, 2025
31613dd
Update resources
yasima-csiro Jan 21, 2025
05a4883
Fix secret file name issue
yasima-csiro Jan 22, 2025
14e254a
Update config
yasima-csiro Jan 22, 2025
dc0f69f
Update secret creation
yasima-csiro Jan 23, 2025
b7e2ed0
Add logs
yasima-csiro Jan 23, 2025
5c4dfb4
Fix helm command
yasima-csiro Jan 23, 2025
1822a78
Fix helm config
yasima-csiro Jan 23, 2025
fe8bcb4
Update config file name
yasima-csiro Jan 23, 2025
e4b7785
Fix config secret
yasima-csiro Jan 23, 2025
2322851
Update config secret
yasima-csiro Jan 23, 2025
4d326c6
Update setting up helm variables
yasima-csiro Jan 24, 2025
62d13d3
Remove configs
yasima-csiro Jan 24, 2025
336d30a
Update pipeline
yasima-csiro Jan 24, 2025
55667a8
Remove logs
yasima-csiro Jan 24, 2025
b77005a
Update pipeline
yasima-csiro Jan 28, 2025
0b5fdff
Update pipeline
yasima-csiro Jan 28, 2025
2b1b5ba
Add build log group
yasima-csiro Jan 28, 2025
1f5274c
Update file name
yasima-csiro Jan 28, 2025
5977a8d
Update file name
yasima-csiro Jan 28, 2025
28d373b
Add logs
yasima-csiro Jan 28, 2025
67ca82f
Set up secrets
yasima-csiro Jan 28, 2025
6d32827
Set up secret name
yasima-csiro Jan 28, 2025
fa32ac3
Update secret
yasima-csiro Jan 28, 2025
d68c3fc
Fix typos
yasima-csiro Jan 28, 2025
7374be2
Fix configs
yasima-csiro Jan 29, 2025
7868138
Upgrade container and remove logs
yasima-csiro Jan 29, 2025
11fe3ce
Merge remote-tracking branch 'origin/epic/cognito/develop' into featu…
yasima-csiro Jan 29, 2025
53a6db0
Merge pull request #212 from AtlasOfLivingAustralia/feature/new_pac4j…
yasima-csiro Jan 29, 2025
42d68c8
Merge remote-tracking branch 'origin/epic/cognito/develop' into featu…
yasima-csiro Jan 29, 2025
de83027
Fix issues
yasima-csiro Jan 30, 2025
73f75ab
Update mail plugin
yasima-csiro Jan 30, 2025
19fd0b3
Add missing param
yasima-csiro Jan 31, 2025
c7372a8
Add mail plugin
yasima-csiro Jan 31, 2025
508e3b9
Update docker file
yasima-csiro Feb 3, 2025
1a53385
Update config
yasima-csiro Feb 3, 2025
e23ef9f
Update config
yasima-csiro Feb 3, 2025
df17f83
Update deploy pipeline
yasima-csiro Feb 3, 2025
622bcf2
Update config
yasima-csiro Feb 3, 2025
073a227
Update config
yasima-csiro Feb 4, 2025
f1676d9
Update config
yasima-csiro Feb 4, 2025
5318d00
Update config
yasima-csiro Feb 4, 2025
c880cb9
Update config
yasima-csiro Feb 4, 2025
32551ba
Remove duplicate
yasima-csiro Feb 4, 2025
110b05c
Add missing config
yasima-csiro Feb 6, 2025
88289c2
Fix review comments
yasima-csiro Feb 10, 2025
5ffc778
Update config
yasima-csiro Feb 10, 2025
93baa1e
Update config
yasima-csiro Feb 10, 2025
96a717a
Update config
yasima-csiro Feb 10, 2025
2719735
Address review comments
yasima-csiro Feb 10, 2025
64553b1
Fix build error
yasima-csiro Feb 10, 2025
dd14e99
Update config
yasima-csiro Feb 10, 2025
93f5564
Update docker file
yasima-csiro Feb 12, 2025
8924724
Update docker file
yasima-csiro Feb 12, 2025
8cee2cc
Update docker file
yasima-csiro Feb 12, 2025
f5116dc
Update docker file
yasima-csiro Feb 12, 2025
4236d47
Update docker file
yasima-csiro Feb 12, 2025
b0c2c30
Merge pull request #214 from AtlasOfLivingAustralia/feature/cicd
yasima-csiro Feb 17, 2025
3cafea6
Merge branch 'dev' into epic/cognito/develop
yasima-csiro Feb 17, 2025
9f40834
Fix merge issues
yasima-csiro Feb 17, 2025
2ab0343
Fix merge issues
yasima-csiro Feb 18, 2025
69b078a
Update tests
yasima-csiro Feb 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions userdetails-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -171,6 +171,8 @@ dependencies {
exclude module: 'bootstrap' // dependency from skin
}

implementation 'org.passay:passay:1.6.0'

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

testImplementation('com.squareup.retrofit2:retrofit-mock:2.9.0')
23 changes: 23 additions & 0 deletions userdetails-plugin/grails-app/conf/plugin.yml
Original file line number Diff line number Diff line change
@@ -186,6 +186,24 @@ spring:

password:
encoder: bcrypt # or legacy
generatedLength: 10
# Passwords must satisfy this policy.
# The minLength policy is always required, even when the policy is disabled. It has a default value of 8.
# To remove / disable an aspect of the policy, either remove the item or set to 0 / false, whichever is relevant.
policy:
minLength: 8
enabled: true
maxLength: 64
excludeUsername: true
excludeUsQwertyKeyboardSequence: true
excludeCommonPasswords: true
charGroupMinRequired: 3
charGroupMinUpperCase: 1
charGroupMinLowerCase: 1
charGroupMinUpperOrLowerCase: 0
charGroupMinDigit: 1
charGroupMinSpecial: 1

bcrypt:
strength: 10

@@ -325,3 +343,8 @@ environments:
cas:
appServerName: "https://auth.ala.org.au"

# Allow to disable some tools for non-ALA Portals
myProfile:
useDigiVol: true
useSandbox: true
useBiocollect: true
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@ import au.org.ala.ws.service.WebService
import grails.converters.JSON

import org.springframework.beans.factory.annotation.Qualifier
import org.passay.RuleResult
import org.springframework.context.i18n.LocaleContextHolder
import org.springframework.validation.Errors

/**
* Controller that handles the interactions with general public.
@@ -37,20 +40,24 @@ class RegistrationController {

def simpleCaptchaService
def emailService
def authService
def passwordService

@Qualifier('userService')
IUserService userService
def locationService
RecaptchaClient recaptchaClient
WebService webService
def messageSource

def index() {
redirect(action: 'createAccount')
}

def createAccount() {}
def createAccount() {
render(view: 'createAccount', model: [
passwordPolicy: passwordService.buildPasswordPolicy(),
])
}

def editAccount() {
def user = userService.currentUser
@@ -63,20 +70,26 @@ class RegistrationController {
render(view: 'accountError', model: [msg: "UserRecord not found with ID ${params.userId}"])
} else if (user.tempAuthKey == params.authKey) {
//keys match, so lets reset password
render(view: 'passwordReset', model: [user: user, authKey: params.authKey])
render(view: 'passwordReset', model: [user: user, authKey: params.authKey, passwordPolicy: passwordService.buildPasswordPolicy()])
} else {
render(view: 'authKeyExpired')
}
}

def updatePassword(UpdatePasswordCommand cmd) {
UserRecord user = userService.getUserById(cmd.userId as String)

// since the email address is the user name, use the part before the @ as the username
def username = user?.userName ?: user?.email ?: ''
def validationResult = passwordService.validatePassword(username, cmd?.password)
buildErrorMessages(validationResult, cmd.errors)

if (cmd.hasErrors()) {
render(view: 'passwordReset', model: [user: user, authKey: cmd.authKey, errors:cmd.errors, passwordMatchFail: true])
}
else {
withForm {
if (user.tempAuthKey == params.authKey) {
if (user.tempAuthKey == cmd.authKey) {
//update the password
try {
userService.resetPassword(user, cmd.password, true, null)
@@ -226,6 +239,13 @@ class RegistrationController {
// params.userName = params.email
}

def isCorrectPassword = passwordService.checkUserPassword(user, params.confirmUserPassword)
if (!isCorrectPassword) {
flash.message = 'Incorrect password. Could not update account details. Please try again.'
render(view: 'createAccount', model: [edit: true, user: user, props: user?.propsAsMap()])
return
}

def success = userService.updateUser(user.userId, params)

if (success) {
@@ -240,6 +260,8 @@ class RegistrationController {
}

def register() {
def paramsEmail = params?.email?.toString()
def paramsPassword = params?.password?.toString()
withForm {

def recaptchaKey = grailsApplication.config.getProperty('recaptcha.secretKey')
@@ -264,12 +286,20 @@ class RegistrationController {
}

//create user account...
if (!params.email || userService.isEmailRegistered(params.email)) {
def inactiveUser = !userService.isActive(params.email)
def lockedUser = userService.isLocked(params.email)
if (!paramsEmail || userService.isEmailRegistered(paramsEmail)) {
def inactiveUser = !userService.isActive(paramsEmail)
def lockedUser = userService.isLocked(paramsEmail)
render(view: 'createAccount', model: [edit: false, user: params, props: params, alreadyRegistered: true, inactiveUser: inactiveUser, lockedUser: lockedUser])
} else {

def passwordValidation = passwordService.validatePassword(paramsEmail, paramsPassword)
if (!passwordValidation.valid) {
log.warn("The password for user name '${paramsEmail}' did not meet the validation criteria '${passwordValidation}'")
flash.message = "The selected password does not meet the password policy. Please try again with a different password. ${buildErrorMessages(passwordValidation)}"
render(view: 'createAccount', model: [edit: false, user: params, props: params])
return
}

try {
//does a user with the supplied email address exist
def user = userService.registerUser(params)
@@ -364,4 +394,25 @@ class RegistrationController {
userService.enableMfa(params.userId, false)
redirect(action: 'editAccount')
}

private String buildErrorMessages(RuleResult validationResult, Errors errors = null) {
if (validationResult.valid) {
return null
}
def results = []
if (!validationResult.valid) {
def details = validationResult.details
for (def detail in details) {
for (String errorCode in detail.errorCodes) {
def fullErrorCode = "user.password.error.${errorCode?.toLowerCase()}"
def errorValues = detail.values as Object[]
if (errors) {
errors.rejectValue('password', fullErrorCode, errorValues, "Invalid password.")
}
results.add(messageSource.getMessage(fullErrorCode, errorValues, "Invalid password.", LocaleContextHolder.locale))
}
}
}
return results.unique().sort().join(' ')
}
}
49 changes: 48 additions & 1 deletion userdetails-plugin/grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@ create.account.organisation=Organisation
create.account.country=Country
create.account.city=City
create.account.state.province=State / province
create.account.confirm.password=Please confirm your current password
create.account.update.account=Update account
create.account.disable.account=Disable account
create.account.btn=Create account
@@ -224,6 +225,50 @@ create.account.motivation.2=You don't have to set and remember yet another passw
create.account.motivation.3=Your account will be activated without going through verification emails
create.account.motivation.4=Overall you will save time
create.account.motivation.footer=Of course if you don't have an account with such providers or prefer to use a different email you still can create an account with us by filling in the information on the left.

account.password.policy.title=Password Policy
account.password.policy.requirements.length=A secure password will be at least {0} characters long.
account.password.policy.requirements.complexity.intro=The characters in it must satisfy at least {0} of the following {1} requirements:
account.password.policy.requirements.complexity.upper=upper case letter, e.g. A, B, C
account.password.policy.requirements.complexity.lower=lower case letter, e.g. a, b, c
account.password.policy.requirements.complexity.upperOrLower=upper or lower case letters
account.password.policy.requirements.complexity.number=numerical digit, e.g. 1, 2, 55
account.password.policy.requirements.complexity.special=special (non-alphanumeric) character, e.g. $, *, #, &
account.password.policy.requirements.complexity.common=The chosen password will be compared to a list of commonly-used passwords. \
If the password appears on the list you will need to choose a different password, as the password is too easy to guess.
account.password.policy.requirements.complexity.username=Your email cannot appear in the password.
account.password.policy.requirements.complexity.knownsequence=The password will be checked for groups of characters that are well-known and widely used. \
If these are found you will need to choose a different password, as the password is too easy to guess.

user.password.error.history_violation=Password matches one of {0} previous passwords.
user.password.error.illegal_word=The password is known to be commonly used, and is not secure ("{0}").
user.password.error.illegal_word_reversed=Password contains the reversed dictionary word "{0}".
user.password.error.illegal_digest_word=Password contains a dictionary word "{0}".
user.password.error.illegal_digest_word_reversed=Password contains a reversed dictionary word "{0}".
user.password.error.illegal_match=Password matches the illegal pattern "{0}".
user.password.error.allowed_match=Password must match pattern "{0}".
user.password.error.illegal_char=Password {1} the illegal character "{0}".
user.password.error.allowed_char=Password {1} the illegal character "{0}".
user.password.error.illegal_qwerty_sequence=Password contains a sequence of letters that is too easy to guess "{0}".
user.password.error.illegal_alphabetical_sequence=Password contains the illegal alphabetical sequence "{0}".
user.password.error.illegal_numerical_sequence=Password contains the illegal numerical sequence "{0}".
user.password.error.illegal_username=Password {1} the user id "{0}".
user.password.error.illegal_username_reversed=Password {1} the user id "{0}" in reverse.
user.password.error.illegal_whitespace=Password {1} a whitespace character "{0}".
user.password.error.illegal_number_range=Password {1} the number "{0}".
user.password.error.illegal_repeated_chars=Password contains {2} sequences of {0} or more repeated characters, but only {1} allowed: {3}.
user.password.error.insufficient_uppercase=Password must contain {0} or more uppercase characters, it currently contains {1}.
user.password.error.insufficient_lowercase=Password must contain {0} or more lowercase characters, it currently contains {1}.
user.password.error.insufficient_alphabetical=Password must contain {0} or more alphabetical characters, it currently contains {1}.
user.password.error.insufficient_digit=Password must contain {0} or more digit characters, it currently contains {1}.
user.password.error.insufficient_special=Password must contain {0} or more special characters, it currently contains {1}.
user.password.error.insufficient_characteristics=Password matches {0} of {2} character rules, but {1} are required.
user.password.error.insufficient_complexity=Password meets {1} complexity rules, but {2} are required ({0}).
user.password.error.insufficient_complexity_rules=No rules have been configured for a password of length {0}.
user.password.error.source_violation=Password cannot be the same as your {0} password.
user.password.error.too_long=Password must be no more than {1} characters in length ({0}).
user.password.error.too_short=Password must be {0} or more characters in length.
user.password.error.too_many_occurrences=Password contains {1} occurrences of the character "{0}", but at most {2} are allowed.
myprofile.your.alerts.desc=Update your alert settings for emails you receive from the Atlas
myprofile.update.desc=Update your email address, organisation and contact details
userdetails.index.reset.password.desc=Reset your Atlas password
@@ -245,6 +290,7 @@ myprofile.yourapikey=Your API key
#myprofile.yourapikey.desc2=You can generate an <b>API aecret</b> using the button below. Once its generated you will not be able to access this again so please keep it safe.
myprofile.yourapikey.desc1=This will can be used in your application to submit requests to the Atlas.
myprofile.yourapikey.desc2=This key should be sent as an HTTP header, along with <a href="https://en.wikipedia.org/wiki/JSON_Web_Token">JSON Web Token (JWT)</a>, giving you access additional services.

user.enabledMFA=MFA Enabled
user.enableMFA.title=Multi Factor Authentication
user.setupMFA=Setup MFA
@@ -258,4 +304,5 @@ updatePassword.constraint.1=at least 8 characters
updatePassword.constraint.2=a lower case letter
updatePassword.constraint.3=an upper case letter
updatePassword.constraint.4=a special character
updatePassword.constraint.5=a number
updatePassword.constraint.5=a number

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.