From bd6a48f4ef5293f063480df59cf984266876439f Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Thu, 28 Jul 2022 18:18:31 +0200 Subject: [PATCH 6/8] auth_saml: remove JSON fields from model (#67025) --- .../migrations/0006_remove_jsonfields.py | 21 +++++++++++++++++++ src/authentic2_auth_saml/models.py | 21 ------------------- 2 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 src/authentic2_auth_saml/migrations/0006_remove_jsonfields.py diff --git a/src/authentic2_auth_saml/migrations/0006_remove_jsonfields.py b/src/authentic2_auth_saml/migrations/0006_remove_jsonfields.py new file mode 100644 index 00000000..370dcff0 --- /dev/null +++ b/src/authentic2_auth_saml/migrations/0006_remove_jsonfields.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.26 on 2022-07-28 16:17 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('authentic2_auth_saml', '0005_migrate_jsonfields'), + ] + + operations = [ + migrations.RemoveField( + model_name='samlauthenticator', + name='a2_attribute_mapping', + ), + migrations.RemoveField( + model_name='samlauthenticator', + name='lookup_by_attributes', + ), + ] diff --git a/src/authentic2_auth_saml/models.py b/src/authentic2_auth_saml/models.py index 3f871803..c1eeb397 100644 --- a/src/authentic2_auth_saml/models.py +++ b/src/authentic2_auth_saml/models.py @@ -125,27 +125,6 @@ class SAMLAuthenticator(BaseAuthenticator): login_hints = models.CharField( _('Login hints'), max_length=512, help_text=_('Comma separated list.'), blank=True ) - lookup_by_attributes = JSONField( - _('Lookup by attributes'), - default=list, - help_text=_( - 'Allow looking for user with some SAML attributes if the received NameID is ' - 'still unknown. It must be a list of dictionnaries with two mandatory keys ' - '`user_field` and `saml_attribute`. The optionnal key `ignore-case` should be a ' - 'boolean indicating if the match is case-insensitive (default is to respect the ' - 'case).' - ), - blank=True, - ) - a2_attribute_mapping = JSONField( - _('Attribute mapping'), - default=list, - help_text=_( - 'Copy incoming SAML attributes to user attributes, for example ' - 'for example [{"attribute": "email", "saml_attribute": "mail", "mandatory": false}].' - ), - blank=True, - ) attribute_mapping = JSONField( _('Attribute mapping (deprecated)'), default=dict, -- 2.30.2