Repository: cal-itp/benefits

Issue:
Define AuthProvider for veterans



Discussion:

Resolving patch:
diff --git a/benefits/core/migrations/0002_data.py b/benefits/core/migrations/0002_data.py
--- a/benefits/core/migrations/0002_data.py
+++ b/benefits/core/migrations/0002_data.py
@@ -126,15 +126,26 @@ def load_data(app, *args, **kwargs):
 
     AuthProvider = app.get_model("core", "AuthProvider")
 
-    auth_provider = AuthProvider.objects.create(
-        sign_in_button_label=_("eligibility.buttons.signin"),
-        sign_out_button_label=_("eligibility.buttons.signout"),
-        client_name=os.environ.get("AUTH_PROVIDER_CLIENT_NAME", "benefits-oauth-client-name"),
+    senior_auth_provider = AuthProvider.objects.create(
+        sign_in_button_label=_("eligibility.buttons.senior.signin"),
+        sign_out_button_label=_("eligibility.buttons.senior.signout"),
+        client_name=os.environ.get("SENIOR_AUTH_PROVIDER_CLIENT_NAME", "senior-benefits-oauth-client-name"),
         client_id=os.environ.get("AUTH_PROVIDER_CLIENT_ID", "benefits-oauth-client-id"),
         authority=os.environ.get("AUTH_PROVIDER_AUTHORITY", "https://example.com"),
-        scope=os.environ.get("AUTH_PROVIDER_SCOPE", "verify:senior"),
-        claim=os.environ.get("AUTH_PROVIDER_CLAIM", "senior"),
-        scheme=os.environ.get("AUTH_PROVIDER_SCHEME", "dev-cal-itp_benefits"),
+        scope=os.environ.get("SENIOR_AUTH_PROVIDER_SCOPE", "verify:senior"),
+        claim=os.environ.get("SENIOR_AUTH_PROVIDER_CLAIM", "senior"),
+        scheme=os.environ.get("SENIOR_AUTH_PROVIDER_SCHEME", "dev-cal-itp_benefits"),
+    )
+
+    veteran_auth_provider = AuthProvider.objects.create(
+        sign_in_button_label=_("eligibility.buttons.veteran.signin"),
+        sign_out_button_label=_("eligibility.buttons.veteran.signout"),
+        client_name=os.environ.get("VETERAN_AUTH_PROVIDER_CLIENT_NAME", "veteran-benefits-oauth-client-name"),
+        client_id=os.environ.get("AUTH_PROVIDER_CLIENT_ID", "benefits-oauth-client-id"),
+        authority=os.environ.get("AUTH_PROVIDER_AUTHORITY", "https://example.com"),
+        scope=os.environ.get("VETERAN_AUTH_PROVIDER_SCOPE", "verify:veteran"),
+        claim=os.environ.get("VETERAN_AUTH_PROVIDER_CLAIM", "veteran"),
+        scheme=os.environ.get("VETERAN_AUTH_PROVIDER_SCHEME", "vagov"),
     )
 
     EligibilityVerifier = app.get_model("core", "EligibilityVerifier")
@@ -142,7 +153,7 @@ def load_data(app, *args, **kwargs):
     mst_oauth_claims_verifier = EligibilityVerifier.objects.create(
         name=os.environ.get("MST_OAUTH_VERIFIER_NAME", "OAuth claims via Login.gov (MST)"),
         eligibility_type=mst_senior_type,
-        auth_provider=auth_provider,
+        auth_provider=senior_auth_provider,
         selection_label=_("eligibility.pages.index.login_gov.label"),
         selection_label_description=_("eligibility.pages.index.login_gov.description"),
         start_title=_("eligibility.pages.start.login_gov.title"),
@@ -164,7 +175,7 @@ def load_data(app, *args, **kwargs):
     mst_veteran_verifier = EligibilityVerifier.objects.create(
         name=os.environ.get("MST_VETERAN_VERIFIER_NAME", "VA.gov - Veteran (MST)"),
         eligibility_type=mst_veteran_type,
-        auth_provider=auth_provider,
+        auth_provider=veteran_auth_provider,
         selection_label=_("eligibility.pages.index.veteran.label"),
         selection_label_description=_("eligibility.pages.index.veteran.description"),
         start_title=_("eligibility.pages.start.veteran.title"),
@@ -224,7 +235,7 @@ def load_data(app, *args, **kwargs):
     sacrt_oauth_claims_verifier = EligibilityVerifier.objects.create(
         name=os.environ.get("SACRT_OAUTH_VERIFIER_NAME", "OAuth claims via Login.gov (SacRT)"),
         eligibility_type=sacrt_senior_type,
-        auth_provider=auth_provider,
+        auth_provider=senior_auth_provider,
         selection_label=_("eligibility.pages.index.login_gov.label"),
         selection_label_description=_("eligibility.pages.index.login_gov.description"),
         start_title=_("eligibility.pages.start.login_gov.title"),
@@ -301,7 +312,7 @@ def load_data(app, *args, **kwargs):
         payment_processor=mst_payment_processor,
         eligibility_index_intro=_("eligibility.pages.index.p[0].mst"),
     )
-    mst_agency.eligibility_types.set([mst_senior_type, mst_courtesy_card_type])
+    mst_agency.eligibility_types.set([mst_senior_type, mst_veteran_type, mst_courtesy_card_type])
     mst_agency.eligibility_verifiers.set([mst_oauth_claims_verifier, mst_veteran_verifier, mst_courtesy_card_verifier])
 
     sacrt_agency = TransitAgency.objects.create(


Test patch: