Skip to content

Commit

Permalink
Merge branch 'main' into task/remove-letters
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbahrai authored Jun 10, 2024
2 parents df13a1d + 768fbe9 commit 25469ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@c64f0a7231aa68a6849c2b65bf16af3daa23d3e6
uses: ossf/scorecard-action@7699f539c2b9ff754039f0e173fdf1a4e4a1e143
with:
results_file: ossf-results.json
results_format: json
Expand Down
4 changes: 2 additions & 2 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ class Config(object):
AWS_SES_ACCESS_KEY = os.getenv("AWS_SES_ACCESS_KEY")
AWS_SES_SECRET_KEY = os.getenv("AWS_SES_SECRET_KEY")
AWS_PINPOINT_REGION = os.getenv("AWS_PINPOINT_REGION", "us-west-2")
AWS_PINPOINT_SC_POOL_ID = os.getenv("AWS_PINPOINT_SC_POOL_ID", None)
AWS_PINPOINT_DEFAULT_POOL_ID = os.getenv("AWS_PINPOINT_DEFAULT_POOL_ID", None)
AWS_PINPOINT_SC_POOL_ID = os.getenv("AWS_PINPOINT_SC_POOL_ID", "")
AWS_PINPOINT_DEFAULT_POOL_ID = os.getenv("AWS_PINPOINT_DEFAULT_POOL_ID", "")
AWS_PINPOINT_CONFIGURATION_SET_NAME = os.getenv("AWS_PINPOINT_CONFIGURATION_SET_NAME", "pinpoint-configuration")
AWS_PINPOINT_SC_TEMPLATE_IDS = env.list("AWS_PINPOINT_SC_TEMPLATE_IDS", [])
AWS_US_TOLL_FREE_NUMBER = os.getenv("AWS_US_TOLL_FREE_NUMBER")
Expand Down
5 changes: 2 additions & 3 deletions app/delivery/send_to_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,9 @@ def provider_to_use(
do_not_use_pinpoint = (
has_dedicated_number
or sending_to_us_number
or current_app.config["AWS_PINPOINT_SC_POOL_ID"] is None
or (current_app.config["AWS_PINPOINT_DEFAULT_POOL_ID"] is None and not using_sc_pool_template)
or not current_app.config["AWS_PINPOINT_SC_POOL_ID"]
or ((not current_app.config["AWS_PINPOINT_DEFAULT_POOL_ID"]) and not using_sc_pool_template)
)

if do_not_use_pinpoint:
active_providers_in_order = [
p
Expand Down
6 changes: 3 additions & 3 deletions tests/app/delivery/test_send_to_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_should_use_sns_for_sms_by_default_if_partially_configured(self, restore
notify_api,
{
"AWS_PINPOINT_SC_POOL_ID": "sc_pool_id",
"AWS_PINPOINT_DEFAULT_POOL_ID": None,
"AWS_PINPOINT_DEFAULT_POOL_ID": "",
"AWS_PINPOINT_SC_TEMPLATE_IDS": [],
},
):
Expand All @@ -81,7 +81,7 @@ def test_should_use_pinpoint_for_sms_for_sc_template_if_sc_pool_configured(self,
notify_api,
{
"AWS_PINPOINT_SC_POOL_ID": "sc_pool_id",
"AWS_PINPOINT_DEFAULT_POOL_ID": None,
"AWS_PINPOINT_DEFAULT_POOL_ID": "",
"AWS_PINPOINT_SC_TEMPLATE_IDS": [str(sc_template)],
},
):
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_should_use_sns_for_sms_if_sending_to_the_US(self, restore_provider_deta
provider = send_to_providers.provider_to_use("sms", "1234", "+17065551234")
assert provider.name == "sns"

@pytest.mark.parametrize("sc_pool_id, default_pool_id", [(None, "default_pool_id"), ("sc_pool_id", None)])
@pytest.mark.parametrize("sc_pool_id, default_pool_id", [("", "default_pool_id"), ("sc_pool_id", "")])
def test_should_use_sns_if_pinpoint_not_configured(self, restore_provider_details, notify_api, sc_pool_id, default_pool_id):
with set_config_values(
notify_api,
Expand Down

0 comments on commit 25469ec

Please sign in to comment.