summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2018-06-27 17:29:40 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2018-06-28 06:55:59 (GMT)
commiteb6e0e23b4f984d77c014d45a375b3474ced34e2 (patch)
tree41521b1b3727b086e0d13f89b2231b5370229122
parent591acb5170571c23e9998cfce3b225d6c0a0c435 (diff)
downloadlasso-eb6e0e23b4f984d77c014d45a375b3474ced34e2.zip
lasso-eb6e0e23b4f984d77c014d45a375b3474ced34e2.tar.gz
lasso-eb6e0e23b4f984d77c014d45a375b3474ced34e2.tar.bz2
python: add a classmethod for lasso.profileGetIssuer (#24831)
-rw-r--r--FAQ.rst6
-rw-r--r--bindings/python/lang.py5
2 files changed, 8 insertions, 3 deletions
diff --git a/FAQ.rst b/FAQ.rst
index 1236145..97d1f34 100644
--- a/FAQ.rst
+++ b/FAQ.rst
@@ -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.
diff --git a/bindings/python/lang.py b/bindings/python/lang.py
index 4ef79ea..22b7d02 100644
--- a/bindings/python/lang.py
+++ b/bindings/python/lang.py
@@ -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