-
Notifications
You must be signed in to change notification settings - Fork 2
New: [AEA-5308] - Add NHS Notify callback lambda #1634
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
Merged
Merged
Changes from all commits
Commits
Show all changes
289 commits
Select commit
Hold shift + click to select a range
7a8b4e5
Merge branch 'main' into aea-5199-setup-notifications-lambda
wildjames 7bfc023
Skip quality checks
wildjames b56af03
Merge branch 'aea-5199-setup-notifications-lambda' of github.com:NHSD…
wildjames d6d58cc
Make the notify lambda pull messages from SQS, and log them
wildjames 8216f25
Update log message
wildjames 6a2d224
Set up the consumer to be able to communicate with the table. Alos lo…
wildjames 77821bc
Pass in static table name as a parameter
wildjames 7c91533
Merge branch 'main' into aea-5199-setup-notifications-lambda
wildjames e39958a
Expand test coverage
wildjames 61a897e
Merge branch 'aea-5199-setup-notifications-lambda' of github.com:NHSD…
wildjames adb055f
Minimal nhsnotifylambda dynamo unit test
wildjames 804c06b
Expand test coverage
wildjames eb78c25
Start tests for the drainQueue functiton
wildjames 35d8a92
Expand test coverage
wildjames 9a55102
Merge branch 'main' into aea-5199-setup-notifications-lambda
wildjames ea0c3fe
Make a more official test for the handler
wildjames 5da248d
Expand test coverage
wildjames 90ccd53
Update type
wildjames 338a135
Address some sonar things
wildjames 17d6566
Move dataitem to a common types package
wildjames f27d70f
Minor tweaks from self-review
wildjames 9cfb289
Use NHS number as the message ID
wildjames f0d35c5
Salt the nhs number and use it as the message ID.
wildjames 6a77bde
Update log message
wildjames 53abd70
Update tests to reflect logging change
wildjames 440ac9e
Merge branch 'main' into aea-5274-deduplicate-notification-queue-by-n…
wildjames 15ba4d2
Correctly grab request ID
wildjames 501a5fd
Merge branch 'main' into aea-5199-setup-notifications-lambda
wildjames ba2d587
Merge branch 'aea-5199-setup-notifications-lambda' into aea-5274-dedu…
wildjames dd81780
Update log
wildjames 0043ed4
Merge branch 'aea-5199-setup-notifications-lambda' into aea-5274-dedu…
wildjames 00178b2
Remove log messages
wildjames 67fb985
Use a FIFO queue, since it has deduplication IDs
wildjames 989bb82
Minor adjustment to the failure catch logic to handle some elements o…
wildjames 7fd8396
lengthen visibility timeout
wildjames 1cf948a
Merge branch 'aea-5199-setup-notifications-lambda' into aea-5274-dedu…
wildjames 178fc01
Update to deduplicate on both nhs number and ods code
wildjames 9d9da72
Update test
wildjames 21cf5f0
Resolve package lock conflict
wildjames 5912e98
Merge branch 'aea-5199-setup-notifications-lambda' into aea-5274-dedu…
wildjames 886c198
Rename fuinction. Comments
wildjames 6b9dcbc
Resolve package lock conflict
wildjames d710874
Merge branch 'aea-5199-setup-notifications-lambda' into aea-5274-dedu…
wildjames f5a77bf
Create a whitelist checking function
wildjames c90555c
Update language usage
wildjames 90e3e8e
Update language
wildjames 21a1236
Update logging
wildjames de8033a
Update tests
wildjames 839375f
Merge branch 'main' into aea-5274-deduplicate-notification-queue-by-n…
wildjames d950354
Move the deletion logic out to occur AFTER processing. Update tests t…
wildjames 1c949b7
Update tests
wildjames 0227196
Revert a line
wildjames 7440946
Update mock import
wildjames 73edbdc
Expand tests
wildjames 2719d4f
Set the sqs salt value to some randomly generated string at deployment
wildjames 8d10626
Merge branch 'main' into aea-5202-allowed-and-blocked-sites-and-systems
wildjames a22c919
Merge branch 'aea-5274-deduplicate-notification-queue-by-nhsnumber' i…
wildjames 28adaa5
Define the enabled and disabled sites in a new Paramters template
wildjames bff40c5
Allow the block and enable lists to differ between prod and non-prod …
wildjames 50e7fe5
Update tests
wildjames f08adba
Merge branch 'main' into aea-5202-allowed-and-blocked-sites-and-systems
wildjames 888a1c8
Merge branch 'main' into aea-5202-allowed-and-blocked-sites-and-systems
wildjames b8b08a8
Fix typo
wildjames 23c53d7
Merge branch 'aea-5202-allowed-and-blocked-sites-and-systems' of gith…
wildjames 5939e0f
Refactor params a bit
wildjames e608771
Roll back a bit to find the source of the error
wildjames e3ef147
Comment out parameter
wildjames aa2a8d5
Make fallback salt a const
wildjames 022e66f
Merge main into aea-5202-allowed-and-blocked-sites-and-systems
wildjames d015f13
last deployment worked. Try passing in parameters
wildjames b1574b1
Join array back into a single string
wildjames 6bcd216
pass in the name and fetch the parameter values from ssm in the code
wildjames d9fcfce
Forgot to await
wildjames d0cea20
Revert change
wildjames 17e46ea
Add logging message
wildjames ad32e9b
Remove await
wildjames 055e4a0
Revert change to deploy workflow
wildjames d3d88f4
Merge branch 'main' into aea-5202-allowed-and-blocked-sites-and-systems
wildjames c0f0c50
Merge branch 'main' into aea-5202-allowed-and-blocked-sites-and-systems
wildjames 358e203
Test fallback salt value
wildjames 6663bac
Merge branch 'aea-5202-allowed-and-blocked-sites-and-systems' of gith…
wildjames 3e5feb7
Minor tweak to tests
wildjames 5c53015
Case insensitivity test!
wildjames 2c97580
Exploratory work
wildjames 73d8784
bypass quality checks
wildjames f982d2a
Checking that there's not data I think there is
wildjames f3bfcf6
Reintroduce code to push up data to dynamo
wildjames 59c0977
use a string for the date instead of raw Date object
wildjames 7f83dbd
Add a log message
wildjames 4251aa8
Add log message
wildjames d2cffd1
Update test
wildjames d5bf6fb
re-enable PiTR
wildjames 8e986e2
Fix me using the wrong table reference in the template
wildjames 95f99fd
Fix expiry time calculation. Move delta to constant
wildjames d1bc62b
Batch the delete operation properly. Add request ID to the SQS messag…
wildjames f18d438
Add a log message
wildjames d5b1aa8
Update and expand tests
wildjames c1bd96c
Merge branch 'main' into aea-5280-push-notify-data-to-dynamo
wildjames 430ec69
Add another unit test.
wildjames 890bcdd
Reenable quality checks
wildjames f3eee15
Add another test
wildjames b07f849
Resolve merge conflict
wildjames bd895e8
Add a log message
wildjames eebc9c0
Add a log message
wildjames 463348a
Alter comments
wildjames dfcc12c
Merge branch 'main' into aea-5280-push-notify-data-to-dynamo
wildjames e73b723
Change record key to be more explicit
wildjames 8ce03dc
Try some explicit jest config to get coverage picked up
wildjames ba328eb
Revert last commit
wildjames a24c366
Merge branch 'main' into aea-5280-push-notify-data-to-dynamo
wildjames 506fb14
Try updating sonar coverage defintion
wildjames 04d90be
Address sonar issues
wildjames e7bbf5c
Remove invalid sonar config
wildjames e17395e
Update jest config
wildjames 3194e5f
Write a function that checks the cooldown. Also filter incoming messa…
wildjames 18564fc
Resolve sonar issue
wildjames 686ee53
Merge branch 'aea-5280-push-notify-data-to-dynamo' into aea-5206-chec…
wildjames d047e98
Expand test coverage
wildjames 7dadd02
Unit tests for new function
wildjames 02e9717
Update logging
wildjames 470d565
Merge branch 'aea-5280-push-notify-data-to-dynamo' into aea-5206-chec…
wildjames 243dcb0
Update test
wildjames eea2c85
Update test
wildjames 677f128
Merge branch 'aea-5280-push-notify-data-to-dynamo' into aea-5206-chec…
wildjames 4eef6fa
First pass at setting up a new lambda
wildjames 96b3cb5
Merge branch 'main' into aea-5308-notify-callback
wildjames 88b49f5
Merge branch 'main' into aea-5206-check-cooldown-when-sending
wildjames 88ffd8f
Trigger build
wildjames 777b171
Update package lock
wildjames e8888f3
Pointing to wrong handler location
wildjames 64656a7
Bypass quality checks
wildjames 01e36ad
Check signature
wildjames fb27480
Remove todo
wildjames 5b7b969
parse request body
wildjames 001c649
Logging changes
wildjames b5d83a6
Update logging again
wildjames 7afc105
Compare as buffers, rather than hex
wildjames 107d218
Merge branch 'main' into aea-5308-notify-callback
wildjames 4686dc9
Merge branch 'main' into aea-5308-notify-callback
wildjames 1a5d454
Debug logging
wildjames 111d53c
Remove logs
wildjames 2e638f3
Comments
wildjames 6179c4c
Implement table update function. re-add GSI back to table, this time …
wildjames b07b60d
Merge branch 'main' into aea-5308-notify-callback
wildjames 5fba026
Logging update
wildjames bff733d
unit tests for lambda handler
wildjames 9657967
Mostly tested
wildjames 6305926
Last bit of coverage
wildjames 789d809
re-enable quality checks
wildjames 6682d19
Some cleanup bits
wildjames 61a9a8d
Merge main
wildjames de8142e
Merge branch 'aea-5206-check-cooldown-when-sending' into aea-5308-not…
wildjames 4eb9d37
Add secrets. Empty for now
wildjames b6b3842
Merge branch 'main' into aea-5308-notify-callback
wildjames 79dd025
Fix typo
wildjames 2116056
Update configuration
wildjames 5a05a06
Merge branch 'aea-5308-notify-callback' of github.com:NHSDigital/eps-…
wildjames e28d282
Merge branch 'main' into aea-5308-notify-callback
wildjames e88059b
Stack name
wildjames cb5e23e
Rename resource to prevent collision
wildjames 5fdb9aa
Change the value of the test ODS code
wildjames 593e325
Only pass required information through the SQS message
wildjames 2e29275
Merge branch 'main' into aea-5308-notify-callback
wildjames 38021af
TODO notes
wildjames dfaf786
Merge branch 'aea-5308-notify-callback' of github.com:NHSDigital/eps-…
wildjames 4d9e7fc
Trigger build
wildjames 99c71f8
Remove the table
wildjames 9a0b79e
Keep the table, but remove references to it
wildjames 386acd7
Remove debugging line
wildjames 9463811
Revert to previously deployed table state
wildjames 61b8935
Merge branch 'main' into aea-0000-redeploy-notification-table-stage-1
wildjames 3fa702d
Merge branch 'main' into aea-5308-notify-callback
wildjames e6c2f34
First pass at a script to update the secrets during deployment
wildjames bdf7f31
Trigger build
wildjames 479949b
Move to the new table
wildjames 288b3e0
Re-add the references to the table
wildjames 1fce3a2
Merge branch 'aea-0000-redeploy-notification-table-stage-2' into aea-…
wildjames 33eae84
Fix table definition
wildjames da61195
Merge branch 'main' into aea-5308-notify-callback
wildjames 57e7feb
Merge branch 'main' into aea-5308-notify-callback
wildjames 145e652
Fix typo
wildjames 7fe18b1
Merge branch 'main' into aea-5308-notify-callback
wildjames 1b66d14
Rework how I import additional policies - why did it stop working?
wildjames 9c786cc
Merge branch 'main' into aea-5308-notify-callback
wildjames f3b8d11
revert to usual version of additional policies
wildjames ee28032
Update some missed name changes
wildjames 96d5a78
Forgot to double brace the variable
wildjames 069192c
Fix incorrectly addressing secrets
wildjames 3ad4708
Throw errors if the app name or api key are not set in the callback
wildjames e82b994
Remove secret update as part of the workflow (moved secrets to accoun…
wildjames 4050347
Remove reference to secrets
wildjames 85dc926
Update comment - resolved toto
wildjames a446284
Merge branch 'main' into aea-5308-notify-callback
wildjames 614c438
Update secret import name
wildjames 7845ca9
Debugging
wildjames e6e4abe
Update the code to fetch secrets at runtime
wildjames 919facf
Revert "Update the code to fetch secrets at runtime"
wildjames 768ceb2
Pass in secret value at deployment time instead
wildjames f38ba4c
Merge branch 'main' into aea-5308-notify-callback
wildjames 3814406
Pass in secret values a different way
wildjames 900cadd
Correct name
wildjames 217e0dd
Why is aws trying to parse my string into a json
wildjames beca5fd
Update postman collection
wildjames 072fd79
Reenable quality checks
wildjames 7be8b8e
Broke a tests, oops
wildjames 319bdcf
Update docs
wildjames 96502bd
Merge branch 'aea-5308-callback-specification-docs' into aea-5308-not…
wildjames 936bd21
Merge branch 'main' into aea-5308-notify-callback
wildjames ab252cc
minor tweak to remove some temporary logic
wildjames 1592e28
rename a field and add a fallback for SQS message ID
wildjames 1dbfe6a
Remove accidentally committed file
wildjames 81cd95a
Merge branch 'main' into aea-5308-notify-callback
wildjames 5d044b7
Update spec
wildjames 41d89a8
Update postman collection description
wildjames 91eeeb1
Refactor postman script
wildjames 618adb3
Use the correct proxygen security level
wildjames 8e3f5cb
Merge branch 'main' into aea-5308-notify-callback
wildjames c35b774
add the parameter for API key
wildjames 67d7019
Merge branch 'main' into aea-5308-notify-callback
wildjames b4f7c18
Rename api key parameter
wildjames 0c47769
Update spec
wildjames 734d01f
Update schema again
wildjames 57bf98c
Try adding app level to grants
wildjames 3614e78
Add the grants to the spec
wildjames 4ee8c35
Update deployment script
wildjames 6e0acf1
Signature issue - add a debug log statement
wildjames 59d9db7
Remove debug logging statement
wildjames 41ae116
Remove unnecessary access block
wildjames ce49a5a
Capitalise ApiKey
wildjames 4bdc236
Merge branch 'main' into aea-5308-notify-callback
wildjames aaa9f1c
Tell the secrets to get the current value
wildjames 0503ca1
Get secrets at runtime
wildjames d9fb311
Update and fix tests
wildjames 7194614
Add some debug logging
wildjames 016a61f
Add permission to read secrets
wildjames 5fb8bef
Used the wrong policy
wildjames 0d77e32
Try inline policy
wildjames 4d8428e
Forgot to pass logger object in
wildjames e1d8a9e
Minor refactor
wildjames c67adb3
Fix test
wildjames 9479dc5
Forgot to await the fetchsecrets function. Fixed that
wildjames 964963d
Move lambda get secrets policy to the lambda role
wildjames 5a3108f
Update postman collection
wildjames d522ee0
Use existing policy
wildjames 0b22850
Merge branch 'main' into aea-5308-notify-callback
wildjames 3983bde
Update lambda config to use new secrets
wildjames 52f9e2f
Refactor so that bad messages are ignored, but good ones are still pr…
wildjames 494a171
Fix secret names and role
wildjames 7196b26
Remove debug statement
wildjames ae5a69c
Merge branch 'main' into aea-5308-notify-callback
wildjames File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| AWSTemplateFormatVersion: "2010-09-09" | ||
|
|
||
| Parameters: | ||
| StackName: | ||
| Type: String | ||
| Default: none | ||
|
|
||
| Resources: | ||
| SQSSaltSecret: | ||
| Type: AWS::SecretsManager::Secret | ||
| Properties: | ||
| Name: !Sub ${StackName}-SqsSaltSecret | ||
| Description: Auto-generated salt for SQS_SALT | ||
| GenerateSecretString: | ||
| SecretStringTemplate: "{}" | ||
| GenerateStringKey: salt | ||
| PasswordLength: 32 | ||
| ExcludePunctuation: true | ||
|
|
||
| Outputs: | ||
| SQSSaltSecret: | ||
| Description: The ARN of the randomly generated SQS salt | ||
| Value: !Ref SQSSaltSecret | ||
| Export: | ||
| Name: !Join [":", [!Ref "StackName", "SQSSaltSecret"]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been moved to the
secrets/main.yamlSAM template