merge from main

This commit is contained in:
Kenneth Kehl
2024-04-16 13:08:06 -07:00
7 changed files with 41 additions and 85 deletions

View File

@@ -157,9 +157,11 @@ jobs:
- uses: ./.github/actions/setup-project - uses: ./.github/actions/setup-project
- name: Create requirements.txt - name: Create requirements.txt
run: poetry export --without-hashes --format=requirements.txt > requirements.txt run: poetry export --without-hashes --format=requirements.txt > requirements.txt
- uses: pypa/gh-action-pip-audit@v1.0.6 - uses: pypa/gh-action-pip-audit@v1.0.8
with: with:
inputs: requirements.txt inputs: requirements.txt
ignore-vulns: |
GHSA-w3h3-4rj7-4ph4
- name: Run npm audit - name: Run npm audit
run: make npm-audit run: make npm-audit

View File

@@ -226,7 +226,6 @@ def sign_in():
form=form, form=form,
again=bool(redirect_url), again=bool(redirect_url),
other_device=other_device, other_device=other_device,
login_gov_enabled=True,
password_reset_url=password_reset_url, password_reset_url=password_reset_url,
initial_signin_url=url, initial_signin_url=url,
) )

View File

@@ -7,7 +7,7 @@
Sorry, we can't deliver what you asked for right now. Sorry, we can't deliver what you asked for right now.
</h1> </h1>
<p class="usa-body"> <p class="usa-body">
Please try again later or <a class="usa-link" href="mailto:notify-support@gsa.gov"></a>email us</a> for more information.</p> Please try again later or <a class="usa-link" href="mailto:notify-support@gsa.gov">email us</a> for more information.</p>
</p> </p>
</div> </div>
</div> </div>

View File

@@ -12,18 +12,6 @@
{% block maincolumn_content %} {% block maincolumn_content %}
{% if login_gov_enabled %}
<div class="grid-row">
<div id="countdown-container" class="usa-alert usa-alert--warning width-full margin-bottom-4">
<div class="usa-alert__body">
<h4 class="usa-alert__heading">Login.gov is required by April 16, 2024</h4>
<p class="usa-alert__text">
You have <span id="countdown"></span> left to use Login.gov to sign in
</p>
</div>
</div>
</div>
{% endif %}
<div class="grid-row margin-bottom-4"> <div class="grid-row margin-bottom-4">
<div class="tablet:grid-col-5"> <div class="tablet:grid-col-5">
{% if again %} {% if again %}
@@ -39,22 +27,12 @@
{% endif %} {% endif %}
{% else %} {% else %}
<h1 class="font-body-2xl margin-bottom-3">Sign in</h1> <h1 class="font-body-2xl margin-bottom-3">Sign in</h1>
{% if login_gov_enabled %} <p>Access your Notify.gov account by signing in with Login.gov:</p>
<p>You can access your account by signing in with one of the options below:</p> <a class="usa-link usa-button" href="{{ initial_signin_url }}">Sign in with Login.gov</a>
<a class="usa-link usa-button usa-button--outline" href="{{ initial_signin_url }}">Sign in with Login.gov</a>
<p class="margin-y-3"><strong>Or:</strong></p>
{% endif %}
{% endif %} {% endif %}
{% call form_wrapper(autocomplete=True) %}
{{ form.email_address(param_extensions={"autocomplete": "email"}) }}
{{ form.password(param_extensions={"autocomplete": "current-password"}) }}
{{ page_footer("Continue", secondary_link=password_reset_url, secondary_link_text="Forgot your password?") }}
{% endcall %}
</div> </div>
{% if login_gov_enabled %}
<div class="tablet:grid-col-6 tablet:grid-offset-1 margin-top-2 padding-y-2 padding-x-4 bg-base-lightest"> <div class="tablet:grid-col-6 tablet:grid-offset-1 margin-top-2 padding-y-2 padding-x-4 bg-base-lightest">
<h2 class="font-body-lg">Notify.gov is changing the sign-in experience to Login.gov effective<br>April 16, 2024</h2> <h2 class="font-body-lg">Effective April 16, 2024 Notify.gov requires you sign-in through Login.gov</h2>
<p>Why are we doing this?</p> <p>Why are we doing this?</p>
<ul class="usa-list"> <ul class="usa-list">
<li><strong>Enhanced security:</strong> Login.gov is really secure and trustworthy</li> <li><strong>Enhanced security:</strong> Login.gov is really secure and trustworthy</li>
@@ -64,12 +42,11 @@
<p>What do I need to do?</p> <p>What do I need to do?</p>
<ul class="usa-list"> <ul class="usa-list">
<li>If you have a Login.gov account, start using it to sign in to Notify today.</li> <li>If you have a Login.gov account, start using it to sign in to Notify today.</li>
<li>If you dont have a Login.gov account, you must create one by April 16, 2024 to continue to access Notify.</li> <li>If you dont have a Login.gov account, you must create one to continue to access Notify.</li>
</ul> </ul>
<div class="border-bottom border-base-lighter margin-y-4"></div> <div class="border-bottom border-base-lighter margin-y-4"></div>
<a class="usa-link usa-button margin-bottom-3" href="{{ initial_signin_url }}">Create Login.gov account</a> <a class="usa-link usa-button usa-button--outline margin-bottom-3" href="{{ initial_signin_url }}">Create Login.gov account</a>
</div> </div>
</div> </div>
{% endif %}
{% endblock %} {% endblock %}

