auth_saml: clarify some parameters (#67875)

This commit is contained in:
Valentin Deniaud 2022-08-22 11:27:40 +02:00
parent 55a2c56130
commit a11ddf1778
3 changed files with 8 additions and 22 deletions

View File

@ -50,9 +50,7 @@ class Migration(migrations.Migration):
(
'provision',
models.BooleanField(
default=True,
help_text='Create user if their username does not already exists.',
verbose_name='Provision',
default=True, verbose_name='Create user if their username does not already exists'
),
),
(
@ -81,9 +79,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)',
),
),
(

View File

@ -38,11 +38,7 @@ class SAMLAuthenticator(BaseAuthenticator):
)
metadata = models.TextField(_('Metadata (XML)'), blank=True)
provision = models.BooleanField(
_('Provision'),
default=True,
help_text=_('Create user if their username does not already exists.'),
)
provision = models.BooleanField(_('Create user if their username does not already exists'), default=True)
verify_ssl_certificate = models.BooleanField(
_('Verify SSL certificate'),
default=True,
@ -57,9 +53,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 +140,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')

View File

@ -284,8 +284,7 @@ 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 'Create user if their username does not already exists: True' in resp.text
assert 'Metadata file path' not in resp.text
assert 'Enable' not in resp.text