Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Clean up localfixtures, env, Cypress tests to only have CST #2214

Merged
merged 8 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ DJANGO_DB_FILE=django.db
DJANGO_DB_FIXTURES="benefits/core/migrations/local_fixtures.json"

auth_provider_client_id=benefits-oauth-client-id
courtesy_card_verifier_api_auth_key=server-auth-token
mobility_pass_verifier_api_auth_key=server-auth-token
agency_card_verifier_api_auth_key=server-auth-token
client_private_key='-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA1pt0ZoOuPEVPJJS+5r884zcjZLkZZ2GcPwr79XOLDbOi46on\nCa79kjRnhS0VUK96SwUPS0z9J5mDA5LSNL2RoxFb5QGaevnJY828NupzTNdUd0sY\nJK3kRjKUggHWuB55hwJcH/Dx7I3DNH4NL68UAlK+VjwJkfYPrhq/bl5z8ZiurvBa\n5C1mDxhFpcTZlCfxQoas7D1d+uPACF6mEMbQNd3RaIaSREO50NvNywXIIt/OmCiR\nqI7JtOcn4eyh1I4j9WtlbMhRJLfwPMAgY5epTsWcURmhVofF2wVoFbib3JGCfA7t\nz/gmP5YoEKnf/cumKmF3e9LrZb8zwm7bTHUViwIDAQABAoIBAQCIv0XMjNvZS9DC\nXoXGQtVpcxj6dXfaiDgnc7hZDubsNCr3JtT5NqgdIYdVNQUABNDIPNEiCkzFjuwM\nuuF2+dRzM/x6UCs/cSsCjXYBCCOwMwV/fjpEJQnwMQqwTLulVsXZYYeSUtXVBf/8\n0tVULRty34apLFhsyX30UtboXQ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InI0eR9H3cRugvlDTeWtbdJ5qA==\n-----END RSA PRIVATE KEY-----'
client_public_key='-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1pt0ZoOuPEVPJJS+5r88\n4zcjZLkZZ2GcPwr79XOLDbOi46onCa79kjRnhS0VUK96SwUPS0z9J5mDA5LSNL2R\noxFb5QGaevnJY828NupzTNdUd0sYJK3kRjKUggHWuB55hwJcH/Dx7I3DNH4NL68U\nAlK+VjwJkfYPrhq/bl5z8ZiurvBa5C1mDxhFpcTZlCfxQoas7D1d+uPACF6mEMbQ\nNd3RaIaSREO50NvNywXIIt/OmCiRqI7JtOcn4eyh1I4j9WtlbMhRJLfwPMAgY5ep\nTsWcURmhVofF2wVoFbib3JGCfA7tz/gmP5YoEKnf/cumKmF3e9LrZb8zwm7bTHUV\niwIDAQAB\n-----END PUBLIC KEY-----'
mst_payment_processor_client_secret=secret
sacrt_payment_processor_client_secret=secret
sbmtd_payment_processor_client_secret=secret
cst_payment_processor_client_secret=secret

