Projet

Général

Profil

0001-saml-remove-unused-LibertyProvider-fields-16313.patch

Benjamin Dauvergne, 21 juin 2020 15:58

Télécharger (3,01 ko)

Voir les différences:

Subject: [PATCH] saml: remove unused LibertyProvider fields (#16313)

 src/authentic2/saml/admin.py                  |  6 -----
 .../migrations/0019_auto_20200621_1558.py     | 25 +++++++++++++++++++
 src/authentic2/saml/models.py                 |  3 ---
 3 files changed, 25 insertions(+), 9 deletions(-)
 create mode 100644 src/authentic2/saml/migrations/0019_auto_20200621_1558.py
src/authentic2/saml/admin.py
75 75

  
76 76
class LibertyProviderForm(ModelForm):
77 77
    metadata = forms.CharField(required=True, widget=TextAndFileWidget, label=_('Metadata'))
78
    public_key = forms.CharField(required=False, widget=TextAndFileWidget, label=_('Public key'))
79
    ssl_certificate = forms.CharField(required=False, widget=TextAndFileWidget, label=_('SSL certificate'))
80
    ca_cert_chain = forms.CharField(required=False, widget=TextAndFileWidget, label=_('Certificate chain'))
81 78

  
82 79
    class Meta:
83 80
        model = LibertyProvider
......
90 87
            'federation_source',
91 88
            'metadata_url',
92 89
            'metadata',
93
            'public_key',
94
            'ssl_certificate',
95
            'ca_cert_chain',
96 90
        ]
97 91

  
98 92

  
src/authentic2/saml/migrations/0019_auto_20200621_1558.py
1
# Generated by Django 2.2.13 on 2020-06-21 13:58
2

  
3
from django.db import migrations
4

  
5

  
6
class Migration(migrations.Migration):
7

  
8
    dependencies = [
9
        ('saml', '0018_truncate_saml_keyvalue'),
10
    ]
11

  
12
    operations = [
13
        migrations.RemoveField(
14
            model_name='libertyprovider',
15
            name='ca_cert_chain',
16
        ),
17
        migrations.RemoveField(
18
            model_name='libertyprovider',
19
            name='public_key',
20
        ),
21
        migrations.RemoveField(
22
            model_name='libertyprovider',
23
            name='ssl_certificate',
24
        ),
25
    ]
src/authentic2/saml/models.py
374 374
        verbose_name=_('Protocol conformance'))
375 375
    metadata = models.TextField(validators=[metadata_validator])
376 376
    # All following field must be PEM formatted textual data
377
    public_key = models.TextField(blank=True)
378
    ssl_certificate = models.TextField(blank=True)
379
    ca_cert_chain = models.TextField(blank=True)
380 377
    federation_source = models.CharField(
381 378
        max_length=64,
382 379
        blank=True,
383
-