diff --git a/app/celery/provider_tasks.py b/app/celery/provider_tasks.py index 30bb2e1d8..80f0de92a 100644 --- a/app/celery/provider_tasks.py +++ b/app/celery/provider_tasks.py @@ -34,7 +34,7 @@ def check_sms_delivery_receipt(self, message_id, notification_id, sent_at): failure appears in the cloudwatch logs, so this should keep retrying until the log appears, or until we run out of retries. """ - # TODO the localstack version of cloudwatch doesn't have our log groups. Possibly create them with awslocal? + # TODO the localstack cloudwatch doesn't currently have our log groups. Possibly create them with awslocal? if aws_cloudwatch_client.is_localstack(): status = 'success' provider_response = 'this is a fake successful localstack sms message' diff --git a/app/user/rest.py b/app/user/rest.py index f9cfbb728..14821424c 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -1,4 +1,5 @@ import json +import os import uuid from datetime import datetime from urllib.parse import urlencode @@ -197,6 +198,11 @@ def verify_user_password(user_id): @user_blueprint.route('//verify/code', methods=['POST']) def verify_user_code(user_id): + + # TODO -- Hmmm! Is this safe? + if os.getenv("LOCALSTACK_ENDPOINT_URL"): + return jsonify({}), 204 + data = request.get_json() validate(data, post_verify_code_schema) diff --git a/docs/localstack.md b/docs/localstack.md index d3503ad9a..2e9ad5c48 100644 --- a/docs/localstack.md +++ b/docs/localstack.md @@ -11,19 +11,21 @@ How to Use Localstack in Your Development Work ### Install Localstack (One-Time) * >pip install --upgrade localstack -* >localstack --version +* >localstack --version # should be 2.2.0 or later ### Add LOCALSTACK_ENDPOINT_URL to Your .env File (One-Time) -* Find the value in the sample.env file. Copy and uncomment it into your .env file +* Find the value in the sample.env file (# LOCALSTACK_ENDPOINT_URL=http://localhost:4566). +* Copy and uncomment it into your .env file ### Run with Localstack (Recurring) #### Start Docker Desktop and localstack image * Open Docker Desktop from Finder -* Images->Local->localstack/localstack click on start button on right hand side +* Images->Local->localstack/localstack click on the start button on the right hand side to get the localstack + docker image going #### Start Localstack @@ -32,9 +34,11 @@ How to Use Localstack in Your Development Work * >localstack start * >pipenv run localstack start -#### Proceed Normally +#### Proceed With Your Usual Development Activities Assuming you followed all these steps and nothing went wrong, you should be running with localstack for SNS now. You should be able to send an SMS message in the UI and observe it in the dashboard moving from Pending to Delivered over a period of five minutes. And you should not receive a text message. +NOTE: You will still be prompted for a 2FA code when you log in, but you will not receive a text message on any device. +To login, enter any six digit number. \ No newline at end of file