Projet

Général

Profil

0001-Remove-CAS-service-s-URLs-length-limit.patch

Paul Marillonnet, 31 mars 2020 10:53

Télécharger (4,14 ko)

Voir les différences:

Subject: [PATCH] Remove CAS service's URLs length limit

 src/authentic2_idp_cas/migrations/0001_initial.py |  2 +-
 src/authentic2_idp_cas/models.py                  |  4 ++--
 tests/{test_cas.py => test_idp_cas.py}            | 14 +++++++++++++-
 3 files changed, 16 insertions(+), 4 deletions(-)
 rename tests/{test_cas.py => test_idp_cas.py} (97%)
src/authentic2_idp_cas/migrations/0001_initial.py
35 35
                ('logout_use_iframe_timeout', models.PositiveIntegerField(default=300, help_text="if iframe logout is used, it's the time between the onload event for this iframe and the moment we consider its loading to be really finished", verbose_name='iframe logout timeout (ms)')),
36 36
                ('name', models.CharField(unique=True, max_length=128, verbose_name='name')),
37 37
                ('slug', models.SlugField(unique=True, max_length=128, verbose_name='slug')),
38
                ('urls', models.TextField(max_length=128, verbose_name='urls')),
38
                ('urls', models.TextField(verbose_name='urls')),
39 39
                ('identifier_attribute', models.CharField(max_length=64, verbose_name='attribute name')),
40 40
                ('proxy', models.ManyToManyField(help_text='services who can request proxy tickets for this service', related_name='proxy_rel_+', verbose_name='proxy', to='authentic2_idp_cas.Service')),
41 41
            ],
src/authentic2_idp_cas/models.py
1 1
# authentic2 - versatile identity manager
2
# Copyright (C) 2010-2019 Entr'ouvert
2
# Copyright (C) 2010-2020 Entr'ouvert
3 3
#
4 4
# This program is free software: you can redistribute it and/or modify it
5 5
# under the terms of the GNU Affero General Public License as published
......
31 31

  
32 32
@six.python_2_unicode_compatible
33 33
class Service(LogoutUrlAbstract, Service):
34
    urls = models.TextField(max_length=128, verbose_name=_('urls'))
34
    urls = models.TextField(verbose_name=_('urls'))
35 35
    identifier_attribute = models.CharField(max_length=64, verbose_name=_('attribute name'), blank=False)
36 36
    proxy = models.ManyToManyField(
37 37
        'self',
tests/test_cas.py → tests/test_idp_cas.py
1 1
# authentic2 - versatile identity manager
2
# Copyright (C) 2010-2019 Entr'ouvert
2
# Copyright (C) 2010-2020 Entr'ouvert
3 3
#
4 4
# This program is free software: you can redistribute it and/or modify it
5 5
# under the terms of the GNU Affero General Public License as published
......
74 74
        self.authorized_service = Role.objects.create(name='rogue', ou=get_default_ou())
75 75
        self.factory = RequestFactory()
76 76

  
77
    def test_long_urls(self):
78
        self.service.urls = 'https://casclient.com/%C3%A9/'\
79
            'lorem/ipsum/dolor/sit/amet/consectetur/adipiscing/elit/sed/do/'\
80
            'eiusmod/tempor/incididunt/ut/labore/et/dolore/magna/aliqua/ut/'\
81
            'enim/ad/minim/veniam/quis/nostrud/exercitation/ullamco/laboris/'\
82
            'nisi/ut/aliquip/ex/ea/commodo/consequat/duis/aute/irure/dolor/'\
83
            'in/reprehenderit/in/voluptate/velit/esse/cillum/dolore/eu/'\
84
            'fugiat/nulla/pariatur/excepteur/sint/occaecat/cupidatat/non/'\
85
            'proident/sunt/in/culpa/qui/officia/deserunt/mollit/anim/id/est/'\
86
            'laborum'
87
        self.service.save()
88

  
77 89
    def test_service_matching(self):
78 90
        self.service.clean()
79 91
        self.service2.clean()
80
-