From 12b6943b53d469405a3bc8a50c97b3a722b36581 Mon Sep 17 00:00:00 2001 From: Angela Tran Date: Wed, 31 Jul 2024 20:59:35 +0000 Subject: [PATCH] refactor(model): add help text to all fields for ClaimsProvider --- ..._add_help_text_to_claimsprovider_fields.py | 65 +++++++++++++++++++ benefits/core/models.py | 24 ++++--- 2 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 benefits/core/migrations/0017_add_help_text_to_claimsprovider_fields.py diff --git a/benefits/core/migrations/0017_add_help_text_to_claimsprovider_fields.py b/benefits/core/migrations/0017_add_help_text_to_claimsprovider_fields.py new file mode 100644 index 000000000..730cdc962 --- /dev/null +++ b/benefits/core/migrations/0017_add_help_text_to_claimsprovider_fields.py @@ -0,0 +1,65 @@ +# Generated by Django 5.0.7 on 2024-07-31 21:00 + +import benefits.core.models +import benefits.secrets +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0016_rename_authprovider_claimsprovider"), + ] + + operations = [ + migrations.AlterField( + model_name="claimsprovider", + name="authority", + field=models.TextField(help_text="The fully qualified HTTPS domain name for an OAuth authority server"), + ), + migrations.AlterField( + model_name="claimsprovider", + name="claim", + field=models.TextField( + blank=True, help_text="The name of the claim (name/value pair) that is used to verify eligibility", null=True + ), + ), + migrations.AlterField( + model_name="claimsprovider", + name="client_id_secret_name", + field=benefits.core.models.SecretNameField( + help_text="The name of the secret containing the client ID for this claims provider", + max_length=127, + validators=[benefits.secrets.SecretNameValidator()], + ), + ), + migrations.AlterField( + model_name="claimsprovider", + name="client_name", + field=models.TextField(help_text="Unique identifier used to register this claims provider with Authlib registry"), + ), + migrations.AlterField( + model_name="claimsprovider", + name="scheme", + field=models.TextField(help_text="The authentication scheme to use"), + ), + migrations.AlterField( + model_name="claimsprovider", + name="scope", + field=models.TextField( + blank=True, + help_text="A space-separated list of identifiers used to specify what access privileges are being requested", + null=True, + ), + ), + migrations.AlterField( + model_name="claimsprovider", + name="sign_out_button_template", + field=models.TextField(blank=True, help_text="Template that renders sign-out button", null=True), + ), + migrations.AlterField( + model_name="claimsprovider", + name="sign_out_link_template", + field=models.TextField(blank=True, help_text="Template that renders sign-out link", null=True), + ), + ] diff --git a/benefits/core/models.py b/benefits/core/models.py index e9a1cded2..cc501478f 100644 --- a/benefits/core/models.py +++ b/benefits/core/models.py @@ -79,14 +79,22 @@ class ClaimsProvider(models.Model): """An entity that provides claims for eligibility verification.""" id = models.AutoField(primary_key=True) - sign_out_button_template = models.TextField(null=True, blank=True) - sign_out_link_template = models.TextField(null=True, blank=True) - client_name = models.TextField() - client_id_secret_name = SecretNameField() - authority = models.TextField() - scope = models.TextField(null=True, blank=True) - claim = models.TextField(null=True, blank=True) - scheme = models.TextField() + sign_out_button_template = models.TextField(null=True, blank=True, help_text="Template that renders sign-out button") + sign_out_link_template = models.TextField(null=True, blank=True, help_text="Template that renders sign-out link") + client_name = models.TextField(help_text="Unique identifier used to register this claims provider with Authlib registry") + client_id_secret_name = SecretNameField( + help_text="The name of the secret containing the client ID for this claims provider" + ) + authority = models.TextField(help_text="The fully qualified HTTPS domain name for an OAuth authority server") + scope = models.TextField( + null=True, + blank=True, + help_text="A space-separated list of identifiers used to specify what access privileges are being requested", + ) + claim = models.TextField( + null=True, blank=True, help_text="The name of the claim (name/value pair) that is used to verify eligibility" + ) + scheme = models.TextField(help_text="The authentication scheme to use") @property def supports_claims_verification(self):