testsecret="Hello from the local environment!"
245 changes: 35 additions & 210 deletions benefits/core/migrations/local_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
"model": "core.pemdata",
"pk": 1,
"fields": {
"label": "(MST) eligibility server public key",
"label": "(CST) eligibility server public key",
"text_secret_name": null,
"remote_url": "https://raw.githubusercontent.com/cal-itp/eligibility-server/main/keys/server.pub"
}
},
{
"model": "core.pemdata",
"pk": 2,
"fields": {
"label": "(SBMTD) eligibility server public key",
"text_secret_name": null,
"remote_url": "https://raw.githubusercontent.com/cal-itp/eligibility-server/main/keys/server.pub"
}
},
{
"model": "core.pemdata",
"pk": 3,
"fields": {
"label": "Benefits client private key",
"text_secret_name": "client-private-key",
Expand All @@ -28,7 +19,7 @@
},
{
"model": "core.pemdata",
"pk": 4,
"pk": 3,
"fields": {
"label": "Benefits client public key",
"text_secret_name": "client-public-key",
Expand Down Expand Up @@ -68,66 +59,35 @@
"pk": 1,
"fields": {
"name": "senior",
"label": "(MST) Senior Discount",
"label": "(CST) Senior Discount",
"group_id": "group123",
"enrollment_success_template": "enrollment/success--mst.html"
"enrollment_success_template": "enrollment/success--cst.html"
}
},
{
"model": "core.eligibilitytype",
"pk": 2,
"fields": {
"name": "veteran",
"label": "(MST) Veteran Discount",
"label": "(CST) Veteran Discount",
"group_id": "group123",
"enrollment_success_template": "enrollment/success--mst.html"
"enrollment_success_template": "enrollment/success--cst.html"
}
},
{
"model": "core.eligibilitytype",
"pk": 3,
"fields": {
"name": "courtesy_card",
"label": "(MST) Courtesy Card Discount",
"name": "agency_card",
"label": "(CST) Agency Card Discount",
"group_id": "group123",
"enrollment_index_template": "enrollment/index--agency-card.html",
"enrollment_success_template": "enrollment/success--mst-courtesy-card.html"
"enrollment_success_template": "enrollment/success--cst-agency-card.html"
}
},
{
"model": "core.eligibilitytype",
"pk": 4,
"fields": {
"name": "senior",
"label": "(SacRT) Senior Discount",
"group_id": "group123",
"enrollment_success_template": "enrollment/success--sacrt.html"
}
},
{
"model": "core.eligibilitytype",
"pk": 5,
"fields": {
"name": "senior",
"label": "(SBMTD) Senior Discount",
"group_id": "group123",
"enrollment_success_template": "enrollment/success--sbmtd.html"
}
},
{
"model": "core.eligibilitytype",
"pk": 6,
"fields": {
"name": "mobility_pass",
"label": "(SBMTD) Mobility Pass Discount",
"group_id": "group123",
"enrollment_index_template": "enrollment/index--agency-card.html",
"enrollment_success_template": "enrollment/success--sbmtd-mobility-pass.html"
}
},
{
"model": "core.eligibilitytype",
"pk": 7,
"fields": {
"name": "calfresh",
"label": "CalFresh",
Expand All @@ -136,14 +96,14 @@
"expiration_days": 5,
"expiration_reenrollment_days": 3,
"reenrollment_error_template": "enrollment/reenrollment-error--calfresh.html",
"enrollment_success_template": "enrollment/success--mst.html"
"enrollment_success_template": "enrollment/success--cst.html"
}
},
{
"model": "core.eligibilityverifier",
"pk": 1,
"fields": {
"name": "(MST) oauth claims via Login.gov",
"name": "(CST) oauth claims via Login.gov",
"display_order": 1,
"active": true,
"api_url": null,
Expand All @@ -164,7 +124,7 @@
"model": "core.eligibilityverifier",
"pk": 2,
"fields": {
"name": "(MST) VA.gov - veteran",
"name": "(CST) VA.gov - veteran",
"display_order": 3,
"active": true,
"api_url": null,
Expand All @@ -185,101 +145,36 @@
"model": "core.eligibilityverifier",
"pk": 3,
"fields": {
"name": "(MST) eligibility server verifier",
"name": "(CST) eligibility server verifier",
"display_order": 4,
"active": true,
"api_url": "http://server:8000/verify",
"api_auth_header": "X-Server-API-Key",
"api_auth_key_secret_name": "courtesy-card-verifier-api-auth-key",
"api_auth_key_secret_name": "agency-card-verifier-api-auth-key",
"eligibility_type": 3,
"public_key": 1,
"jwe_cek_enc": "A256CBC-HS512",
"jwe_encryption_alg": "RSA-OAEP",
"jws_signing_alg": "RS256",
"auth_provider": null,
"selection_label_template": "eligibility/includes/selection-label--mst-courtesy-card.html",
"start_template": "eligibility/start--mst-courtesy-card.html",
"form_class": "benefits.eligibility.forms.MSTCourtesyCard",
"unverified_template": "eligibility/unverified--mst-courtesy-card.html",
"help_template": "core/includes/help--mst-courtesy-card.html"
"selection_label_template": "eligibility/includes/selection-label--cst-agency-card.html",
"start_template": "eligibility/start--cst-agency-card.html",
"form_class": "benefits.eligibility.forms.CSTAgencyCard",
"unverified_template": "eligibility/unverified--cst-agency-card.html",
"help_template": "core/includes/help--cst-agency-card.html"
}
},
{
"model": "core.eligibilityverifier",
"pk": 4,
"fields": {
"name": "(SacRT) oauth claims via Login.gov",
"display_order": 5,
"active": false,
"api_url": null,
"api_auth_header": null,
"api_auth_key_secret_name": null,
"eligibility_type": 4,
"public_key": null,
"jwe_cek_enc": null,
"jwe_encryption_alg": null,
"jws_signing_alg": null,
"auth_provider": 1,
"selection_label_template": "eligibility/includes/selection-label--senior.html",
"start_template": "eligibility/start--senior.html",
"form_class": null
}
},
{
"model": "core.eligibilityverifier",
"pk": 5,
"fields": {
"name": "(SBMTD) oauth claims via Login.gov",
"display_order": 6,
"active": false,
"api_url": null,
"api_auth_header": null,
"api_auth_key_secret_name": null,
"eligibility_type": 5,
"public_key": null,
"jwe_cek_enc": null,
"jwe_encryption_alg": null,
"jws_signing_alg": null,
"auth_provider": 1,
"selection_label_template": "eligibility/includes/selection-label--senior.html",
"start_template": "eligibility/start--senior.html",
"form_class": null
}
},
{
"model": "core.eligibilityverifier",
"pk": 6,
"fields": {
"name": "(SBMTD) eligibility server verifier",
"display_order": 7,
"active": true,
"api_url": "http://server:8000/verify",
"api_auth_header": "X-Server-API-Key",
"api_auth_key_secret_name": "mobility-pass-verifier-api-auth-key",
"eligibility_type": 6,
"public_key": 2,
"jwe_cek_enc": "A256CBC-HS512",
"jwe_encryption_alg": "RSA-OAEP",
"jws_signing_alg": "RS256",
"auth_provider": null,
"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",
"unverified_template": "eligibility/unverified--sbmtd-mobility-pass.html",
"help_template": "core/includes/help--sbmtd-mobility-pass.html"
}
},
{
"model": "core.eligibilityverifier",
"pk": 7,
"fields": {
"name": "(MST) CalFresh oauth claims via Login.gov",
"name": "(CST) CalFresh oauth claims via Login.gov",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not for this PR): eventually we should have a new core.authprovider instance for this verifier:

{
  "model": "core.authprovider",
  "pk": 3,
  "fields": {
    "sign_out_button_template": "core/includes/button--sign-out--login-gov.html",
    "sign_out_link_template": "core/includes/link--sign-out--login-gov.html",
    "client_name": "calfresh-benefits-oauth-client-name",
    "client_id_secret_name": "auth-provider-client-id",
    "authority": "https://example.com",
    "scope": "verify:calfresh",
    "claim": "calfresh",
    "scheme": "dev-cal-itp_benefits"
  }
},

Then update the field here on the eligibilityverifier:

- "auth_provider": 1
+ "auth_provider": 3

"display_order": 2,
"active": true,
"api_url": null,
"api_auth_header": null,
"api_auth_key_secret_name": null,
"eligibility_type": 7,
"eligibility_type": 4,
"public_key": null,
"jwe_cek_enc": null,
"jwe_encryption_alg": null,
Expand All @@ -295,38 +190,10 @@
"model": "core.paymentprocessor",
"pk": 1,
"fields": {
"name": "(MST) test payment processor",
"api_base_url": "http://server:8000",
"client_id": "",
"client_secret_name": "mst-payment-processor-client-secret",
"audience": "",
"card_tokenize_url": "http://server:8000/static/tokenize.js",
"card_tokenize_func": "tokenize",
"card_tokenize_env": "test"
}
},
{
"model": "core.paymentprocessor",
"pk": 2,
"fields": {
"name": "(SacRT) test payment processor",
"name": "(CST) test payment processor",
"api_base_url": "http://server:8000",
"client_id": "",
"client_secret_name": "sacrt-payment-processor-client-secret",
"audience": "",
"card_tokenize_url": "http://server:8000/static/tokenize.js",
"card_tokenize_func": "tokenize",
"card_tokenize_env": "test"
}
},
{
"model": "core.paymentprocessor",
"pk": 3,
"fields": {
"name": "(SBMTD) test payment processor",
"api_base_url": "http://server:8000",
"client_id": "",
"client_secret_name": "sbmtd-payment-processor-client-secret",
"client_secret_name": "cst-payment-processor-client-secret",
"audience": "",
"card_tokenize_url": "http://server:8000/static/tokenize.js",
"card_tokenize_func": "tokenize",
Expand All @@ -337,63 +204,21 @@
"model": "core.transitagency",
"pk": 1,
"fields": {
"slug": "mst",
"short_name": "MST (local)",
"long_name": "Monterey-Salinas Transit (local)",
"agency_id": "mst",
"info_url": "https://mst.org/benefits",
"phone": "888-678-2871",
"slug": "cst",
"short_name": "CST (local)",
"long_name": "California State Transit (local)",
"agency_id": "cst",
"info_url": "https://www.agency-website.com",
"phone": "1-800-555-5555",
"active": true,
"payment_processor": 1,
"private_key": 3,
"public_key": 4,
"jws_signing_alg": "RS256",
"index_template": "core/index--mst.html",
"eligibility_index_template": "eligibility/index--mst.html",
"eligibility_types": [1, 7, 2, 3],
"eligibility_verifiers": [1, 7, 2, 3]
}
},
{
"model": "core.transitagency",
"pk": 2,
"fields": {
"slug": "sacrt",
"short_name": "SacRT (local)",
"long_name": "Sacramento Regional Transit (local)",
"agency_id": "sacrt",
"info_url": "https://sacrt.com/",
"phone": "916-321-2877",
"active": true,
"payment_processor": 2,
"private_key": 3,
"public_key": 4,
"jws_signing_alg": "RS256",
"index_template": "core/index--sacrt.html",
"eligibility_index_template": "eligibility/index--sacrt.html",
"eligibility_types": [4],
"eligibility_verifiers": [4]
}
},
{
"model": "core.transitagency",
"pk": 3,
"fields": {
"slug": "sbmtd",
"short_name": "SBMTD (local)",
"long_name": "Santa Barbara MTD (local)",
"agency_id": "sbmtd",
"info_url": "https://sbmtd.gov/taptoride/",
"phone": "805-963-3366",
"active": true,
"payment_processor": 3,
"private_key": 3,
"public_key": 4,
"private_key": 2,
"public_key": 3,
"jws_signing_alg": "RS256",
"index_template": "core/index--sbmtd.html",
"eligibility_index_template": "eligibility/index--sbmtd.html",
"eligibility_types": [5, 6],
"eligibility_verifiers": [5, 6]
"index_template": "core/index--cst.html",
"eligibility_index_template": "eligibility/index--cst.html",
"eligibility_types": [1, 2, 3, 4],
"eligibility_verifiers": [1, 2, 3, 4]
}
}
]
4 changes: 2 additions & 2 deletions tests/cypress/plugins/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export const selectAgency = () => {
return agency;
};

export const selectCourtesyCard = () => {
export const selectAgencyCard = () => {
cy.location("pathname").should("eq", `/eligibility/${agency.slug}`);

cy.contains("MST Courtesy Card").click();
cy.contains("CST Agency Card").click();
cy.contains("Choose this benefit").click();
cy.contains("Continue").click();
};
Loading
Loading