Projet

Général

Profil

0001-python-add-a-classmethod-for-lasso.profileGetIssuer-.patch

Frédéric Péters, 27 juin 2018 19:31

Télécharger (1,63 ko)

Voir les différences:

Subject: [PATCH] python: add a classmethod for lasso.profileGetIssuer (#24832)

 FAQ.rst                 | 6 +++---
 bindings/python/lang.py | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)
FAQ.rst
243 243
     import lasso
244 244

  
245 245
     msg = request.POST['SAMLRequest']
246
     provider_id = lasso.profileGetIssuer(msg)
246
     provider_id = lasso.Profile.getIssuer(msg)
247 247

  
248 248
     # GET case
249 249
     msg = request.META['QUERY_STRING']
250
     provider_id = lasso.profileGetIssuer(msg)
250
     provider_id = lasso.Profile.getIssuer(msg)
251 251

  
252 252
     # SOAP case
253 253
     msg = request.read()
254
     provider_id = lasso.profileGetIssuer(msg)
254
     provider_id = lasso.Profile.getIssuer(msg)
255 255

  
256 256
The python example is pseudo-code. It assumes there is a request object whom
257 257
you can retrieve a POST parameters, the query string or the POST body.
bindings/python/lang.py
258 258
    def generate_footer(self, fd):
259 259
        print_('''
260 260

  
261
def _profileGetIssuer(cls, *args, **kwargs):
262
    return profileGetIssuer(*args, **kwargs)
263

  
264
Profile.getIssuer = classmethod(_profileGetIssuer)
265

  
261 266
import lasso
262 267

  
263 268
# backward compatibility with the SWIG binding
264
-