Skip to content

Commit

Permalink
refactor(model): add help text to all fields for ClaimsProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Jul 31, 2024
1 parent 6522d2d commit 12b6943
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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),
),
]
24 changes: 16 additions & 8 deletions benefits/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 12b6943

Please sign in to comment.