diff --git a/config/prd/regional/api-clients/stanford.yaml b/config/prd/regional/api-clients/stanford.yaml index 2b6a827c..ee6e6173 100644 --- a/config/prd/regional/api-clients/stanford.yaml +++ b/config/prd/regional/api-clients/stanford.yaml @@ -25,6 +25,7 @@ parameters: IdTokenValidity: '7' RefreshTokenValidity: '10080' -# hooks: -# after_create: -# cmd: 'src/scripts/add-api-client.sh prd stanford http://localhost:3000/callback' +hooks: + after_update: + cmd: 'src/scripts/add-api-client.sh prd stanford http://localhost:3000/callback' + cmd: 'aws ssm put-parameter --overwrite --name /uc3/dmp/tool/provenance/stanford/ror_list --type String --value \'["https://ror.org/03mtd9a03","https://ror.org/00f54p054","https://ror.org/014qe3j22","https://ror.org/0551gkb08"]\'' diff --git a/config/prd/regional/api-clients/uc-boulder.yaml b/config/prd/regional/api-clients/uc-boulder.yaml index ce4484ec..8a47cac8 100644 --- a/config/prd/regional/api-clients/uc-boulder.yaml +++ b/config/prd/regional/api-clients/uc-boulder.yaml @@ -22,3 +22,8 @@ parameters: AuthSessionValidatyMinutes: '3' IdTokenValidity: '7' RefreshTokenValidity: '10080' + +hooks: + after_update: + cmd: 'src/scripts/add-api-client.sh prd uc-boulder http://localhost:3000/callback' + cmd: 'aws ssm put-parameter --overwrite --name /uc3/dmp/tool/provenance/uc-boulder/ror_list --type String --value \'["https://ror.org/02ttsq026"]\'' diff --git a/config/prd/regional/api-clients/uc-riverside.yaml b/config/prd/regional/api-clients/uc-riverside.yaml index b1198a4a..5a335b55 100644 --- a/config/prd/regional/api-clients/uc-riverside.yaml +++ b/config/prd/regional/api-clients/uc-riverside.yaml @@ -22,3 +22,8 @@ parameters: AuthSessionValidatyMinutes: '3' IdTokenValidity: '7' RefreshTokenValidity: '10080' + +hooks: + after_update: + cmd: 'src/scripts/add-api-client.sh prd uc-riverside http://localhost:3000/callback' + cmd: 'aws ssm put-parameter --overwrite --name /uc3/dmp/tool/provenance/uc-riverside/ror_list --type String --value \'["https://ror.org/03nawhv43"]\'' diff --git a/src/scripts/add-api-client.sh b/src/scripts/add-api-client.sh index 0c860af4..28438f91 100755 --- a/src/scripts/add-api-client.sh +++ b/src/scripts/add-api-client.sh @@ -24,4 +24,4 @@ echo "Creating Provenance item for $2 -> {\"PK\": \"PROVENANCE#$KEY\", \"SK\": \ # Insert the Provenance record for the DMPTool application aws dynamodb put-item --table-name $DYNAMO_TABLE \ --item \ - "{\"PK\":{\"S\":\"PROVENANCE#$KEY\"},\"SK\":{\"S\":\"PROFILE\"},\"contact\":{\"M\":{\"email\":{\"S\":\"$ADMIN_EMAIL\"},\"name\":{\"S\":\"Administrator\"}}},\"description\":{\"S\":\"The $2 $1 system\"},\"downloadUri\":{\"S\":\"https://$3/api/v2/plans/\"},\"homepage\":{\"S\":\"https://$3\"},\"name\":{\"S\":\"$2\"},\"redirectUri\":{\"S\":\"https://$3/callback\"},\"tokenUri\":{\"S\":\"https://$3/oauth/token\"}}" + "{\"PK\":{\"S\":\"PROVENANCE#$KEY\"},\"SK\":{\"S\":\"PROFILE\"},\"contact\":{\"M\":{\"email\":{\"S\":\"$ADMIN_EMAIL\"},\"name\":{\"S\":\"Administrator\"}}},\"description\":{\"S\":\"The $2 $1 system\"},\"downloadUri\":{\"S\":\"https://$3/api/v2/plans/\"},\"homepage\":{\"S\":\"https://$3\"},\"name\":{\"S\":\"$2\"},\"redirectUri\":{\"S\":\"https://$3/callback\"},\"tokenUri\":{\"S\":\"https://$3/oauth/token\"},\"org_access_level\":{\"S\":\"restricted\"}}"