46
poetry.lock generated
View File

@@ -87,33 +87,33 @@ lxml = ["lxml"]
[[package]] [[package]]
name = "black" name = "black"
version = "24.3.0" version = "24.4.0"
description = "The uncompromising code formatter." description = "The uncompromising code formatter."
optional = false optional = false
python-versions = ">=3.8" python-versions = ">=3.8"
files = [ files = [
{file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, {file = "black-24.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6ad001a9ddd9b8dfd1b434d566be39b1cd502802c8d38bbb1ba612afda2ef436"},
{file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, {file = "black-24.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e3a3a092b8b756c643fe45f4624dbd5a389f770a4ac294cf4d0fce6af86addaf"},
{file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, {file = "black-24.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dae79397f367ac8d7adb6c779813328f6d690943f64b32983e896bcccd18cbad"},
{file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, {file = "black-24.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:71d998b73c957444fb7c52096c3843875f4b6b47a54972598741fe9a7f737fcb"},
{file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, {file = "black-24.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8e5537f456a22cf5cfcb2707803431d2feeb82ab3748ade280d6ccd0b40ed2e8"},
{file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, {file = "black-24.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:64e60a7edd71fd542a10a9643bf369bfd2644de95ec71e86790b063aa02ff745"},
{file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, {file = "black-24.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cd5b4f76056cecce3e69b0d4c228326d2595f506797f40b9233424e2524c070"},
{file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, {file = "black-24.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:64578cf99b6b46a6301bc28bdb89f9d6f9b592b1c5837818a177c98525dbe397"},
{file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, {file = "black-24.4.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f95cece33329dc4aa3b0e1a771c41075812e46cf3d6e3f1dfe3d91ff09826ed2"},
{file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, {file = "black-24.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4396ca365a4310beef84d446ca5016f671b10f07abdba3e4e4304218d2c71d33"},
{file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, {file = "black-24.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44d99dfdf37a2a00a6f7a8dcbd19edf361d056ee51093b2445de7ca09adac965"},
{file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, {file = "black-24.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:21f9407063ec71c5580b8ad975653c66508d6a9f57bd008bb8691d273705adcd"},
{file = "black-24.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837"}, {file = "black-24.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:652e55bb722ca026299eb74e53880ee2315b181dfdd44dca98e43448620ddec1"},
{file = "black-24.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd"}, {file = "black-24.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7f2966b9b2b3b7104fca9d75b2ee856fe3fdd7ed9e47c753a4bb1a675f2caab8"},
{file = "black-24.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213"}, {file = "black-24.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bb9ca06e556a09f7f7177bc7cb604e5ed2d2df1e9119e4f7d2f1f7071c32e5d"},
{file = "black-24.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959"}, {file = "black-24.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:d4e71cdebdc8efeb6deaf5f2deb28325f8614d48426bed118ecc2dcaefb9ebf3"},
{file = "black-24.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb"}, {file = "black-24.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6644f97a7ef6f401a150cca551a1ff97e03c25d8519ee0bbc9b0058772882665"},
{file = "black-24.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7"}, {file = "black-24.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:75a2d0b4f5eb81f7eebc31f788f9830a6ce10a68c91fbe0fade34fff7a2836e6"},
{file = "black-24.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7"}, {file = "black-24.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb949f56a63c5e134dfdca12091e98ffb5fd446293ebae123d10fc1abad00b9e"},
{file = "black-24.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f"}, {file = "black-24.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:7852b05d02b5b9a8c893ab95863ef8986e4dda29af80bbbda94d7aee1abf8702"},
{file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, {file = "black-24.4.0-py3-none-any.whl", hash = "sha256:74eb9b5420e26b42c00a3ff470dc0cd144b80a766128b1771d07643165e08d0e"},
{file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, {file = "black-24.4.0.tar.gz", hash = "sha256:f07b69fda20578367eaebbd670ff8fc653ab181e1ff95d84497f9fa20e7d0641"},
] ]
[package.dependencies] [package.dependencies]

View File

@@ -222,8 +222,7 @@ def test_if_existing_user_accepts_twice_they_redirect_to_sign_in(
) == ( ) == (
"You need to sign in again", "You need to sign in again",
# TODO: Improve this given Login.gov configuration. # TODO: Improve this given Login.gov configuration.
# "We signed you out because you have not used Notify for a while.", "We signed you out because you have not used Notify for a while.",
"You have left to use Login.gov to sign in",
) )
# We dont let people update `email_access_validated_at` using an # We dont let people update `email_access_validated_at` using an
# already-accepted invite # already-accepted invite
@@ -338,8 +337,7 @@ def test_existing_user_of_service_get_redirected_to_signin(
) == ( ) == (
"You need to sign in again", "You need to sign in again",
# TODO: Improve this given Login.gov configuration. # TODO: Improve this given Login.gov configuration.
# "We signed you out because you have not used Notify for a while.", "We signed you out because you have not used Notify for a while.",
"You have left to use Login.gov to sign in",
) )
assert mock_accept_invite.call_count == 1 assert mock_accept_invite.call_count == 1
@@ -429,8 +427,7 @@ def test_existing_signed_out_user_accept_invite_redirects_to_sign_in(
) == ( ) == (
"You need to sign in again", "You need to sign in again",
# TODO: Improve this given Login.gov configuration. # TODO: Improve this given Login.gov configuration.
# "We signed you out because you have not used Notify for a while.", "We signed you out because you have not used Notify for a while.",
"You have left to use Login.gov to sign in",
) )

View File

@@ -12,40 +12,21 @@ def test_render_sign_in_template_for_new_user(client_request):
client_request.logout() client_request.logout()
page = client_request.get("main.sign_in") page = client_request.get("main.sign_in")
assert normalize_spaces(page.select_one("h1").text) == "Sign in" assert normalize_spaces(page.select_one("h1").text) == "Sign in"
assert normalize_spaces(page.select("label")[0].text) == "Email address" assert (
assert page.select_one("#email_address").get("value") is None page.select("main p")[0].text
assert page.select_one("#email_address")["autocomplete"] == "email" == "Access your Notify.gov account by signing in with Login.gov:"
assert normalize_spaces(page.select("label")[1].text) == "Password" )
assert page.select_one("#password").get("value") is None
assert page.select_one("#password")["autocomplete"] == "current-password"
# Removing for the pilot
# assert page.select('main a')[0].text == 'create one now'
# assert page.select('main a')[0]['href'] == url_for('main.register')
# TODO: Fix this test to be less brittle! If the Login.gov link is enabled, # TODO: Fix this test to be less brittle! If the Login.gov link is enabled,
# then these indices need to be 1 instead of 0. # then these indices need to be 1 instead of 0.
# Currently it's not enabled for the test or production environments. # Currently it's not enabled for the test or production environments.
assert page.select("main a")[1].text == "Forgot your password?" assert page.select("main a")[0].text == "Sign in with Login.gov"
assert page.select("main a")[1]["href"] == url_for("main.forgot_password") assert page.select("main a")[1].text == "Create Login.gov account"
# TODO: We'll have to adjust this depending on whether Login.gov is # TODO: We'll have to adjust this depending on whether Login.gov is
# enabled or not; fix this in the future. # enabled or not; fix this in the future.
assert "Sign in again" not in normalize_spaces(page.text) assert "Sign in again" not in normalize_spaces(page.text)
def test_render_sign_in_template_with_next_link_for_password_reset(client_request):
client_request.logout()
page = client_request.get(
"main.sign_in",
_optional_args=f"?next=/services/{SERVICE_ONE_ID}/templates",
_test_page_title=False,
)
forgot_password_link = page.find("a", class_="usa-link")
assert forgot_password_link.text == "Forgot your password?"
assert forgot_password_link["href"] == url_for(
"main.forgot_password", next=f"/services/{SERVICE_ONE_ID}/templates"
)
def test_reformat_keystring(): def test_reformat_keystring():
orig = "-----BEGIN PRIVATE KEY----- blah blah blah -----END PRIVATE KEY-----" orig = "-----BEGIN PRIVATE KEY----- blah blah blah -----END PRIVATE KEY-----"
expected = """-----BEGIN PRIVATE KEY----- expected = """-----BEGIN PRIVATE KEY-----