Projet

Général

Profil

0001-misc-allow-unicode-strings-as-authn-classref-10666.patch

Frédéric Péters, 15 avril 2016 10:28

Télécharger (1,74 ko)

Voir les différences:

Subject: [PATCH] misc: allow unicode strings as authn classref (#10666)

 mellon/views.py     | 1 +
 tests/test_views.py | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
mellon/views.py
338 338
            # configure requested AuthnClassRef
339 339
            authn_classref = utils.get_setting(idp, 'AUTHN_CLASSREF')
340 340
            if authn_classref:
341
                authn_classref = tuple([str(x) for x in authn_classref])
341 342
                req_authncontext = lasso.Samlp2RequestedAuthnContext()
342 343
                authn_request.requestedAuthnContext = req_authncontext
343 344
                req_authncontext.authnContextClassRef = tuple(authn_classref)
tests/test_views.py
198 198
def test_sp_initiated_login_requested_authn_context(private_settings, client):
199 199
    private_settings.MELLON_IDENTITY_PROVIDERS = [{
200 200
        'METADATA': open('tests/metadata.xml').read(),
201
        'AUTHN_CLASSREF': ['urn:be:fedict:iam:fas:citizen:eid',
202
                           'urn:be:fedict:iam:fas:citizen:token'],
201
        'AUTHN_CLASSREF': [u'urn:be:fedict:iam:fas:citizen:eid',
202
                           u'urn:be:fedict:iam:fas:citizen:token'],
203 203
    }]
204 204
    response = client.get('/login/')
205 205
    assert response.status_code == 302
206
-