python: add a classmethod for lasso.profileGetIssuer (#24831)

This commit is contained in:
Frédéric Péters 2018-06-27 19:29:40 +02:00
parent 591acb5170
commit eb6e0e23b4
2 changed files with 8 additions and 3 deletions

View File

@ -243,15 +243,15 @@ the message is sent using the SOAP, HTTP-POST or HTTP-Redirect bindings.
import lasso
msg = request.POST['SAMLRequest']
provider_id = lasso.profileGetIssuer(msg)
provider_id = lasso.Profile.getIssuer(msg)
# GET case
msg = request.META['QUERY_STRING']
provider_id = lasso.profileGetIssuer(msg)
provider_id = lasso.Profile.getIssuer(msg)
# SOAP case
msg = request.read()
provider_id = lasso.profileGetIssuer(msg)
provider_id = lasso.Profile.getIssuer(msg)
The python example is pseudo-code. It assumes there is a request object whom
you can retrieve a POST parameters, the query string or the POST body.

View File

@ -258,6 +258,11 @@ class %sError(%sError):
def generate_footer(self, fd):
print_('''
def _profileGetIssuer(cls, *args, **kwargs):
return profileGetIssuer(*args, **kwargs)
Profile.getIssuer = classmethod(_profileGetIssuer)
import lasso
# backward compatibility with the SWIG binding