From 486991c1ba25bd6ad06bc8b2a81ae7878b0f2cd9 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 22 Aug 2022 11:27:40 +0200 Subject: [PATCH 1/2] auth_saml: clarify some parameters (#67875) --- src/authentic2_auth_saml/migrations/0001_initial.py | 4 ++-- src/authentic2_auth_saml/models.py | 13 +++---------- tests/test_manager_authenticators.py | 1 - 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/authentic2_auth_saml/migrations/0001_initial.py b/src/authentic2_auth_saml/migrations/0001_initial.py index 0e84d451..3025abd2 100644 --- a/src/authentic2_auth_saml/migrations/0001_initial.py +++ b/src/authentic2_auth_saml/migrations/0001_initial.py @@ -81,9 +81,9 @@ class Migration(migrations.Migration): 'realm', models.CharField( default='saml', - help_text='The default realm to associate to user, used when setting username.', + help_text='The default realm to associate to user, can be used in username template.', max_length=32, - verbose_name='Realm', + verbose_name='Realm (realm)', ), ), ( diff --git a/src/authentic2_auth_saml/models.py b/src/authentic2_auth_saml/models.py index ba6bccda..a079488c 100644 --- a/src/authentic2_auth_saml/models.py +++ b/src/authentic2_auth_saml/models.py @@ -57,9 +57,9 @@ class SAMLAuthenticator(BaseAuthenticator): blank=True, ) realm = models.CharField( - _('Realm'), + _('Realm (realm)'), max_length=32, - help_text=_('The default realm to associate to user, used when setting username.'), + help_text=_('The default realm to associate to user, can be used in username template.'), default='saml', ) username_template = models.CharField( @@ -144,14 +144,7 @@ class SAMLAuthenticator(BaseAuthenticator): type = 'saml' how = ['saml'] manager_view_template_name = 'authentic2_auth_saml/authenticator_detail.html' - description_fields = [ - 'show_condition', - 'metadata_url', - 'metadata_path', - 'metadata', - 'provision', - 'username_template', - ] + description_fields = ['show_condition', 'metadata_url', 'metadata_path', 'metadata', 'provision'] class Meta: verbose_name = _('SAML') diff --git a/tests/test_manager_authenticators.py b/tests/test_manager_authenticators.py index 0fdb6a67..e62b2c70 100644 --- a/tests/test_manager_authenticators.py +++ b/tests/test_manager_authenticators.py @@ -254,7 +254,6 @@ def test_authenticators_saml(app, superuser, ou1, ou2): authenticator = SAMLAuthenticator.objects.filter(slug='test').get() resp = app.get(authenticator.get_absolute_url()) - assert 'Username template: {attributes[name_id_content]}@{realm}' in resp.text assert 'Provision: True' in resp.text assert 'Metadata file path' not in resp.text -- 2.30.2