From 0a961c2e0d59befb1d5195eb7a5d3a1310c81a5b Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 19 Sep 2023 10:48:50 -0700 Subject: [PATCH 01/78] chore(deploy): pip freeze to a static file similar to having the SHA, will help confirm changes and debug --- .github/workflows/deploy.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e9625fb06..7a2a83d6f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,6 +22,20 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version-file: .github/workflows/.python-version + cache: pip + cache-dependency-path: "**/pyproject.toml" + + - name: Write python packages to file + run: | + python -m venv .venv + source .venv/bin/activate + pip install -e . + pip freeze + pip freeze >> benefits/static/requirements.txt + - name: Write commit SHA to file run: echo "${{ github.sha }}" >> benefits/static/sha.txt From fe2f5dabec11ec97b8211aafed950b5a4b35ef83 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 20 Sep 2023 23:02:36 +0000 Subject: [PATCH 02/78] chore(docker): remove platform designation, no longer needed --- compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/compose.yml b/compose.yml index c5e2dea99..6d284afd5 100644 --- a/compose.yml +++ b/compose.yml @@ -8,7 +8,6 @@ services: dockerfile: appcontainer/Dockerfile image: benefits_client:latest env_file: .env - platform: linux/amd64 ports: - "${DJANGO_LOCAL_PORT:-8000}:8000" @@ -22,7 +21,6 @@ services: entrypoint: sleep infinity depends_on: - server - platform: linux/amd64 ports: - "${DJANGO_LOCAL_PORT:-8000}:8000" volumes: @@ -32,7 +30,6 @@ services: image: benefits_client:dev entrypoint: mkdocs command: serve --dev-addr "0.0.0.0:8001" - platform: linux/amd64 ports: - "8001" volumes: From 59f2a1f42e002d63a9cf2c73959e61680e6608bc Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 21 Sep 2023 21:51:21 +0000 Subject: [PATCH 03/78] chore(tests): use coverage directly to run tests no need for the pytest-cov wrapper library --- pyproject.toml | 2 +- tests/pytest/run.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 780a8a3c4..71413794b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ dev = [ "pre-commit", ] test = [ + "coverage", "pytest", - "pytest-cov", "pytest-django", "pytest-mock", "pytest-socket", diff --git a/tests/pytest/run.sh b/tests/pytest/run.sh index afc4c5aff..37b044199 100755 --- a/tests/pytest/run.sh +++ b/tests/pytest/run.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash set -eu -pytest --cov=benefits --cov-branch --import-mode=importlib --no-migrations +# run normal pytests +coverage run -m pytest --no-migrations # clean out old coverage results rm -rf benefits/static/coverage + coverage html --directory benefits/static/coverage From fba49f4dd95569b57c5b97963ed9b0afb93fae20 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 21 Sep 2023 21:52:36 +0000 Subject: [PATCH 04/78] chore(ci): add coverage comment step --- .github/workflows/tests-pytest.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/tests-pytest.yml b/.github/workflows/tests-pytest.yml index 0817edf99..531c318c3 100644 --- a/.github/workflows/tests-pytest.yml +++ b/.github/workflows/tests-pytest.yml @@ -5,6 +5,14 @@ on: [push, pull_request] jobs: pytest: runs-on: ubuntu-latest + permissions: + # Gives the action the necessary permissions for publishing new + # comments in pull requests. + pull-requests: write + # Gives the action the necessary permissions for pushing data to the + # python-coverage-comment-action branch, and for editing existing + # comments (to avoid publishing multiple comments in the same PR) + contents: write steps: - name: Check out code uses: actions/checkout@v4 @@ -34,3 +42,10 @@ jobs: with: name: coverage-report path: benefits/static/coverage + + - name: Coverage comment + uses: py-cov-action/python-coverage-comment-action@v3 + with: + GITHUB_TOKEN: ${{ github.token }} + MINIMUM_GREEN: 90 + MINIMUM_ORANGE: 80 From 1a3654c0ca17d2697c42b549d342bfb577144f29 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 21 Sep 2023 21:56:22 +0000 Subject: [PATCH 05/78] chore(tests): rename sample classes avoids warning that pytest can't find test cases to collect --- tests/pytest/core/test_models.py | 6 +++--- tests/pytest/eligibility/test_views.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/pytest/core/test_models.py b/tests/pytest/core/test_models.py index 1ba7f2854..eb345920b 100644 --- a/tests/pytest/core/test_models.py +++ b/tests/pytest/core/test_models.py @@ -121,7 +121,7 @@ def test_EligibilityVerifier_str(model_EligibilityVerifier): assert str(model_EligibilityVerifier) == model_EligibilityVerifier.name -class TestFormClass: +class SampleFormClass: """A class for testing EligibilityVerifier form references.""" def __init__(self, *args, **kwargs): @@ -131,14 +131,14 @@ def __init__(self, *args, **kwargs): @pytest.mark.django_db def test_EligibilityVerifier_form_instance(model_EligibilityVerifier): - model_EligibilityVerifier.form_class = f"{__name__}.TestFormClass" + model_EligibilityVerifier.form_class = f"{__name__}.SampleFormClass" model_EligibilityVerifier.save() args = (1, "2") kwargs = {"one": 1, "two": "2"} form_instance = model_EligibilityVerifier.form_instance(*args, **kwargs) - assert isinstance(form_instance, TestFormClass) + assert isinstance(form_instance, SampleFormClass) assert form_instance.args == args assert form_instance.kwargs == kwargs diff --git a/tests/pytest/eligibility/test_views.py b/tests/pytest/eligibility/test_views.py index f7c6e3df5..3a8a430e1 100644 --- a/tests/pytest/eligibility/test_views.py +++ b/tests/pytest/eligibility/test_views.py @@ -53,7 +53,7 @@ def invalid_form_data(): return {"invalid": "data"} -class TestVerificationForm(EligibilityVerificationForm): +class SampleVerificationForm(EligibilityVerificationForm): def __init__(self, *args, **kwargs): super().__init__( "title", @@ -72,7 +72,7 @@ def __init__(self, *args, **kwargs): @pytest.fixture def model_EligibilityVerifier_with_form_class(mocker, model_EligibilityVerifier): - model_EligibilityVerifier.form_class = f"{__name__}.TestVerificationForm" + model_EligibilityVerifier.form_class = f"{__name__}.SampleVerificationForm" model_EligibilityVerifier.save() mocker.patch("benefits.eligibility.views.session.verifier", return_value=model_EligibilityVerifier) return model_EligibilityVerifier From c3b8720f8bc492c12518fd68898cbc9b7526ff03 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 21 Sep 2023 22:07:23 +0000 Subject: [PATCH 06/78] fix(coverage): run with relative files on see https://coverage.readthedocs.io/en/6.2/config.html#config-run-relative-files needed by coverage comment: https://github.com/py-cov-action/python-coverage-comment-action?tab=readme-ov-file#setup --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 71413794b..18c185802 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ include = '\.pyi?$' omit = [ "benefits/core/migrations/*" ] +relative_files = true [tool.djlint] ignore = "H017,H031" From 7c292f9fa83be79bb287e086fbc06541ee577240 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 21 Sep 2023 22:11:14 +0000 Subject: [PATCH 07/78] chore(coverage): only analyze app code --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 18c185802..9b3f17975 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,10 +46,12 @@ target-version = ['py311'] include = '\.pyi?$' [tool.coverage.run] +branch = true +relative_files = true omit = [ "benefits/core/migrations/*" ] -relative_files = true +source = ["benefits"] [tool.djlint] ignore = "H017,H031" From 3fa9c9e9cf424329e84d5bdbc2ee80a87fdf4622 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Fri, 22 Sep 2023 15:37:03 -0700 Subject: [PATCH 08/78] docs: adding veterans use case --- docs/use-cases/Veterans.md | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 docs/use-cases/Veterans.md diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md new file mode 100644 index 000000000..be5487153 --- /dev/null +++ b/docs/use-cases/Veterans.md @@ -0,0 +1,55 @@ +# Veterans enrollment pathway + +## Overview + +This use case describes a feature in the [Cal-ITP Benefits app](https://benefits.calitp.org) that allows US veterans who use public transit to verify their veteran status and receive reduced fares when paying by contactless debit or credit card at participating transit providers in California. + +**Actor:** A US veteran who uses public transit in California. For benefit eligibility, a veteran is defined as “a person who served in the active military, naval, or air service, and was discharged or released therefrom under conditions other than dishonorable.” ([source](https://www.ssa.gov/OP_Home/comp2/D-USC-38.html)) + +**Goal:** To verify a transit rider’s veteran status and enable the rider to receive reduced fares when paying by contactless debit or credit card. + +**Precondition:** The California transit provider delivering fixed route service has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the provider has a policy to offer a transit discount for US veterans. + +## **Basic Flow** + +![](https://t8631512.p.clickup-attachments.com/t8631512/5bc012c2-d4e5-4c44-8435-85dbe2f9efd8/Screenshot%202023-09-19%20at%203.58.29%20PM.png) + +1. The transit rider visits the web application at [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) in a browser on their desktop computer. +2. The transit rider chooses the transit provider that serves their area. +3. The transit rider selects the option to receive a reduced fare for veterans. +4. The transit rider authenticates with their existing [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov) account or creates a [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov) account if they don’t have one. +5. The Cal-ITP Benefits app interfaces with the [California Department of Technology](https://cdt.ca.gov/) Identity Gateway (IdG) to verify benefit eligibility. The IdG requests the required personal information to verify veteran status from [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov). +6. The IdG utilizes the [Veteran Confirmation API](https://developer.va.gov/explore/api/veteran-confirmation) provided by the US Department of Veterans Affairs to determine the rider’s veteran status. +7. The IdG passes the response from [VA.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/VA.gov) as veteran status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit. +8. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the payment processor that facilitates transit fare collection. +9. The app registers the veteran benefit with the transit rider’s debit or credit card. + +## **Alternative Flows** + +* If the transit rider does not have a desktop computer, they can open the web application at [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow. +* Suppose the transit rider cannot authenticate with [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov), or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare. +* If [VA.gov](http://VA.gov) determines the person does not meet the definition of a veteran (IdG returns a veteran status of FALSE), the Cal-ITP Benefits app will not allow the transit rider to enroll their contactless debit or credit card for a reduced fare. +* If the debit or credit card expires or is canceled by the issuer, the transit rider must repeat the basic flow to register a new debit or credit card. +* If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card. + +## **Postcondition** + +The transit rider receives a fare reduction each time they use the debit or credit card they registered to pay for transit rides. The number of times they can use the card to pay for transit is unlimited and the benefit never expires.  + +## **Benefits** + +* The transit rider no longer needs cash to pay for transit rides. +* The transit rider doesn’t have to lock up funds on a closed-loop card offered by the transit provider. +* The transit rider pays for transit rides with their debit or credit card, just as they pay for any other good or service that accepts contactless payment. +* The transit rider can enroll in a transit benefit from home when convenient; they do not have to visit a transit provider in person. +* Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov) and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies. +* Benefits enrollment takes minutes rather than days or weeks. + +## **Example Scenario** + +A veteran in California uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It’s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.  + +The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less. + +# Untitled + From 95362a0e528f5ff8c2031a63b0a588c5762b1989 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Sep 2023 22:41:47 +0000 Subject: [PATCH 09/78] chore(pre-commit): autofix run --- docs/use-cases/Veterans.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index be5487153..668905a50 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -52,4 +52,3 @@ A veteran in California uses public transit regularly. They don’t have a car a The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less. # Untitled - From 925145329def20e7548f1148586fc2cd612d4d84 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Fri, 22 Sep 2023 15:44:35 -0700 Subject: [PATCH 10/78] Update docs/use-cases/Veterans.md Co-authored-by: Angela Tran --- docs/use-cases/Veterans.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index 668905a50..48d683c59 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -51,4 +51,3 @@ A veteran in California uses public transit regularly. They don’t have a car a The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less. -# Untitled From 80564d2f8c5947211b6a54460bafb4a4fc17031a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Sep 2023 22:44:52 +0000 Subject: [PATCH 11/78] chore(pre-commit): autofix run --- docs/use-cases/Veterans.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index 48d683c59..7dca4a175 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -50,4 +50,3 @@ The transit rider receives a fare reduction each time they use the debit or cred A veteran in California uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It’s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.  The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less. - From 597eb50cbe3c1488e55e0a9c82cfd0c9f4c04a2a Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Fri, 22 Sep 2023 15:54:59 -0700 Subject: [PATCH 12/78] docs: replacing diagram image with mermaid code --- docs/use-cases/Veterans.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index 7dca4a175..fb8f8cd09 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -12,7 +12,40 @@ This use case describes a feature in the [Cal-ITP Benefits app](https://benefits ## **Basic Flow** -![](https://t8631512.p.clickup-attachments.com/t8631512/5bc012c2-d4e5-4c44-8435-85dbe2f9efd8/Screenshot%202023-09-19%20at%203.58.29%20PM.png) +```mermaid +sequenceDiagram +%% Veteran Enrollment Pathway + actor Transit Rider + participant Benefits as Benefits app + participant IdG as Identity Gateway + participant Login.gov + participant VA.gov + participant Littlepay +Transit Rider->>Benefits: visits benefits.calitp.org + activate Benefits +Benefits-->>IdG: eligibility verification + activate IdG +Transit Rider->>Login.gov: account authentication + activate Login.gov +IdG-->>Login.gov: requests required PII + activate Login.gov + Note right of Login.gov: transit rider first name
transit rider last name
home address
date of birth +Login.gov-->>IdG: returns required PII + deactivate Login.gov +IdG-->>VA.gov: check veteran status + activate VA.gov +VA.gov-->>IdG: return veteran status + deactivate VA.gov +IdG-->>Benefits: eligibility response + deactivate IdG + deactivate Login.gov +Benefits-->>Littlepay: payment enrollment start + activate Littlepay +Transit Rider->>Littlepay: provides debit or credit card details +Littlepay-->>Benefits: payment method enrollment confirmation + deactivate Littlepay + deactivate Benefits +``` 1. The transit rider visits the web application at [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) in a browser on their desktop computer. 2. The transit rider chooses the transit provider that serves their area. From dcb955a7b826e86d94592f118d9739379701fa32 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Fri, 22 Sep 2023 15:57:32 -0700 Subject: [PATCH 13/78] docs: removing clickup garbage in some link URLs --- docs/use-cases/Veterans.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index fb8f8cd09..bfc7c6b00 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -47,20 +47,20 @@ Littlepay-->>Benefits: payment method enrollment confirmation deactivate Benefits ``` -1. The transit rider visits the web application at [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) in a browser on their desktop computer. +1. The transit rider visits the web application at [benefits.calitp.org](https://benefits.calitp.org) in a browser on their desktop computer. 2. The transit rider chooses the transit provider that serves their area. 3. The transit rider selects the option to receive a reduced fare for veterans. -4. The transit rider authenticates with their existing [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov) account or creates a [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov) account if they don’t have one. -5. The Cal-ITP Benefits app interfaces with the [California Department of Technology](https://cdt.ca.gov/) Identity Gateway (IdG) to verify benefit eligibility. The IdG requests the required personal information to verify veteran status from [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov). +4. The transit rider authenticates with their existing [Login.gov](https://Login.gov) account or creates a [Login.gov](https://Login.gov) account if they don’t have one. +5. The Cal-ITP Benefits app interfaces with the [California Department of Technology](https://cdt.ca.gov/) Identity Gateway (IdG) to verify benefit eligibility. The IdG requests the required personal information to verify veteran status from [Login.gov](https://Login.gov). 6. The IdG utilizes the [Veteran Confirmation API](https://developer.va.gov/explore/api/veteran-confirmation) provided by the US Department of Veterans Affairs to determine the rider’s veteran status. -7. The IdG passes the response from [VA.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/VA.gov) as veteran status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit. +7. The IdG passes the response from [VA.gov](https://VA.gov) as veteran status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit. 8. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the payment processor that facilitates transit fare collection. 9. The app registers the veteran benefit with the transit rider’s debit or credit card. ## **Alternative Flows** -* If the transit rider does not have a desktop computer, they can open the web application at [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow. -* Suppose the transit rider cannot authenticate with [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov), or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare. +* If the transit rider does not have a desktop computer, they can open the web application at [benefits.calitp.org](https://benefits.calitp.org) in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow. +* Suppose the transit rider cannot authenticate with [Login.gov](https://Login.gov), or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare. * If [VA.gov](http://VA.gov) determines the person does not meet the definition of a veteran (IdG returns a veteran status of FALSE), the Cal-ITP Benefits app will not allow the transit rider to enroll their contactless debit or credit card for a reduced fare. * If the debit or credit card expires or is canceled by the issuer, the transit rider must repeat the basic flow to register a new debit or credit card. * If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card. @@ -75,11 +75,11 @@ The transit rider receives a fare reduction each time they use the debit or cred * The transit rider doesn’t have to lock up funds on a closed-loop card offered by the transit provider. * The transit rider pays for transit rides with their debit or credit card, just as they pay for any other good or service that accepts contactless payment. * The transit rider can enroll in a transit benefit from home when convenient; they do not have to visit a transit provider in person. -* Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): [Login.gov](https://app.clickup.com/8631512/v/dc/87d6r-10994/Login.gov) and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies. +* Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): [Login.gov](https://Login.gov) and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies. * Benefits enrollment takes minutes rather than days or weeks. ## **Example Scenario** A veteran in California uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It’s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.  -The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses [benefits.calitp.org](https://app.clickup.com/8631512/v/dc/87d6r-10994/benefits.calitp.org) to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less. +The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses [benefits.calitp.org](https://benefits.calitp.org) to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less. From 60ad329ef431eb8e3c48c847f1d07a7b3076eade Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Mon, 25 Sep 2023 10:49:33 -0700 Subject: [PATCH 14/78] docs: removed bolding on h2 headings This styling came with the .md file export from ClickUp. We definitely need to be aware that the Markdown in these exports isn't clean and should be reviewed carefully. --- docs/use-cases/Veterans.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index bfc7c6b00..945a030aa 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -10,7 +10,7 @@ This use case describes a feature in the [Cal-ITP Benefits app](https://benefits **Precondition:** The California transit provider delivering fixed route service has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the provider has a policy to offer a transit discount for US veterans. -## **Basic Flow** +## Basic Flow ```mermaid sequenceDiagram @@ -57,7 +57,7 @@ Littlepay-->>Benefits: payment method enrollment confirmation 8. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the payment processor that facilitates transit fare collection. 9. The app registers the veteran benefit with the transit rider’s debit or credit card. -## **Alternative Flows** +## Alternative Flows * If the transit rider does not have a desktop computer, they can open the web application at [benefits.calitp.org](https://benefits.calitp.org) in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow. * Suppose the transit rider cannot authenticate with [Login.gov](https://Login.gov), or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare. @@ -65,11 +65,11 @@ Littlepay-->>Benefits: payment method enrollment confirmation * If the debit or credit card expires or is canceled by the issuer, the transit rider must repeat the basic flow to register a new debit or credit card. * If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card. -## **Postcondition** +## Postcondition The transit rider receives a fare reduction each time they use the debit or credit card they registered to pay for transit rides. The number of times they can use the card to pay for transit is unlimited and the benefit never expires.  -## **Benefits** +## Benefits * The transit rider no longer needs cash to pay for transit rides. * The transit rider doesn’t have to lock up funds on a closed-loop card offered by the transit provider. @@ -78,7 +78,7 @@ The transit rider receives a fare reduction each time they use the debit or cred * Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): [Login.gov](https://Login.gov) and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies. * Benefits enrollment takes minutes rather than days or weeks. -## **Example Scenario** +## Example Scenario A veteran in California uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It’s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.  From 9d6f555d7d9d1ddd9293f33845c1a38254e14e05 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 22:33:27 +0000 Subject: [PATCH 15/78] chore(pre-commit): autoupdate hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/Riverside-Healthcare/djLint: v1.32.1 → v1.34.0](https://github.com/Riverside-Healthcare/djLint/compare/v1.32.1...v1.34.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e73768a6b..65ca33f90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,6 +61,6 @@ repos: types_or: [javascript, css] - repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.32.1 + rev: v1.34.0 hooks: - id: djlint-django From d3f78ac895386327548fe3875e857adf2495aa3f Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Tue, 26 Sep 2023 11:59:22 -0700 Subject: [PATCH 16/78] docs: update section title to use sentence case Co-authored-by: machiko --- docs/use-cases/Veterans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index 945a030aa..1af2c3e50 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -78,7 +78,7 @@ The transit rider receives a fare reduction each time they use the debit or cred * Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): [Login.gov](https://Login.gov) and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies. * Benefits enrollment takes minutes rather than days or weeks. -## Example Scenario +## Example scenario A veteran in California uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It’s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.  From 3d5aa811f238fbf0431feb6e81d9f1873a682d22 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Tue, 26 Sep 2023 11:59:40 -0700 Subject: [PATCH 17/78] docs: update section title to use sentence case Co-authored-by: machiko --- docs/use-cases/Veterans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index 1af2c3e50..fae33cdb9 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -57,7 +57,7 @@ Littlepay-->>Benefits: payment method enrollment confirmation 8. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the payment processor that facilitates transit fare collection. 9. The app registers the veteran benefit with the transit rider’s debit or credit card. -## Alternative Flows +## Alternative flows * If the transit rider does not have a desktop computer, they can open the web application at [benefits.calitp.org](https://benefits.calitp.org) in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow. * Suppose the transit rider cannot authenticate with [Login.gov](https://Login.gov), or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare. From 0e07007ba3cb0c37f65445b0e6c48d655aec81d6 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Tue, 26 Sep 2023 13:56:06 -0700 Subject: [PATCH 18/78] docs: update section title to use sentence case Co-authored-by: Kegan Maher --- docs/use-cases/Veterans.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/use-cases/Veterans.md b/docs/use-cases/Veterans.md index fae33cdb9..658d3e9e3 100644 --- a/docs/use-cases/Veterans.md +++ b/docs/use-cases/Veterans.md @@ -10,7 +10,7 @@ This use case describes a feature in the [Cal-ITP Benefits app](https://benefits **Precondition:** The California transit provider delivering fixed route service has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the provider has a policy to offer a transit discount for US veterans. -## Basic Flow +## Basic flow ```mermaid sequenceDiagram From 280e9d9c0b636ffff810fa0aec3b1ccc35b145f4 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 27 Sep 2023 10:29:19 -0700 Subject: [PATCH 19/78] chore(deploy): use pipdeptree instead of pip freeze --- .github/workflows/deploy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7a2a83d6f..0eff8aa05 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,9 +32,10 @@ jobs: run: | python -m venv .venv source .venv/bin/activate + pip install pipdeptree pip install -e . - pip freeze - pip freeze >> benefits/static/requirements.txt + pipdeptree + pipdeptree >> benefits/static/requirements.txt - name: Write commit SHA to file run: echo "${{ github.sha }}" >> benefits/static/sha.txt From cde410a38cf757a1206c96e1b44edcaee0c481fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 21:50:54 +0000 Subject: [PATCH 20/78] chore(deps-dev): bump cypress from 13.2.0 to 13.3.0 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.2.0 to 13.3.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.2.0...v13.3.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index 4038eb226..79f5b5276 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.2.0" + "cypress": "^13.3.0" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", - "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz", + "integrity": "sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", - "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz", + "integrity": "sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index 590196d48..fd22d6aeb 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.2.0" + "cypress": "^13.3.0" } } From db7d8c8b5c65e006e330c52d1f759d5ca7f4e02c Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Mon, 2 Oct 2023 20:36:57 +0000 Subject: [PATCH 21/78] fix: do not show scrollbar when not necessary --- benefits/static/css/styles.css | 1 + 1 file changed, 1 insertion(+) diff --git a/benefits/static/css/styles.css b/benefits/static/css/styles.css index a889df384..d3ed3a3af 100644 --- a/benefits/static/css/styles.css +++ b/benefits/static/css/styles.css @@ -53,6 +53,7 @@ } html { + overflow-y: auto; scroll-padding-top: 101px; /* Header Height (80px) + Skip Nav Height (21px) = 101px */ } From 54bdb1b8e691ae877a5fdee755ad7c64524ec9fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:19:49 +0000 Subject: [PATCH 22/78] chore(deps-dev): bump django from 4.2.5 to 4.2.6 Bumps [django](https://github.com/django/django) from 4.2.5 to 4.2.6. - [Commits](https://github.com/django/django/compare/4.2.5...4.2.6) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9b3f17975..69f304431 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ classifiers = ["Programming Language :: Python :: 3 :: Only"] requires-python = ">=3.9" dependencies = [ "Authlib==1.2.1", - "Django==4.2.5", + "Django==4.2.6", "django-csp==3.7", "eligibility-api==2023.9.1", "requests==2.31.0", From e8b15020fcf4ffa1945ca2b348b9f9e57b1e0627 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 18:09:07 +0000 Subject: [PATCH 23/78] chore(pre-commit): autoupdate hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 65ca33f90..c10225459 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: stages: [commit-msg] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: mixed-line-ending From 57419859a0f3e512dc22c13a7bbaaa374979c72a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 22:03:31 +0000 Subject: [PATCH 24/78] chore(deps-dev): bump sentry-sdk from 1.31.0 to 1.32.0 Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.31.0 to 1.32.0. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-python/compare/1.31.0...1.32.0) --- updated-dependencies: - dependency-name: sentry-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 69f304431..65a1223bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "django-csp==3.7", "eligibility-api==2023.9.1", "requests==2.31.0", - "sentry-sdk==1.31.0", + "sentry-sdk==1.32.0", "six==1.16.0", ] From aafef1e1c891c9393cb094859f512303a7fb7536 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 11 Oct 2023 23:37:33 +0000 Subject: [PATCH 25/78] chore: chmod +x on scripts --- terraform/secrets/file.sh | 0 terraform/secrets/read.sh | 0 terraform/secrets/value.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 terraform/secrets/file.sh mode change 100644 => 100755 terraform/secrets/read.sh mode change 100644 => 100755 terraform/secrets/value.sh diff --git a/terraform/secrets/file.sh b/terraform/secrets/file.sh old mode 100644 new mode 100755 diff --git a/terraform/secrets/read.sh b/terraform/secrets/read.sh old mode 100644 new mode 100755 diff --git a/terraform/secrets/value.sh b/terraform/secrets/value.sh old mode 100644 new mode 100755 From 06d90296375c4f66f4376642e7f070284461c7d3 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 11 Oct 2023 23:51:19 +0000 Subject: [PATCH 26/78] feat: helper script restarts app overwrite our flag setting with the execution timestamp --- terraform/restart-app.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 terraform/restart-app.sh diff --git a/terraform/restart-app.sh b/terraform/restart-app.sh new file mode 100755 index 000000000..efe8fd5a9 --- /dev/null +++ b/terraform/restart-app.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +if [ $# -ne 1 ]; then + echo "Usage: $0 D|T|P" + exit 1 +fi + +ENV="$1" +APP="AS-CDT-PUB-VIP-CALITP-$ENV-001" +RG="RG-CDT-PUB-VIP-CALITP-$ENV-001" +NOW=$(date --utc) + +az webapp config appsettings set --name "$APP" --resource-group "$RG" --settings change_me_to_refresh_secrets="$NOW" From edbce738aa551e7ba4bafef3ceff58c22ba64b2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:41:01 +0000 Subject: [PATCH 27/78] chore(deps-dev): bump cypress from 13.3.0 to 13.3.2 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.3.0 to 13.3.2. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.3.0...v13.3.2) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index 79f5b5276..bd9acfeeb 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.3.0" + "cypress": "^13.3.2" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz", - "integrity": "sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.2.tgz", + "integrity": "sha512-ArLmZObcLC+xxCp7zJZZbhby9FUf5CueLej9dUM4+5j37FTS4iMSgHxQLDu01PydFUvDXcNoIVRCYrHHxD7Ybg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz", - "integrity": "sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.2.tgz", + "integrity": "sha512-ArLmZObcLC+xxCp7zJZZbhby9FUf5CueLej9dUM4+5j37FTS4iMSgHxQLDu01PydFUvDXcNoIVRCYrHHxD7Ybg==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index fd22d6aeb..910d73735 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.3.0" + "cypress": "^13.3.2" } } From 6feea1b32239bc344a23d2f158f2fb16e158be37 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 18:06:39 +0000 Subject: [PATCH 28/78] chore(pre-commit): autoupdate hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.9.1 → 23.10.0](https://github.com/psf/black/compare/23.9.1...23.10.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c10225459..7439a8c04 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: args: ["--maxkb=1500"] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.0 hooks: - id: black types: From 3269f30161a22ec5ae0cfe341a86cfe1cbc8f9fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 21:44:10 +0000 Subject: [PATCH 29/78] chore(deps-dev): bump cypress from 13.3.2 to 13.3.3 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.3.2 to 13.3.3. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.3.2...v13.3.3) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index bd9acfeeb..051c5d764 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.3.2" + "cypress": "^13.3.3" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.2.tgz", - "integrity": "sha512-ArLmZObcLC+xxCp7zJZZbhby9FUf5CueLej9dUM4+5j37FTS4iMSgHxQLDu01PydFUvDXcNoIVRCYrHHxD7Ybg==", + "version": "13.3.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.3.tgz", + "integrity": "sha512-mbdkojHhKB1xbrj7CrKWHi22uFx9P9vQFiR0sYDZZoK99OMp9/ZYN55TO5pjbXmV7xvCJ4JwBoADXjOJK8aCJw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.2.tgz", - "integrity": "sha512-ArLmZObcLC+xxCp7zJZZbhby9FUf5CueLej9dUM4+5j37FTS4iMSgHxQLDu01PydFUvDXcNoIVRCYrHHxD7Ybg==", + "version": "13.3.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.3.tgz", + "integrity": "sha512-mbdkojHhKB1xbrj7CrKWHi22uFx9P9vQFiR0sYDZZoK99OMp9/ZYN55TO5pjbXmV7xvCJ4JwBoADXjOJK8aCJw==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index 910d73735..1d5bbdd0c 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.3.2" + "cypress": "^13.3.3" } } From f0bd052605417902a892659732dcf4d60f45da6f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:59:31 +0000 Subject: [PATCH 30/78] chore(pre-commit): autoupdate hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.0 → 23.10.1](https://github.com/psf/black/compare/23.10.0...23.10.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7439a8c04..2d666baa8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: args: ["--maxkb=1500"] - repo: https://github.com/psf/black - rev: 23.10.0 + rev: 23.10.1 hooks: - id: black types: From 4c6d89191cd698ea4a4f697c87011af802a712ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:03:09 +0000 Subject: [PATCH 31/78] chore(deps-dev): bump cypress from 13.3.3 to 13.4.0 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.3.3 to 13.4.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.3.3...v13.4.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index 051c5d764..d67d5f0b8 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.3.3" + "cypress": "^13.4.0" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.3.3", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.3.tgz", - "integrity": "sha512-mbdkojHhKB1xbrj7CrKWHi22uFx9P9vQFiR0sYDZZoK99OMp9/ZYN55TO5pjbXmV7xvCJ4JwBoADXjOJK8aCJw==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.4.0.tgz", + "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.3.3", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.3.tgz", - "integrity": "sha512-mbdkojHhKB1xbrj7CrKWHi22uFx9P9vQFiR0sYDZZoK99OMp9/ZYN55TO5pjbXmV7xvCJ4JwBoADXjOJK8aCJw==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.4.0.tgz", + "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index 1d5bbdd0c..53142b81b 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.3.3" + "cypress": "^13.4.0" } } From f2ad63da86ac6caf8c7bb4b3d48a20149a8ff53b Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 17:03:06 +0000 Subject: [PATCH 32/78] feat(sbtmd): add Mobility Pass EligibilityType, EligibilityVerifier - no server_public_key yet --- benefits/core/migrations/0002_data.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/benefits/core/migrations/0002_data.py b/benefits/core/migrations/0002_data.py index e95b5c781..d412fcc73 100644 --- a/benefits/core/migrations/0002_data.py +++ b/benefits/core/migrations/0002_data.py @@ -28,6 +28,11 @@ def load_data(app, *args, **kwargs): sbmtd_senior_type = EligibilityType.objects.create( name="senior", label="Senior Discount (SBMTD)", group_id=os.environ.get("SBMTD_SENIOR_GROUP_ID", "group4") ) + sbmtd_mobility_pass_type = EligibilityType.objects.create( + name="mobility_pass", + label="Mobility Pass Discount (SBMTD)", + group_id=os.environ.get("SBMTD_MOBILITY_PASS_GROUP_ID", "group5"), + ) PemData = app.get_model("core", "PemData") @@ -220,6 +225,23 @@ def load_data(app, *args, **kwargs): start_template="eligibility/start--senior.html", ) + sbmtd_mobility_pass_verifier = EligibilityVerifier.objects.create( + name=os.environ.get("MOBILITY_PASS_VERIFIER_NAME", "Eligibility Server Verifier"), + active=os.environ.get("MOBILITY_PASS_VERIFIER_ACTIVE", "True").lower() == "true", + api_url=os.environ.get("MOBILITY_PASS_VERIFIER_API_URL", "http://server:8000/verify"), + api_auth_header=os.environ.get("MOBILITY_PASS_VERIFIER_API_AUTH_HEADER", "X-Server-API-Key"), + api_auth_key=os.environ.get("MOBILITY_PASS_VERIFIER_API_AUTH_KEY", "server-auth-token"), + eligibility_type=sbmtd_mobility_pass_type, + public_key=server_public_key, + jwe_cek_enc=os.environ.get("MOBILITY_PASS_VERIFIER_JWE_CEK_ENC", "A256CBC-HS512"), + jwe_encryption_alg=os.environ.get("MOBILITY_PASS_VERIFIER_JWE_ENCRYPTION_ALG", "RSA-OAEP"), + jws_signing_alg=os.environ.get("MOBILITY_PASS_VERIFIER_JWS_SIGNING_ALG", "RS256"), + auth_provider=None, + selection_label_template="eligibility/includes/selection-label--sbmtd-mobility-pass.html", + start_template="eligibility/start--sbmtd-mobility-pass.html", + form_class="benefits.eligibility.forms.SBMTDMobilityPass", + ) + PaymentProcessor = app.get_model("core", "PaymentProcessor") mst_payment_processor = PaymentProcessor.objects.create( @@ -339,7 +361,7 @@ def load_data(app, *args, **kwargs): enrollment_success_template="enrollment/success--sbmtd.html", ) sbmtd_agency.eligibility_types.set([sbmtd_senior_type]) - sbmtd_agency.eligibility_verifiers.set([sbmtd_senior_verifier]) + sbmtd_agency.eligibility_verifiers.set([sbmtd_senior_verifier, sbmtd_mobility_pass_verifier]) class Migration(migrations.Migration): From 1f5ae466b9886b3eb68893eb5fbd59b8ef762de1 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 17:05:15 +0000 Subject: [PATCH 33/78] feat(sbmtd): add templates for media item, selection label, elig start --- ...cardcheck--start--sbmtd-mobility-pass.html | 15 +++++++++++ .../selection-label--sbmtd-mobility-pass.html | 10 ++++++++ .../start--sbmtd-mobility-pass.html | 25 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html create mode 100644 benefits/eligibility/templates/eligibility/includes/selection-label--sbmtd-mobility-pass.html create mode 100644 benefits/eligibility/templates/eligibility/start--sbmtd-mobility-pass.html diff --git a/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html b/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html new file mode 100644 index 000000000..50aa2ceba --- /dev/null +++ b/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html @@ -0,0 +1,15 @@ +{% extends "eligibility/includes/media-item--idcardcheck.html" %} + +{% load i18n %} + +{% block heading %} + {% translate "Your current Mobility Pass number" %} +{% endblock heading %} + +{% block body %} +
+

+ {% translate "You do not need to have your physical card, but you will need your four-digit Mobility Pass number on the back of the card." %} +

+
+{% endblock body %} diff --git a/benefits/eligibility/templates/eligibility/includes/selection-label--sbmtd-mobility-pass.html b/benefits/eligibility/templates/eligibility/includes/selection-label--sbmtd-mobility-pass.html new file mode 100644 index 000000000..884348614 --- /dev/null +++ b/benefits/eligibility/templates/eligibility/includes/selection-label--sbmtd-mobility-pass.html @@ -0,0 +1,10 @@ +{% extends "eligibility/includes/selection-label.html" %} +{% load i18n %} + +{% block label %} + {% translate "SBMTD Mobility Pass" %} +{% endblock label %} + +{% block description %} + {% translate "This option is for people who have a current SBMTD Mobility Pass." %} +{% endblock description %} diff --git a/benefits/eligibility/templates/eligibility/start--sbmtd-mobility-pass.html b/benefits/eligibility/templates/eligibility/start--sbmtd-mobility-pass.html new file mode 100644 index 000000000..ace24b397 --- /dev/null +++ b/benefits/eligibility/templates/eligibility/start--sbmtd-mobility-pass.html @@ -0,0 +1,25 @@ +{% extends "eligibility/start.html" %} +{% load i18n %} + +{% block page-title %} + {% translate "Agency card overview" %} +{% endblock page-title %} + +{% block headline %} +
+

{% translate "You selected a Mobility Pass transit benefit." %}

+
+{% endblock headline %} + +{% block media-item %} + {% include "eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html" %} +{% endblock media-item %} + +{% block call-to-action %} +
+
+ {% url "eligibility:confirm" as button_url %} + {% translate "Continue" %} +
+
+{% endblock call-to-action %} From a44b852485e8d8f4739392b184589904ddba1411 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 17:15:42 +0000 Subject: [PATCH 34/78] feat(stmtd): add Mobility Pass form --- benefits/eligibility/forms.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/benefits/eligibility/forms.py b/benefits/eligibility/forms.py index 02844377c..eb9264fb9 100644 --- a/benefits/eligibility/forms.py +++ b/benefits/eligibility/forms.py @@ -156,3 +156,26 @@ def __init__(self, *args, **kwargs): *args, **kwargs, ) + + +class SBMTDMobilityPass(EligibilityVerificationForm): + """EligibilityVerification form for the SBMTD Mobility Pass.""" + + def __init__(self, *args, **kwargs): + super().__init__( + title=_("Agency card information"), + headline=_("Let’s see if we can confirm your eligibility."), + blurb=_("Please input your Mobility Pass number and last name below to confirm your eligibility."), + name_label=_("Last name (as it appears on Mobility Pass)"), + name_placeholder="Garcia", + name_help_text=_("We use this to help confirm your Mobility Pass."), + sub_label=_("SBMTD Mobility Pass number"), + sub_help_text=_("This is a 4-digit number on the front and back of your card."), + sub_placeholder="1234", + name_max_length=255, + sub_input_mode="numeric", + sub_max_length=4, + sub_pattern=r"\d{4}", + *args, + **kwargs, + ) From 53a2eb600cb046e8ecbc4b4dd5f186ecc889d00e Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 21:52:57 +0000 Subject: [PATCH 35/78] chore(devcontainer): replace deprecated extensions, update settings --- .devcontainer/devcontainer.json | 9 +++++---- .vscode/settings.json | 11 ++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8f192c4a0..db78bfbcb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,6 @@ }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "bungcip.better-toml", "batisteo.vscode-django", "bpruitt-goddard.mermaid-markdown-syntax-highlighting", "eamodio.gitlens", @@ -28,10 +27,12 @@ "hashicorp.terraform", "mhutchie.git-graph", "monosans.djlint", - "ms-python.python", - "ms-python.vscode-pylance", "mrorz.language-gettext", - "qwtel.sqlite-viewer" + "ms-python.python", + "ms-python.black-formatter", + "ms-python.flake8", + "qwtel.sqlite-viewer", + "tamasfe.even-better-toml" ] } } diff --git a/.vscode/settings.json b/.vscode/settings.json index b3ff8e30d..78ec3acc2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,17 +12,10 @@ "files.trimFinalNewlines": true, "files.trimTrailingWhitespace": true, "[python]": { - "editor.defaultFormatter": "ms-python.python" + "editor.defaultFormatter": "ms-python.black-formatter" }, - "python.formatting.provider": "black", "python.languageServer": "Pylance", - "python.linting.enabled": true, - "python.linting.flake8Enabled": true, - "python.testing.pytestArgs": [ - "tests/pytest", - "--import-mode=importlib", - "--no-migrations" - ], + "python.testing.pytestArgs": ["tests/pytest"], "python.testing.pytestEnabled": true, "python.testing.unittestEnabled": false, "[terraform]": { From d79f6d033f95e220badeee400fe23cee91fcc46e Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 23:00:36 +0000 Subject: [PATCH 36/78] feat(sbmtd): spanish copy --- benefits/locale/en/LC_MESSAGES/django.po | 44 ++++++++++++++++--- benefits/locale/es/LC_MESSAGES/django.po | 56 ++++++++++++++++++++---- 2 files changed, 87 insertions(+), 13 deletions(-) diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index e2bd8568c..8b26ac080 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-09-11 17:23+0000\n" +"POT-Creation-Date: 2023-11-01 22:42+0000\n" "Language: English\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -291,6 +291,23 @@ msgstr "" msgid "This is a 5-digit number on the front and back of your card." msgstr "" +msgid "" +"Please input your Mobility Pass number and last name below to confirm your " +"eligibility." +msgstr "" + +msgid "Last name (as it appears on Mobility Pass)" +msgstr "" + +msgid "We use this to help confirm your Mobility Pass." +msgstr "" + +msgid "SBMTD Mobility Pass number" +msgstr "" + +msgid "This is a 4-digit number on the front and back of your card." +msgstr "" + msgid "Your contactless card details" msgstr "" @@ -309,6 +326,14 @@ msgid "" "number. The number starts with a number sign (#) followed by five digits." msgstr "" +msgid "Your current Mobility Pass number" +msgstr "" + +msgid "" +"You do not need to have your physical card, but you will need your four-" +"digit Mobility Pass number on the back of the card." +msgstr "" + msgid "A Login.gov account with identity verification" msgstr "" @@ -335,21 +360,21 @@ msgstr "" msgid "Go back" msgstr "" -msgid "Verify your identity with " +msgid "Learn more about" msgstr "" msgctxt "image alt text" msgid "Login.gov" msgstr "" +msgid "Verify your identity with " +msgstr "" + msgid "" "We use Login.gov to verify your identity to make sure you are eligible for " "the transit benefit you selected." msgstr "" -msgid "Learn more about" -msgstr "" - msgid "MST Courtesy Card" msgstr "" @@ -358,6 +383,12 @@ msgid "" "eligibility card." msgstr "" +msgid "SBMTD Mobility Pass" +msgstr "" + +msgid "This option is for people who have a current SBMTD Mobility Pass." +msgstr "" + msgid "Older Adult" msgstr "" @@ -406,6 +437,9 @@ msgstr "" msgid "Continue" msgstr "" +msgid "You selected a Mobility Pass transit benefit." +msgstr "" + msgid "Older Adult benefit overview" msgstr "" diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index a36b72922..922393804 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-09-11 17:23+0000\n" +"POT-Creation-Date: 2023-11-01 22:42+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -259,8 +259,8 @@ msgstr "" "califican para una serie de programas de tarifas reducidas. Este beneficio " "de tránsito debe renovarse en el futuro en función de la fecha de " "vencimiento de la tarjeta de cortesía. Obtenga más información en el MST Riders Guide." +"href='https://mst.org/riders-guide/how-to-ride/courtesy-card/' " +"target=\"_blank\" rel=\"noopener noreferrer\">MST Riders Guide." msgid "Sign out of Login.gov" msgstr "Cierre sesión de Login.gov" @@ -374,6 +374,25 @@ msgstr "Número de tarjeta de cortesía de MST" msgid "This is a 5-digit number on the front and back of your card." msgstr "Este es un número de 5 dígitos en el anverso y reverso de su tarjeta." +msgid "" +"Please input your Mobility Pass number and last name below to confirm your " +"eligibility." +msgstr "" +"Ingrese el número de cuatro dígitos de su Mobility Pass y su apellido a " +"continuación para confirmar su elegibilidad." + +msgid "Last name (as it appears on Mobility Pass)" +msgstr "Apellido (tal como aparece en la tarjeta de Mobility Pass)" + +msgid "We use this to help confirm your Mobility Pass." +msgstr "Usamos esto para ayudar a confirmar su Mobility Pass." + +msgid "SBMTD Mobility Pass number" +msgstr "Número de SBMTD Mobility Pass" + +msgid "This is a 4-digit number on the front and back of your card." +msgstr "Este es un número de 4 dígitos en el reverso de su tarjeta." + msgid "Your contactless card details" msgstr "Los datos de su tarjeta sin contacto" @@ -396,6 +415,16 @@ msgstr "" "No necesita tener su tarjeta física, pero necesitará saber el número. El " "número comienza con un signo de número (#) seguido de cinco dígitos." +msgid "Your current Mobility Pass number" +msgstr "Su número actual de Mobility Pass" + +msgid "" +"You do not need to have your physical card, but you will need your four-" +"digit Mobility Pass number on the back of the card." +msgstr "" +"No necesita tener su tarjeta física, pero necesitará su número de cuatro " +"dígitos de Mobility Pass en el reverso de la tarjeta." + msgid "A Login.gov account with identity verification" msgstr "Una cuenta de Login.gov con verificación de identidad" @@ -426,13 +455,16 @@ msgstr "" msgid "Go back" msgstr "Volver" -msgid "Verify your identity with " -msgstr "Verifique su identidad con " +msgid "Learn more about" +msgstr "Más información sobre" msgctxt "image alt text" msgid "Login.gov" msgstr "Login.gov" +msgid "Verify your identity with " +msgstr "Verifique su identidad con " + msgid "" "We use Login.gov to verify your identity to make sure you are eligible for " "the transit benefit you selected." @@ -440,9 +472,6 @@ msgstr "" "Utilizamos Login.gov para verificar su identidad para asegurarnos de que " "seas elegible para el beneficio de tránsito que seleccionaste." -msgid "Learn more about" -msgstr "Más información sobre" - msgid "MST Courtesy Card" msgstr "Tarjeta de cortesía de MST" @@ -453,6 +482,14 @@ msgstr "" "Esta opción es para personas que cuentan actualmente con una tarjeta de " "cortesía o una tarjeta de elegibilidad MST RIDES." +msgid "SBMTD Mobility Pass" +msgstr "" + +msgid "This option is for people who have a current SBMTD Mobility Pass." +msgstr "" +"Esta opción es para personas que cuentan actualmente con un Mobility Pass de " +"SBMTD." + msgid "Older Adult" msgstr "Adulto mayor" @@ -510,6 +547,9 @@ msgstr "Ha seleccionado un beneficio de tránsito de tarjeta de cortesía." msgid "Continue" msgstr "Continuar" +msgid "You selected a Mobility Pass transit benefit." +msgstr "Ha seleccionado un beneficio de tránsito de Mobility Pass." + msgid "Older Adult benefit overview" msgstr "Descripción de beneficios para adultos mayores" From 70ea25d7d1d09b8226514de25261266345d2756e Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 23:02:24 +0000 Subject: [PATCH 37/78] refactor(test): less dependence on database contents --- tests/pytest/core/test_models.py | 8 +++++--- tests/pytest/run.sh | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/pytest/core/test_models.py b/tests/pytest/core/test_models.py index eb345920b..6df589ce0 100644 --- a/tests/pytest/core/test_models.py +++ b/tests/pytest/core/test_models.py @@ -329,16 +329,18 @@ def test_TransitAgency_by_slug_nonmatching(): @pytest.mark.django_db def test_TransitAgency_all_active(model_TransitAgency): - assert TransitAgency.objects.count() == 1 + count = TransitAgency.objects.count() + assert count >= 1 inactive_agency = TransitAgency.by_id(model_TransitAgency.id) inactive_agency.pk = None inactive_agency.active = False inactive_agency.save() - assert TransitAgency.objects.count() == 2 + assert TransitAgency.objects.count() == count + 1 result = TransitAgency.all_active() - assert len(result) == 1 + assert len(result) > 0 assert model_TransitAgency in result + assert inactive_agency not in result diff --git a/tests/pytest/run.sh b/tests/pytest/run.sh index 37b044199..8d06749e6 100755 --- a/tests/pytest/run.sh +++ b/tests/pytest/run.sh @@ -2,7 +2,7 @@ set -eu # run normal pytests -coverage run -m pytest --no-migrations +coverage run -m pytest # clean out old coverage results rm -rf benefits/static/coverage From a203f0bbe2f50bbd851565433c6a6a364b6713f5 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 21:19:15 +0000 Subject: [PATCH 38/78] feat(init): parameterize the database directory set via the DJANGO_DB_DIR environment variable default to the current directory '.' --- bin/init.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/init.sh b/bin/init.sh index 2fe3fdec9..f1925fc79 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -1,10 +1,15 @@ #!/usr/bin/env bash set -eux +# construct the path to the database file from environment or default + +DB_DIR="${DJANGO_DB_DIR:-.}" +DB_FILE="${DB_DIR}/django.db" + # remove existing (old) database file # -f forces the delete (and avoids an error when the file doesn't exist) -rm -f django.db +rm -f "${DB_FILE}" # run database migrations From e54beadf4e87bd9c6dea6feb0533d9876f9e429e Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 21:25:10 +0000 Subject: [PATCH 39/78] feat(settings): use DJANGO_DB_DIR in database config --- benefits/settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benefits/settings.py b/benefits/settings.py index 0d274c093..fbd9e7e01 100644 --- a/benefits/settings.py +++ b/benefits/settings.py @@ -2,6 +2,7 @@ Django settings for benefits project. """ import os + from benefits import sentry @@ -147,10 +148,11 @@ def _filter_empty(ls): WSGI_APPLICATION = "benefits.wsgi.application" +DATABASE_DIR = os.environ.get("DJANGO_DB_DIR", BASE_DIR) DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", - "NAME": "django.db", + "NAME": os.path.join(DATABASE_DIR, "django.db"), } } From 305bcd2ec6520e9ed996b97ad3ad8627e9db7de3 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 22:27:37 +0000 Subject: [PATCH 40/78] docs: describe DJANGO_DB_DIR env var remove reference to a Docker env var that is no longer used --- docs/configuration/environment-variables.md | 25 +++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/docs/configuration/environment-variables.md b/docs/configuration/environment-variables.md index 80b7fac44..7d2131c8c 100644 --- a/docs/configuration/environment-variables.md +++ b/docs/configuration/environment-variables.md @@ -6,20 +6,6 @@ The sections below outline in more detail the application environment variables See other topic pages in this section for more specific environment variable configurations. -## Docker - -### `COMPOSE_PROJECT_NAME` - -!!! info "Local configuration" - - This setting only affects the app running on localhost - -!!! tldr "Docker docs" - - Read more at - -Name that Docker Compose prefixes to the project for container runs. - ## Amplitude !!! tldr "Amplitude API docs" @@ -57,6 +43,17 @@ Boolean: A list of strings representing the host/domain names that this Django site can serve. +### `DJANGO_DB_DIR` + +!!! warning "Deployment configuration" + + You may change this setting when deploying the app to a non-localhost domain + +The directory where Django creates its Sqlite database file. _Must exist and be +writable by the Django process._ + +By default, the base project directory (i.e. the root of the repository). + ### `DJANGO_DEBUG` !!! warning "Deployment configuration" From 58c9c6803321f890127d45a73f4960d464d3988c Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 22:32:16 +0000 Subject: [PATCH 41/78] feat(init): guard database delete with env var DJANGO_DB_RESET is true by default to maintain existing behavior --- bin/init.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/init.sh b/bin/init.sh index f1925fc79..5c802c5fa 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash set -eux -# construct the path to the database file from environment or default - -DB_DIR="${DJANGO_DB_DIR:-.}" -DB_FILE="${DB_DIR}/django.db" - # remove existing (old) database file -# -f forces the delete (and avoids an error when the file doesn't exist) -rm -f "${DB_FILE}" +if [[ ${DJANGO_DB_RESET:-true} = true ]]; then + # construct the path to the database file from environment or default + DB_DIR="${DJANGO_DB_DIR:-.}" + DB_FILE="${DB_DIR}/django.db" + + # -f forces the delete (and avoids an error when the file doesn't exist) + rm -f "${DB_FILE}" +fi # run database migrations From 0839086462e6e8e99f0910a7cc654b5df8e149e3 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 22:41:41 +0000 Subject: [PATCH 42/78] docs: describe DJANGO_DB_RESET env var --- docs/configuration/environment-variables.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/configuration/environment-variables.md b/docs/configuration/environment-variables.md index 7d2131c8c..0392427d9 100644 --- a/docs/configuration/environment-variables.md +++ b/docs/configuration/environment-variables.md @@ -54,6 +54,17 @@ writable by the Django process._ By default, the base project directory (i.e. the root of the repository). +### `DJANGO_DB_RESET` + +!!! warning "Deployment configuration" + + You may change this setting when deploying the app to a non-localhost domain + +Boolean: + +- `True` (default): deletes the existing database file and runs fresh Django migrations. +- `False`: Django uses the existing database file. + ### `DJANGO_DEBUG` !!! warning "Deployment configuration" From 6c8f82e6014579d47313e8fb66df092238be788b Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 1 Nov 2023 23:18:56 +0000 Subject: [PATCH 43/78] feat(terraform): map DJANGO_DB config to key vault secrets --- terraform/app_service.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index c1d775640..6441f1274 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -64,6 +64,8 @@ resource "azurerm_linux_web_app" "main" { # Django settings "DJANGO_ADMIN" = (local.is_prod || local.is_test) ? null : "${local.secret_prefix}django-admin)", "DJANGO_ALLOWED_HOSTS" = "${local.secret_prefix}django-allowed-hosts)", + "DJANGO_DB_DIR" = "${local.secret_prefix}django-db-dir)", + "DJANGO_DB_RESET" = "${local.secret_prefix}django-db-reset)", "DJANGO_DEBUG" = local.is_prod ? null : "${local.secret_prefix}django-debug)", "DJANGO_LOG_LEVEL" = "${local.secret_prefix}django-log-level)", From ea4edac64af3d2b7194cb19d451dea7742c5c94c Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 23:24:49 +0000 Subject: [PATCH 44/78] feat(stmtd): add Help q/a --- benefits/core/migrations/0002_data.py | 1 + .../templates/core/includes/help--sbmtd.html | 8 ++++++++ benefits/locale/en/LC_MESSAGES/django.po | 13 ++++++++++++- benefits/locale/es/LC_MESSAGES/django.po | 18 +++++++++++++++++- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 benefits/core/templates/core/includes/help--sbmtd.html diff --git a/benefits/core/migrations/0002_data.py b/benefits/core/migrations/0002_data.py index d412fcc73..1054c8475 100644 --- a/benefits/core/migrations/0002_data.py +++ b/benefits/core/migrations/0002_data.py @@ -359,6 +359,7 @@ def load_data(app, *args, **kwargs): index_template="core/index--sbmtd.html", eligibility_index_template="eligibility/index--sbmtd.html", enrollment_success_template="enrollment/success--sbmtd.html", + help_template="core/includes/help--sbmtd.html", ) sbmtd_agency.eligibility_types.set([sbmtd_senior_type]) sbmtd_agency.eligibility_verifiers.set([sbmtd_senior_verifier, sbmtd_mobility_pass_verifier]) diff --git a/benefits/core/templates/core/includes/help--sbmtd.html b/benefits/core/templates/core/includes/help--sbmtd.html new file mode 100644 index 000000000..d4f5c5a73 --- /dev/null +++ b/benefits/core/templates/core/includes/help--sbmtd.html @@ -0,0 +1,8 @@ +{% load i18n %} + +

{% translate "What is a Mobility Pass?" %}

+

+ {% blocktranslate trimmed %} + The Santa Barbara Metropolitan Transit District issues Mobility Pass cards to eligible riders. This transit benefit may need to be renewed in the future based on the expiration date of the Mobility Pass. Learn more at the SBMTD Fares & Passes. + {% endblocktranslate %} +

diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index 8b26ac080..572aac1d7 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 22:42+0000\n" +"POT-Creation-Date: 2023-11-01 23:23+0000\n" "Language: English\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -194,6 +194,17 @@ msgid "" "target=\"_blank\" rel=\"noopener noreferrer\">MST Riders Guide." msgstr "" +msgid "What is a Mobility Pass?" +msgstr "" + +msgid "" +"The Santa Barbara Metropolitan Transit District issues Mobility Pass cards " +"to eligible riders. This transit benefit may need to be renewed in the " +"future based on the expiration date of the Mobility Pass. Learn more at the " +"SBMTD Fares & Passes." +msgstr "" + msgid "Sign out of Login.gov" msgstr "" diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index 922393804..f1b8130ec 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 22:42+0000\n" +"POT-Creation-Date: 2023-11-01 23:23+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -262,6 +262,22 @@ msgstr "" "href='https://mst.org/riders-guide/how-to-ride/courtesy-card/' " "target=\"_blank\" rel=\"noopener noreferrer\">MST Riders Guide." +msgid "What is a Mobility Pass?" +msgstr "¿Qué es un Mobility Pass?" + +msgid "" +"The Santa Barbara Metropolitan Transit District issues Mobility Pass cards " +"to eligible riders. This transit benefit may need to be renewed in the " +"future based on the expiration date of the Mobility Pass. Learn more at the " +"SBMTD Fares & Passes." +msgstr "" +"Santa Barbara Metropolitan Transit District emite tarjetas Mobility Pass a " +"pasajeros que califican. Este beneficio de tránsito debe renovarse en el " +"futuro en función de la fecha de vencimiento del Mobility Pass. Obtenga más " +"información en el SBMTD Fares & Passes." + msgid "Sign out of Login.gov" msgstr "Cierre sesión de Login.gov" From a0654c62c353988a4400f238ba8f112bf072134b Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 23:27:31 +0000 Subject: [PATCH 45/78] feat(sbmtd): new server public key var --- benefits/core/migrations/0002_data.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/benefits/core/migrations/0002_data.py b/benefits/core/migrations/0002_data.py index 1054c8475..af54d3285 100644 --- a/benefits/core/migrations/0002_data.py +++ b/benefits/core/migrations/0002_data.py @@ -36,7 +36,14 @@ def load_data(app, *args, **kwargs): PemData = app.get_model("core", "PemData") - server_public_key = PemData.objects.create( + mst_server_public_key = PemData.objects.create( + label="Eligibility server public key", + remote_url=os.environ.get( + "SERVER_PUBLIC_KEY_URL", "https://raw.githubusercontent.com/cal-itp/eligibility-server/dev/keys/server.pub" + ), + ) + + sbmtd_server_public_key = PemData.objects.create( label="Eligibility server public key", remote_url=os.environ.get( "SERVER_PUBLIC_KEY_URL", "https://raw.githubusercontent.com/cal-itp/eligibility-server/dev/keys/server.pub" @@ -197,7 +204,7 @@ def load_data(app, *args, **kwargs): api_auth_header=os.environ.get("COURTESY_CARD_VERIFIER_API_AUTH_HEADER", "X-Server-API-Key"), api_auth_key=os.environ.get("COURTESY_CARD_VERIFIER_API_AUTH_KEY", "server-auth-token"), eligibility_type=mst_courtesy_card_type, - public_key=server_public_key, + public_key=mst_server_public_key, jwe_cek_enc=os.environ.get("COURTESY_CARD_VERIFIER_JWE_CEK_ENC", "A256CBC-HS512"), jwe_encryption_alg=os.environ.get("COURTESY_CARD_VERIFIER_JWE_ENCRYPTION_ALG", "RSA-OAEP"), jws_signing_alg=os.environ.get("COURTESY_CARD_VERIFIER_JWS_SIGNING_ALG", "RS256"), @@ -232,7 +239,7 @@ def load_data(app, *args, **kwargs): api_auth_header=os.environ.get("MOBILITY_PASS_VERIFIER_API_AUTH_HEADER", "X-Server-API-Key"), api_auth_key=os.environ.get("MOBILITY_PASS_VERIFIER_API_AUTH_KEY", "server-auth-token"), eligibility_type=sbmtd_mobility_pass_type, - public_key=server_public_key, + public_key=sbmtd_server_public_key, jwe_cek_enc=os.environ.get("MOBILITY_PASS_VERIFIER_JWE_CEK_ENC", "A256CBC-HS512"), jwe_encryption_alg=os.environ.get("MOBILITY_PASS_VERIFIER_JWE_ENCRYPTION_ALG", "RSA-OAEP"), jws_signing_alg=os.environ.get("MOBILITY_PASS_VERIFIER_JWS_SIGNING_ALG", "RS256"), From 2ecbf533e4d505235c7c57556b80c0c021e7a90c Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 23:33:44 +0000 Subject: [PATCH 46/78] chore: run makemessages --- benefits/locale/en/LC_MESSAGES/django.po | 5 +---- benefits/locale/es/LC_MESSAGES/django.po | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index 572aac1d7..f727a077f 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -2,11 +2,8 @@ # Copyright (C) 2023 California Department of Transportation # This file is distributed under the same license as the benefits package. # -#, fuzzy -msgid "" -msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 23:23+0000\n" +"POT-Creation-Date: 2023-11-01 23:33+0000\n" "Language: English\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index f1b8130ec..92621e57d 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 23:23+0000\n" +"POT-Creation-Date: 2023-11-01 23:33+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" From b9cdb3a8470c95a1b72270e188370bc954391f8b Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Wed, 1 Nov 2023 23:40:10 +0000 Subject: [PATCH 47/78] chore: rereun makemessages --- benefits/locale/en/LC_MESSAGES/django.po | 3 +++ benefits/locale/es/LC_MESSAGES/django.po | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index f727a077f..31f5ae556 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -2,6 +2,9 @@ # Copyright (C) 2023 California Department of Transportation # This file is distributed under the same license as the benefits package. # +#, fuzzy +msgid "" +msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" "POT-Creation-Date: 2023-11-01 23:33+0000\n" "Language: English\n" diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index 92621e57d..bc37adcae 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 23:33+0000\n" +"POT-Creation-Date: 2023-11-01 23:37+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" From aef5c67a5a4a2b2afc73e479d83c8a043a75a075 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 2 Nov 2023 21:01:41 +0000 Subject: [PATCH 48/78] feat(sbmtd): add sbmtd, mst-specific server public key env vars --- benefits/core/migrations/0002_data.py | 4 ++-- terraform/app_service.tf | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/benefits/core/migrations/0002_data.py b/benefits/core/migrations/0002_data.py index af54d3285..1df6a430d 100644 --- a/benefits/core/migrations/0002_data.py +++ b/benefits/core/migrations/0002_data.py @@ -39,14 +39,14 @@ def load_data(app, *args, **kwargs): mst_server_public_key = PemData.objects.create( label="Eligibility server public key", remote_url=os.environ.get( - "SERVER_PUBLIC_KEY_URL", "https://raw.githubusercontent.com/cal-itp/eligibility-server/dev/keys/server.pub" + "MST_SERVER_PUBLIC_KEY_URL", "https://raw.githubusercontent.com/cal-itp/eligibility-server/dev/keys/server.pub" ), ) sbmtd_server_public_key = PemData.objects.create( label="Eligibility server public key", remote_url=os.environ.get( - "SERVER_PUBLIC_KEY_URL", "https://raw.githubusercontent.com/cal-itp/eligibility-server/dev/keys/server.pub" + "SBMTD_SERVER_PUBLIC_KEY_URL", "https://raw.githubusercontent.com/cal-itp/eligibility-server/dev/keys/server.pub" ), ) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index c1d775640..fd7b6a688 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -89,7 +89,8 @@ resource "azurerm_linux_web_app" "main" { "SBMTD_SENIOR_GROUP_ID" = "${local.secret_prefix}sbmtd-senior-group-id)", "CLIENT_PRIVATE_KEY" = "${local.secret_prefix}client-private-key)" "CLIENT_PUBLIC_KEY" = "${local.secret_prefix}client-public-key)" - "SERVER_PUBLIC_KEY_URL" = "${local.secret_prefix}server-public-key-url)" + "MST_SERVER_PUBLIC_KEY_URL" = "${local.secret_prefix}mst-server-public-key-url)" + "SBMTD_SERVER_PUBLIC_KEY_URL" = "${local.secret_prefix}sbmtd-server-public-key-url)" "MST_PAYMENT_PROCESSOR_CLIENT_CERT" = "${local.secret_prefix}mst-payment-processor-client-cert)" "MST_PAYMENT_PROCESSOR_CLIENT_CERT_PRIVATE_KEY" = "${local.secret_prefix}mst-payment-processor-client-cert-private-key)" "MST_PAYMENT_PROCESSOR_CLIENT_CERT_ROOT_CA" = "${local.secret_prefix}mst-payment-processor-client-cert-root-ca)" From b2836ebc267b2c9686bc71b246a46b465d3cb187 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 2 Nov 2023 16:09:45 -0700 Subject: [PATCH 49/78] feat(terraform): define Azure file share --- terraform/storage.tf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/terraform/storage.tf b/terraform/storage.tf index 04761fbd7..b69c44159 100644 --- a/terraform/storage.tf +++ b/terraform/storage.tf @@ -18,8 +18,20 @@ resource "azurerm_storage_account" "main" { } } - lifecycle { ignore_changes = [tags] } } + +resource "azurerm_storage_share" "data" { + name = "benefits-data" + storage_account_name = azurerm_storage_account.main.name + quota = 5 + enabled_protocol = "SMB" + acl { + id = "benefits-data-rwdl" + access_policy { + permissions = "rwdl" + } + } +} From bae7fab8e4530c9976b761022e230165e20ddbc2 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 2 Nov 2023 16:13:26 -0700 Subject: [PATCH 50/78] feat(terraform): mount Azure file share into app container --- terraform/app_service.tf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index 6441f1274..3d62637b8 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -10,6 +10,10 @@ resource "azurerm_service_plan" "main" { } } +locals { + data_mount = "/home/calitp/app/data" +} + resource "azurerm_linux_web_app" "main" { name = "AS-CDT-PUB-VIP-CALITP-${local.env_letter}-001" location = data.azurerm_resource_group.main.location @@ -166,6 +170,15 @@ resource "azurerm_linux_web_app" "main" { "SBMTD_AGENCY_JWS_SIGNING_ALG" = "${local.secret_prefix}sbmtd-agency-jws-signing-alg)" } + storage_account { + access_key = azurerm_storage_account.main.primary_access_key + account_name = azurerm_storage_account.main.name + name = "benefits-data" + type = "AzureFiles" + share_name = azurerm_storage_share.data.name + mount_path = local.data_mount + } + lifecycle { prevent_destroy = true ignore_changes = [tags] From c2e6574d5b92d13afd4fdbf8e127b4b114d38583 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 2 Nov 2023 23:18:44 +0000 Subject: [PATCH 51/78] feat(sbmtd): add SBMTD_MOBILITY_PASS_GROUP_ID --- terraform/app_service.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index fd7b6a688..6b7a4d6d2 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -87,6 +87,7 @@ resource "azurerm_linux_web_app" "main" { "MST_COURTESY_CARD_GROUP_ID" = "${local.secret_prefix}mst-courtesy-card-group-id)" "SACRT_SENIOR_GROUP_ID" = "${local.secret_prefix}sacrt-senior-group-id)" "SBMTD_SENIOR_GROUP_ID" = "${local.secret_prefix}sbmtd-senior-group-id)", + "SBMTD_MOBILITY_PASS_GROUP_ID" = "${local.secret_prefix}sbmtd-mobility-pass-group-id)" "CLIENT_PRIVATE_KEY" = "${local.secret_prefix}client-private-key)" "CLIENT_PUBLIC_KEY" = "${local.secret_prefix}client-public-key)" "MST_SERVER_PUBLIC_KEY_URL" = "${local.secret_prefix}mst-server-public-key-url)" From e209a18fc2a53f81966933e0e7adb42a087cdd1a Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Mon, 6 Nov 2023 20:18:26 +0000 Subject: [PATCH 52/78] fix(sbmtd): add sbmtd mobility pass eligibility type to sbmtd --- benefits/core/migrations/0002_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benefits/core/migrations/0002_data.py b/benefits/core/migrations/0002_data.py index 1df6a430d..2b2b6def1 100644 --- a/benefits/core/migrations/0002_data.py +++ b/benefits/core/migrations/0002_data.py @@ -368,7 +368,7 @@ def load_data(app, *args, **kwargs): enrollment_success_template="enrollment/success--sbmtd.html", help_template="core/includes/help--sbmtd.html", ) - sbmtd_agency.eligibility_types.set([sbmtd_senior_type]) + sbmtd_agency.eligibility_types.set([sbmtd_senior_type, sbmtd_mobility_pass_type]) sbmtd_agency.eligibility_verifiers.set([sbmtd_senior_verifier, sbmtd_mobility_pass_verifier]) From 13b24c004e71d9325b05580051c5004fe1896709 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 8 Nov 2023 21:15:56 +0000 Subject: [PATCH 53/78] feat(init): create superuser without input --- bin/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/init.sh b/bin/init.sh index 5c802c5fa..3a1e2b8bb 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -20,7 +20,7 @@ python manage.py migrate # check DJANGO_ADMIN = true, default to false if empty or unset if [[ ${DJANGO_ADMIN:-false} = true ]]; then - python manage.py createsuperuser + python manage.py createsuperuser --no-input else echo "superuser: Django not configured for Admin access" fi From 284f6aa0d476221dbb3c8bdf5236356c7b08a55d Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 8 Nov 2023 22:40:43 +0000 Subject: [PATCH 54/78] feat(terraform): Django superuser app settings allow admin in all environments --- terraform/app_service.tf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index 725ca289a..8d3e57ed6 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -66,12 +66,15 @@ resource "azurerm_linux_web_app" "main" { "REQUESTS_READ_TIMEOUT" = "${local.secret_prefix}requests-read-timeout)", # Django settings - "DJANGO_ADMIN" = (local.is_prod || local.is_test) ? null : "${local.secret_prefix}django-admin)", - "DJANGO_ALLOWED_HOSTS" = "${local.secret_prefix}django-allowed-hosts)", - "DJANGO_DB_DIR" = "${local.secret_prefix}django-db-dir)", - "DJANGO_DB_RESET" = "${local.secret_prefix}django-db-reset)", - "DJANGO_DEBUG" = local.is_prod ? null : "${local.secret_prefix}django-debug)", - "DJANGO_LOG_LEVEL" = "${local.secret_prefix}django-log-level)", + "DJANGO_ADMIN" = "${local.secret_prefix}django-admin)", + "DJANGO_ALLOWED_HOSTS" = "${local.secret_prefix}django-allowed-hosts)", + "DJANGO_DB_DIR" = "${local.secret_prefix}django-db-dir)", + "DJANGO_DB_RESET" = "${local.secret_prefix}django-db-reset)", + "DJANGO_DEBUG" = local.is_prod ? null : "${local.secret_prefix}django-debug)", + "DJANGO_LOG_LEVEL" = "${local.secret_prefix}django-log-level)", + "DJANGO_SUPERUSER_EMAIL" = "${local.secret_prefix}django-superuser-email)", + "DJANGO_SUPERUSER_PASSWORD" = "${local.secret_prefix}django-superuser-password)", + "DJANGO_SUPERUSER_USERNAME" = "${local.secret_prefix}django-superuser-username)", "DJANGO_RECAPTCHA_SECRET_KEY" = local.is_dev ? null : "${local.secret_prefix}django-recaptcha-secret-key)", "DJANGO_RECAPTCHA_SITE_KEY" = local.is_dev ? null : "${local.secret_prefix}django-recaptcha-site-key)", From b9d2ecbd415f3402050ffeda0bfe78c445dcbc2a Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 8 Nov 2023 22:50:20 +0000 Subject: [PATCH 55/78] docs(config): describe Django superuser env vars --- docs/configuration/environment-variables.md | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/configuration/environment-variables.md b/docs/configuration/environment-variables.md index 0392427d9..574ca3f4b 100644 --- a/docs/configuration/environment-variables.md +++ b/docs/configuration/environment-variables.md @@ -120,6 +120,42 @@ By default the application sends logs to `stdout`. Django's primary secret, keep this safe! +### `DJANGO_SUPERUSER_EMAIL` + +!!! warning "Deployment configuration" + + You may change this setting when deploying the app to a non-localhost domain + +!!! danger "Required configuration" + + This setting is required when `DJANGO_ADMIN` is `true` + +The email address of the Django Admin superuser created during initialization. + +### `DJANGO_SUPERUSER_PASSWORD` + +!!! warning "Deployment configuration" + + You may change this setting when deploying the app to a non-localhost domain + +!!! danger "Required configuration" + + This setting is required when `DJANGO_ADMIN` is `true` + +The password of the Django Admin superuser created during initialization. + +### `DJANGO_SUPERUSER_USERNAME` + +!!! warning "Deployment configuration" + + You may change this setting when deploying the app to a non-localhost domain + +!!! danger "Required configuration" + + This setting is required when `DJANGO_ADMIN` is `true` + +The username of the Django Admin superuser created during initialization. + ### `DJANGO_TRUSTED_ORIGINS` !!! warning "Deployment configuration" From 10bf6fc9576adaf8a4cf7e17bce1dab6944939ce Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 9 Nov 2023 20:34:15 +0000 Subject: [PATCH 56/78] feat(sbmtd): add SBMTD Mobility Pass vars to Terraform --- terraform/app_service.tf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index 725ca289a..d3835d069 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -157,6 +157,14 @@ resource "azurerm_linux_web_app" "main" { "SBMTD_PAYMENT_PROCESSOR_CARD_TOKENIZE_URL" = "${local.secret_prefix}sbmtd-payment-processor-card-tokenize-url)" "SBMTD_PAYMENT_PROCESSOR_CARD_TOKENIZE_FUNC" = "${local.secret_prefix}sbmtd-payment-processor-card-tokenize-func)" "SBMTD_PAYMENT_PROCESSOR_CARD_TOKENIZE_ENV" = "${local.secret_prefix}sbmtd-payment-processor-card-tokenize-env)" + "MOBILITY_PASS_VERIFIER_NAME" = "${local.secret_prefix}mobility-pass-verifier-name)" + "MOBILITY_PASS_VERIFIER_ACTIVE" = "${local.secret_prefix}mobility-pass-verifier-active)" + "MOBILITY_PASS_VERIFIER_API_URL" = "${local.secret_prefix}mobility-pass-verifier-api-url)" + "MOBILITY_PASS_VERIFIER_API_AUTH_HEADER" = "${local.secret_prefix}mobility-pass-verifier-api-auth-header)" + "MOBILITY_PASS_VERIFIER_API_AUTH_KEY" = "${local.secret_prefix}mobility-pass-verifier-api-auth-header)" + "MOBILITY_PASS_VERIFIER_JWE_CEK_ENC" = "${local.secret_prefix}mobility-pass-verifier-jwe-cek-enc)" + "MOBILITY_PASS_VERIFIER_JWE_ENCRYPTION_ALG" = "${local.secret_prefix}mobility-pass-verifier-jwe-encryption-alg)" + "MOBILITY_PASS_VERIFIER_JWS_SIGNING_ALG" = "${local.secret_prefix}mobility-pass-verifier-jwe-signing-alg)" "MST_AGENCY_SHORT_NAME" = "${local.secret_prefix}mst-agency-short-name)" "MST_AGENCY_LONG_NAME" = "${local.secret_prefix}mst-agency-long-name)" "MST_AGENCY_JWS_SIGNING_ALG" = "${local.secret_prefix}mst-agency-jws-signing-alg)" From be911ce6c2c83ff3b3940841bbef2cacf8883e64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 21:36:11 +0000 Subject: [PATCH 57/78] chore(deps-dev): bump cypress from 13.4.0 to 13.5.0 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.4.0 to 13.5.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.4.0...v13.5.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index d67d5f0b8..e5712a091 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.4.0" + "cypress": "^13.5.0" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.4.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.4.0.tgz", - "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.0.tgz", + "integrity": "sha512-oh6U7h9w8wwHfzNDJQ6wVcAeXu31DlIYlNOBvfd6U4CcB8oe4akawQmH+QJVOMZlM42eBoCne015+svVqdwdRQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.4.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.4.0.tgz", - "integrity": "sha512-KeWNC9xSHG/ewZURVbaQsBQg2mOKw4XhjJZFKjWbEjgZCdxpPXLpJnfq5Jns1Gvnjp6AlnIfpZfWFlDgVKXdWQ==", + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.0.tgz", + "integrity": "sha512-oh6U7h9w8wwHfzNDJQ6wVcAeXu31DlIYlNOBvfd6U4CcB8oe4akawQmH+QJVOMZlM42eBoCne015+svVqdwdRQ==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index 53142b81b..22aaee109 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.4.0" + "cypress": "^13.5.0" } } From bd4aa14c4139fac359c79c50791f3ddfeac8fd35 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 9 Nov 2023 14:15:24 -0800 Subject: [PATCH 58/78] chore(nginx): block sqlite scraper patterns --- appcontainer/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appcontainer/nginx.conf b/appcontainer/nginx.conf index 585f6b669..27f322248 100644 --- a/appcontainer/nginx.conf +++ b/appcontainer/nginx.conf @@ -52,7 +52,7 @@ http { # 404 known scraping file targets # case-insensitive regex matches the given file extension anywhere in the request path - location ~* /.*\.(ash|asp|axd|cgi|com|env|json|php|ping|xml|ya?ml) { + location ~* /.*\.(ash|asp|axd|cgi|com|db|env|json|php|ping|sqlite|xml|ya?ml) { access_log off; log_not_found off; return 404; From e67ad9bc8ffcb6ea0d86a082da5f7b5d855c35dc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 18:07:11 +0000 Subject: [PATCH 59/78] chore(pre-commit): autoupdate hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0) - [github.com/pre-commit/mirrors-prettier: v3.0.3 → v3.1.0](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.3...v3.1.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d666baa8..379d20902 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: args: ["--maxkb=1500"] - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black types: @@ -55,7 +55,7 @@ repos: files: .py$ - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v3.1.0 hooks: - id: prettier types_or: [javascript, css] From 0b674125c10a3cd263c58ba8115d0327adb25254 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 22:04:26 +0000 Subject: [PATCH 60/78] chore(deps-dev): bump sentry-sdk from 1.32.0 to 1.35.0 Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.32.0 to 1.35.0. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-python/compare/1.32.0...1.35.0) --- updated-dependencies: - dependency-name: sentry-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 65a1223bb..5a2aef5a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "django-csp==3.7", "eligibility-api==2023.9.1", "requests==2.31.0", - "sentry-sdk==1.32.0", + "sentry-sdk==1.35.0", "six==1.16.0", ] From 2cbf823c06db80247716df9f90211e2c12fc4d09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 21:12:01 +0000 Subject: [PATCH 61/78] chore(deps-dev): bump cypress from 13.5.0 to 13.5.1 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.5.0 to 13.5.1. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.5.0...v13.5.1) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index e5712a091..e7d5945d3 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.5.0" + "cypress": "^13.5.1" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.0.tgz", - "integrity": "sha512-oh6U7h9w8wwHfzNDJQ6wVcAeXu31DlIYlNOBvfd6U4CcB8oe4akawQmH+QJVOMZlM42eBoCne015+svVqdwdRQ==", + "version": "13.5.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.1.tgz", + "integrity": "sha512-yqLViT0D/lPI8Kkm7ciF/x/DCK/H/DnogdGyiTnQgX4OVR2aM30PtK+kvklTOD1u3TuItiD9wUQAF8EYWtyZug==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.0.tgz", - "integrity": "sha512-oh6U7h9w8wwHfzNDJQ6wVcAeXu31DlIYlNOBvfd6U4CcB8oe4akawQmH+QJVOMZlM42eBoCne015+svVqdwdRQ==", + "version": "13.5.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.1.tgz", + "integrity": "sha512-yqLViT0D/lPI8Kkm7ciF/x/DCK/H/DnogdGyiTnQgX4OVR2aM30PtK+kvklTOD1u3TuItiD9wUQAF8EYWtyZug==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index 22aaee109..d667c439d 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.5.0" + "cypress": "^13.5.1" } } From 433a987c14b90681e4f9e2a577ed9b0b0f055815 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:17:25 +0000 Subject: [PATCH 62/78] chore(deps-dev): bump django from 4.2.6 to 4.2.7 Bumps [django](https://github.com/django/django) from 4.2.6 to 4.2.7. - [Commits](https://github.com/django/django/compare/4.2.6...4.2.7) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5a2aef5a8..2906458c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ classifiers = ["Programming Language :: Python :: 3 :: Only"] requires-python = ">=3.9" dependencies = [ "Authlib==1.2.1", - "Django==4.2.6", + "Django==4.2.7", "django-csp==3.7", "eligibility-api==2023.9.1", "requests==2.31.0", From 27a93cf2d562b7a738d236947fdf147107ac822f Mon Sep 17 00:00:00 2001 From: machiko Date: Wed, 15 Nov 2023 15:45:35 -0800 Subject: [PATCH 63/78] Update terraform/app_service.tf Co-authored-by: Angela Tran --- terraform/app_service.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index d3835d069..6e16cd6e8 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -161,7 +161,7 @@ resource "azurerm_linux_web_app" "main" { "MOBILITY_PASS_VERIFIER_ACTIVE" = "${local.secret_prefix}mobility-pass-verifier-active)" "MOBILITY_PASS_VERIFIER_API_URL" = "${local.secret_prefix}mobility-pass-verifier-api-url)" "MOBILITY_PASS_VERIFIER_API_AUTH_HEADER" = "${local.secret_prefix}mobility-pass-verifier-api-auth-header)" - "MOBILITY_PASS_VERIFIER_API_AUTH_KEY" = "${local.secret_prefix}mobility-pass-verifier-api-auth-header)" + "MOBILITY_PASS_VERIFIER_API_AUTH_KEY" = "${local.secret_prefix}mobility-pass-verifier-api-auth-key)" "MOBILITY_PASS_VERIFIER_JWE_CEK_ENC" = "${local.secret_prefix}mobility-pass-verifier-jwe-cek-enc)" "MOBILITY_PASS_VERIFIER_JWE_ENCRYPTION_ALG" = "${local.secret_prefix}mobility-pass-verifier-jwe-encryption-alg)" "MOBILITY_PASS_VERIFIER_JWS_SIGNING_ALG" = "${local.secret_prefix}mobility-pass-verifier-jwe-signing-alg)" From d93eec9c1b71dd6dadaa6244c9671f05afbb0bed Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 00:46:58 +0000 Subject: [PATCH 64/78] fix(enrollment): show retry button on retry page --- benefits/enrollment/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py index f68a14f6b..40c1e1560 100644 --- a/benefits/enrollment/views.py +++ b/benefits/enrollment/views.py @@ -99,7 +99,10 @@ def retry(request): analytics.returned_retry(request) form = forms.CardTokenizeFailForm(request.POST) if form.is_valid(): - return TemplateResponse(request, TEMPLATE_RETRY) + context = { + "retry_button": True, + } + return TemplateResponse(request, TEMPLATE_RETRY, context) else: analytics.returned_error(request, "Invalid retry submission.") raise Exception("Invalid retry submission.") From 39753d5adcbff6c033a887ca1bb670a76a07bc7b Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 18:36:43 +0000 Subject: [PATCH 65/78] refactor(enrollment): remove retry variable entirely --- benefits/enrollment/templates/enrollment/retry.html | 12 +++++------- benefits/enrollment/views.py | 5 +---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/benefits/enrollment/templates/enrollment/retry.html b/benefits/enrollment/templates/enrollment/retry.html index 7cd0ea9c1..4efb402f8 100644 --- a/benefits/enrollment/templates/enrollment/retry.html +++ b/benefits/enrollment/templates/enrollment/retry.html @@ -26,14 +26,12 @@

{% include "core/includes/agency-links.html" %}
- {% if retry_button %} -
-
- {% translate "Try again" as button_text %} - {% include "core/includes/button--origin.html" with button_text=button_text %} -
+
+
+ {% translate "Try again" as button_text %} + {% include "core/includes/button--origin.html" with button_text=button_text %}
- {% endif %} +
{% endblock main-content %} diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py index 40c1e1560..f68a14f6b 100644 --- a/benefits/enrollment/views.py +++ b/benefits/enrollment/views.py @@ -99,10 +99,7 @@ def retry(request): analytics.returned_retry(request) form = forms.CardTokenizeFailForm(request.POST) if form.is_valid(): - context = { - "retry_button": True, - } - return TemplateResponse(request, TEMPLATE_RETRY, context) + return TemplateResponse(request, TEMPLATE_RETRY) else: analytics.returned_error(request, "Invalid retry submission.") raise Exception("Invalid retry submission.") From 518f38e6f203c77b98d52a532e2df84f8798b168 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 16 Nov 2023 20:34:19 +0000 Subject: [PATCH 66/78] fix(terraform): typo in secret name --- terraform/app_service.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/app_service.tf b/terraform/app_service.tf index 769deeb71..37db1d5ac 100644 --- a/terraform/app_service.tf +++ b/terraform/app_service.tf @@ -167,7 +167,7 @@ resource "azurerm_linux_web_app" "main" { "MOBILITY_PASS_VERIFIER_API_AUTH_KEY" = "${local.secret_prefix}mobility-pass-verifier-api-auth-key)" "MOBILITY_PASS_VERIFIER_JWE_CEK_ENC" = "${local.secret_prefix}mobility-pass-verifier-jwe-cek-enc)" "MOBILITY_PASS_VERIFIER_JWE_ENCRYPTION_ALG" = "${local.secret_prefix}mobility-pass-verifier-jwe-encryption-alg)" - "MOBILITY_PASS_VERIFIER_JWS_SIGNING_ALG" = "${local.secret_prefix}mobility-pass-verifier-jwe-signing-alg)" + "MOBILITY_PASS_VERIFIER_JWS_SIGNING_ALG" = "${local.secret_prefix}mobility-pass-verifier-jws-signing-alg)" "MST_AGENCY_SHORT_NAME" = "${local.secret_prefix}mst-agency-short-name)" "MST_AGENCY_LONG_NAME" = "${local.secret_prefix}mst-agency-long-name)" "MST_AGENCY_JWS_SIGNING_ALG" = "${local.secret_prefix}mst-agency-jws-signing-alg)" From b0e42fbace9267ab6fc8db962ef844612839b934 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 23:29:04 +0000 Subject: [PATCH 67/78] fix(copy): back of card, not both front and back --- benefits/eligibility/forms.py | 2 +- benefits/locale/en/LC_MESSAGES/django.po | 4 ++-- benefits/locale/es/LC_MESSAGES/django.po | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/benefits/eligibility/forms.py b/benefits/eligibility/forms.py index eb9264fb9..e6b3e10e6 100644 --- a/benefits/eligibility/forms.py +++ b/benefits/eligibility/forms.py @@ -170,7 +170,7 @@ def __init__(self, *args, **kwargs): name_placeholder="Garcia", name_help_text=_("We use this to help confirm your Mobility Pass."), sub_label=_("SBMTD Mobility Pass number"), - sub_help_text=_("This is a 4-digit number on the front and back of your card."), + sub_help_text=_("This is a 4-digit number on the back of your card."), sub_placeholder="1234", name_max_length=255, sub_input_mode="numeric", diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index 31f5ae556..7778e3506 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 23:33+0000\n" +"POT-Creation-Date: 2023-11-16 23:25+0000\n" "Language: English\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -316,7 +316,7 @@ msgstr "" msgid "SBMTD Mobility Pass number" msgstr "" -msgid "This is a 4-digit number on the front and back of your card." +msgid "This is a 4-digit number on the back of your card." msgstr "" msgid "Your contactless card details" diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index bc37adcae..34585641e 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-01 23:37+0000\n" +"POT-Creation-Date: 2023-11-16 23:25+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -406,7 +406,7 @@ msgstr "Usamos esto para ayudar a confirmar su Mobility Pass." msgid "SBMTD Mobility Pass number" msgstr "Número de SBMTD Mobility Pass" -msgid "This is a 4-digit number on the front and back of your card." +msgid "This is a 4-digit number on the back of your card." msgstr "Este es un número de 4 dígitos en el reverso de su tarjeta." msgid "Your contactless card details" From 9c35614480514d9e5019cb3f88e48e73455470b4 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 23:39:09 +0000 Subject: [PATCH 68/78] fix(typo): 4-digit --- ...media-item--idcardcheck--start--sbmtd-mobility-pass.html | 2 +- benefits/locale/en/LC_MESSAGES/django.po | 6 +++--- benefits/locale/es/LC_MESSAGES/django.po | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html b/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html index 50aa2ceba..2117c9f62 100644 --- a/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html +++ b/benefits/eligibility/templates/eligibility/includes/media-item--idcardcheck--start--sbmtd-mobility-pass.html @@ -9,7 +9,7 @@ {% block body %}

- {% translate "You do not need to have your physical card, but you will need your four-digit Mobility Pass number on the back of the card." %} + {% translate "You do not need to have your physical card, but you will need your 4-digit Mobility Pass number on the back of the card." %}

{% endblock body %} diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index 7778e3506..78cc0a57a 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-16 23:25+0000\n" +"POT-Creation-Date: 2023-11-16 23:37+0000\n" "Language: English\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -341,8 +341,8 @@ msgid "Your current Mobility Pass number" msgstr "" msgid "" -"You do not need to have your physical card, but you will need your four-" -"digit Mobility Pass number on the back of the card." +"You do not need to have your physical card, but you will need your 4-digit " +"Mobility Pass number on the back of the card." msgstr "" msgid "A Login.gov account with identity verification" diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index 34585641e..c517728b5 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-16 23:25+0000\n" +"POT-Creation-Date: 2023-11-16 23:37+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -435,8 +435,8 @@ msgid "Your current Mobility Pass number" msgstr "Su número actual de Mobility Pass" msgid "" -"You do not need to have your physical card, but you will need your four-" -"digit Mobility Pass number on the back of the card." +"You do not need to have your physical card, but you will need your 4-digit " +"Mobility Pass number on the back of the card." msgstr "" "No necesita tener su tarjeta física, pero necesitará su número de cuatro " "dígitos de Mobility Pass en el reverso de la tarjeta." From c5365bcda6ef5fcea8958ee3cc1c0b0a5225d802 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 16 Nov 2023 23:52:47 +0000 Subject: [PATCH 69/78] fix(copy): Mobility Pass card --- benefits/eligibility/forms.py | 2 +- benefits/locale/en/LC_MESSAGES/django.po | 4 ++-- benefits/locale/es/LC_MESSAGES/django.po | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/benefits/eligibility/forms.py b/benefits/eligibility/forms.py index e6b3e10e6..a1a4f675f 100644 --- a/benefits/eligibility/forms.py +++ b/benefits/eligibility/forms.py @@ -166,7 +166,7 @@ def __init__(self, *args, **kwargs): title=_("Agency card information"), headline=_("Let’s see if we can confirm your eligibility."), blurb=_("Please input your Mobility Pass number and last name below to confirm your eligibility."), - name_label=_("Last name (as it appears on Mobility Pass)"), + name_label=_("Last name (as it appears on Mobility Pass card)"), name_placeholder="Garcia", name_help_text=_("We use this to help confirm your Mobility Pass."), sub_label=_("SBMTD Mobility Pass number"), diff --git a/benefits/locale/en/LC_MESSAGES/django.po b/benefits/locale/en/LC_MESSAGES/django.po index 78cc0a57a..0457ee0a3 100644 --- a/benefits/locale/en/LC_MESSAGES/django.po +++ b/benefits/locale/en/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-16 23:37+0000\n" +"POT-Creation-Date: 2023-11-16 23:40+0000\n" "Language: English\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -307,7 +307,7 @@ msgid "" "eligibility." msgstr "" -msgid "Last name (as it appears on Mobility Pass)" +msgid "Last name (as it appears on Mobility Pass card)" msgstr "" msgid "We use this to help confirm your Mobility Pass." diff --git a/benefits/locale/es/LC_MESSAGES/django.po b/benefits/locale/es/LC_MESSAGES/django.po index c517728b5..e84abd0a0 100644 --- a/benefits/locale/es/LC_MESSAGES/django.po +++ b/benefits/locale/es/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: https://github.com/cal-itp/benefits/issues \n" -"POT-Creation-Date: 2023-11-16 23:37+0000\n" +"POT-Creation-Date: 2023-11-16 23:40+0000\n" "Language: Español\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -397,7 +397,7 @@ msgstr "" "Ingrese el número de cuatro dígitos de su Mobility Pass y su apellido a " "continuación para confirmar su elegibilidad." -msgid "Last name (as it appears on Mobility Pass)" +msgid "Last name (as it appears on Mobility Pass card)" msgstr "Apellido (tal como aparece en la tarjeta de Mobility Pass)" msgid "We use this to help confirm your Mobility Pass." From 2d0b9013454319820d5177eb746514c6356fe056 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:53:45 +0000 Subject: [PATCH 70/78] chore(pre-commit): autoupdate hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/compilerla/conventional-pre-commit: v2.4.0 → v3.0.0](https://github.com/compilerla/conventional-pre-commit/compare/v2.4.0...v3.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 379d20902..0f67df768 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ default_stages: repos: - repo: https://github.com/compilerla/conventional-pre-commit - rev: v2.4.0 + rev: v3.0.0 hooks: - id: conventional-pre-commit stages: [commit-msg] From accd1bac933a9dd7664f5095d0c66d54e0e8e239 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:30:37 +0000 Subject: [PATCH 71/78] chore(deps-dev): bump cypress from 13.5.1 to 13.6.0 in /tests/cypress Bumps [cypress](https://github.com/cypress-io/cypress) from 13.5.1 to 13.6.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](https://github.com/cypress-io/cypress/compare/v13.5.1...v13.6.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/cypress/package-lock.json | 14 +++++++------- tests/cypress/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/package-lock.json b/tests/cypress/package-lock.json index e7d5945d3..a929ea19b 100644 --- a/tests/cypress/package-lock.json +++ b/tests/cypress/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "devDependencies": { - "cypress": "^13.5.1" + "cypress": "^13.6.0" } }, "node_modules/@colors/colors": { @@ -536,9 +536,9 @@ } }, "node_modules/cypress": { - "version": "13.5.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.1.tgz", - "integrity": "sha512-yqLViT0D/lPI8Kkm7ciF/x/DCK/H/DnogdGyiTnQgX4OVR2aM30PtK+kvklTOD1u3TuItiD9wUQAF8EYWtyZug==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.0.tgz", + "integrity": "sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2357,9 +2357,9 @@ } }, "cypress": { - "version": "13.5.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.1.tgz", - "integrity": "sha512-yqLViT0D/lPI8Kkm7ciF/x/DCK/H/DnogdGyiTnQgX4OVR2aM30PtK+kvklTOD1u3TuItiD9wUQAF8EYWtyZug==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.0.tgz", + "integrity": "sha512-quIsnFmtj4dBUEJYU4OH0H12bABJpSujvWexC24Ju1gTlKMJbeT6tTO0vh7WNfiBPPjoIXLN+OUqVtiKFs6SGw==", "dev": true, "requires": { "@cypress/request": "^3.0.0", diff --git a/tests/cypress/package.json b/tests/cypress/package.json index d667c439d..a84b6d164 100644 --- a/tests/cypress/package.json +++ b/tests/cypress/package.json @@ -12,6 +12,6 @@ "license": "AGPL-3.0-or-later", "private": true, "devDependencies": { - "cypress": "^13.5.1" + "cypress": "^13.6.0" } } From 556095af0391f6bcd3afc93435c84793e865f26f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:53:55 +0000 Subject: [PATCH 72/78] chore(deps-dev): bump sentry-sdk from 1.35.0 to 1.38.0 Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.35.0 to 1.38.0. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-python/compare/1.35.0...1.38.0) --- updated-dependencies: - dependency-name: sentry-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2906458c6..ff3fc46af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "django-csp==3.7", "eligibility-api==2023.9.1", "requests==2.31.0", - "sentry-sdk==1.35.0", + "sentry-sdk==1.38.0", "six==1.16.0", ] From a774dfc62f504b02b2f830918363a51634a669f2 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Thu, 30 Nov 2023 18:18:24 +0000 Subject: [PATCH 73/78] docs: add extension to make nested lists work --- docs/requirements.txt | 1 + mkdocs.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index c35ca8d1c..028622c74 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ +mdx_truly_sane_lists mkdocs mkdocs-awesome-pages-plugin mkdocs-macros-plugin diff --git a/mkdocs.yml b/mkdocs.yml index 7ea374833..d520b6187 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -50,6 +50,7 @@ markdown_extensions: - attr_list - codehilite: linenums: true + - mdx_truly_sane_lists - pymdownx.emoji: emoji_index: !!python/name:materialx.emoji.twemoji emoji_generator: !!python/name:materialx.emoji.to_svg From bbb99834443ffccb5923a105fb701d0941a69f7b Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 1 Dec 2023 09:40:27 -0800 Subject: [PATCH 74/78] chore(git): ignore python venv --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 443eb5dd6..46b0f2ec3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ benefits/static/sha.txt __pycache__/ .coverage .DS_Store +.venv From 083e1bc2a39a9ba2d6af5357e1a611f27cd25a71 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 1 Dec 2023 17:46:10 +0000 Subject: [PATCH 75/78] fix(init): rename then delete old database on reset trying to avoid a file lock on the existing file after it has been marked for deletion --- bin/init.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/bin/init.sh b/bin/init.sh index 3a1e2b8bb..8a11d863e 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -1,15 +1,18 @@ #!/usr/bin/env bash set -eux -# remove existing (old) database file - -if [[ ${DJANGO_DB_RESET:-true} = true ]]; then - # construct the path to the database file from environment or default - DB_DIR="${DJANGO_DB_DIR:-.}" - DB_FILE="${DB_DIR}/django.db" +# make the path to the database file from environment or default +DB_DIR="${DJANGO_DB_DIR:-.}" +DB_FILE="${DB_DIR}/django.db" +DB_RESET="${DJANGO_DB_RESET:-true}" - # -f forces the delete (and avoids an error when the file doesn't exist) - rm -f "${DB_FILE}" +# remove existing (old) database file +if [[ $DB_RESET = true && -f $DB_FILE ]]; then + # rename then delete the new file + # trying to avoid a file lock on the existing file + # after marking it for deletion + mv "${DB_FILE}" "${DB_FILE}.old" + rm "${DB_FILE}.old" fi # run database migrations From 1f2b94bdf322e9ae67922808f9fe30203568a910 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 1 Dec 2023 20:15:20 +0000 Subject: [PATCH 76/78] fix(enrollment): update re-enrollment error handling do not rely on specific text of the error message instead check for presence of customer ID and group ID --- benefits/enrollment/api.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/benefits/enrollment/api.py b/benefits/enrollment/api.py index 525d74393..964a90da3 100644 --- a/benefits/enrollment/api.py +++ b/benefits/enrollment/api.py @@ -65,7 +65,7 @@ def __init__(self, response): class GroupResponse: """Benefits Enrollment Customer Group API response.""" - def __init__(self, response, requested_id, payload=None): + def __init__(self, response, requested_id, group_id, payload=None): if payload is None: try: payload = response.json() @@ -74,18 +74,12 @@ def __init__(self, response, requested_id, payload=None): else: try: # Group API uses an error response (500) to indicate that the customer already exists in the group (!!!) - # The error message should contain the customer ID we sent via payload and start with "Duplicate" + # The error message should contain the customer ID and group ID we sent via payload error = response.json()["errors"][0] customer_id = payload[0] detail = error["detail"] - failure = ( - customer_id is None - or detail is None - or customer_id not in detail - or customer_id in detail - and not detail.startswith("Duplicate") - ) + failure = customer_id is None or detail is None or not (customer_id in detail and group_id in detail) if failure: raise ApiError("Invalid response format") @@ -269,10 +263,10 @@ def enroll(self, customer_token, group_id): if r.status_code in (200, 201): logger.info("Customer enrolled in group") - return GroupResponse(r, customer.id) + return GroupResponse(r, customer.id, group_id) elif r.status_code == 500: logger.info("Customer already exists in group") - return GroupResponse(r, customer.id, payload=payload) + return GroupResponse(r, customer.id, group_id, payload=payload) else: r.raise_for_status() except requests.ConnectionError: From 87b2671fa43c4539e60514d74a0017b08711d05c Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Fri, 1 Dec 2023 20:16:02 +0000 Subject: [PATCH 77/78] test(enrollment): update tests for error condition --- .../enrollment/test_api_GroupResponse.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/pytest/enrollment/test_api_GroupResponse.py b/tests/pytest/enrollment/test_api_GroupResponse.py index 20807773e..4a5aaeeb0 100644 --- a/tests/pytest/enrollment/test_api_GroupResponse.py +++ b/tests/pytest/enrollment/test_api_GroupResponse.py @@ -8,14 +8,14 @@ def test_no_payload_invalid_response(mocker): mock_response.json.side_effect = ValueError with pytest.raises(ApiError, match=r"response"): - GroupResponse(mock_response, 0) + GroupResponse(mock_response, "customer", "group") def test_no_payload_valid_response_single_matching_id(mocker): mock_response = mocker.Mock() mock_response.json.return_value = ["0"] - response = GroupResponse(mock_response, "0") + response = GroupResponse(mock_response, "0", "group") assert response.customer_ids == ["0"] assert response.updated_customer_id == "0" @@ -27,7 +27,7 @@ def test_no_payload_valid_response_single_unmatching_id(mocker): mock_response = mocker.Mock() mock_response.json.return_value = ["1"] - response = GroupResponse(mock_response, "0") + response = GroupResponse(mock_response, "0", "group") assert response.customer_ids == ["1"] assert response.updated_customer_id == "1" @@ -39,7 +39,7 @@ def test_no_payload_valid_response_multiple_ids(mocker): mock_response = mocker.Mock() mock_response.json.return_value = ["0", "1"] - response = GroupResponse(mock_response, "0") + response = GroupResponse(mock_response, "0", "group") assert response.customer_ids == ["0", "1"] assert not response.updated_customer_id @@ -53,14 +53,14 @@ def test_payload_invalid_response(mocker, exception): mock_response.json.side_effect = exception with pytest.raises(ApiError, match=r"response"): - GroupResponse(mock_response, "0", []) + GroupResponse(mock_response, "0", "group", []) def test_payload_valid_response(mocker): mock_response = mocker.Mock() - mock_response.json.return_value = {"errors": [{"detail": "Duplicate id 0"}]} + mock_response.json.return_value = {"errors": [{"detail": "0 group"}]} - response = GroupResponse(mock_response, "0", ["0"]) + response = GroupResponse(mock_response, "0", "group", ["0"]) assert response.customer_ids == ["0"] assert response.updated_customer_id == "0" @@ -69,13 +69,13 @@ def test_payload_valid_response(mocker): failure_conditions = [ - # customer_id is None - ({"detail": "Duplicate"}, [None]), # detail is None ({"detail": None}, ["0"]), + # customer_id is None + ({"detail": "0 group"}, [None]), # customer_id not in detail - ({"detail": "1"}, ["0"]), - # customer_id in detail, detail doesn't start with Duplicate + ({"detail": "1 group"}, ["0"]), + # group_id not in detail ({"detail": "0"}, ["0"]), ] @@ -86,4 +86,4 @@ def test_payload_failure_response(mocker, error, payload): mock_response.json.return_value = {"errors": [error]} with pytest.raises(ApiError, match=r"response"): - GroupResponse(mock_response, "0", payload) + GroupResponse(mock_response, "0", "group", payload) From 79474763463d3ea61db873a3048578f2ff973428 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Fri, 1 Dec 2023 21:14:37 +0000 Subject: [PATCH 78/78] chore: bump version to 2023.12.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ff3fc46af..6fd1054ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "benefits" -version = "2023.09.1" +version = "2023.12.1" description = "Cal-ITP Benefits is an application that enables automated eligibility verification and enrollment for transit benefits onto customers’ existing contactless bank (credit/debit) cards." readme = "README.md" license = { file = "LICENSE" }