-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
SNS: v2 add http endpoint for opting out phone numbers #13540
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
base: main
Are you sure you want to change the base?
Conversation
Test Results - Preflight, Unit22 981 tests ±0 21 139 ✅ ±0 6m 29s ⏱️ +20s Results for commit a225dbad. ± Comparison against base commit 14d1ccb. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Acceptance7 tests ±0 5 ✅ ±0 3m 2s ⏱️ ±0s Results for commit a225dbad. ± Comparison against base commit 14d1ccb. ♻️ This comment has been updated with latest results. |
Test Results - Alternative Providers208 tests - 1 260 164 ✅ - 723 2m 11s ⏱️ - 30m 58s Results for commit a225dbad. ± Comparison against base commit 14d1ccb. This pull request removes 1261 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files ± 0 5 suites ±0 1h 29m 43s ⏱️ - 1h 6m 23s Results for commit a225dbad. ± Comparison against base commit 14d1ccb. This pull request removes 2409 and adds 1 tests. Note that renamed tests count towards both.This pull request removes 388 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 1h 0m 19s ⏱️ - 54m 18s Results for commit a225dbad. ± Comparison against base commit 14d1ccb. This pull request removes 2032 and adds 1 tests. Note that renamed tests count towards both.This pull request removes 224 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
bentsku
left a comment
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.
Awesome, nice addition! Just a minor comment regarding marking the test as not runnable in a different process, but then we're good to go 🚀
| TAGS: TaggingService = CrossRegionAttribute(default=TaggingService) | ||
|
|
||
| PHONE_NUMBERS_OPTED_OUT: list[PhoneNumber] = CrossRegionAttribute(default=list) | ||
| PHONE_NUMBERS_OPTED_OUT: set[PhoneNumber] = CrossRegionAttribute(default=set) |
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.
quick followup question from the previous PR: should we put this back as lower case to follow the rest of the attributes?
| response = aws_client.sns.check_if_phone_number_is_opted_out(phoneNumber=phone_number) | ||
| assert not response["isOptedOut"] | ||
| data = {"phoneNumber": phone_number, "accountId": account_id} | ||
| requests.post("http://localhost:4566/_aws/sns/phone-opt-outs", data=json.dumps(data)) |
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.
nit: might be worth switch this to phone_url = config.external_service_url() + SMS_PHONE_NUMBER_OPT_OUT_ENDPOINT like the other tests.
Also worth saying that the other endpoint tests are using internal_service_url, so those won't work in the k8s environment, so it might be worth marking this test as @markers.requires_in_process for now until we can validate they would work 👍
Motivation
In AWS, you can opt-out phone numbers so they are not included in sms push notifications. This opt-out is usually done via keyword response (STOP and similar words) to the sms message, or can be done in AWS Console in a Service called Pinpoint.
This PR therefore implements a simple endpoint to allow users opting-out phone numbers for the sake testing and using SNS' opted-out operations.
closes PNX-549
Changes
/_aws/sns/phone-opt-outsas POST endpoint to SNSTests
Related