diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-27 13:29:07 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-27 13:29:07 +0000 |
| commit | 3ed5fa5681451b2407e316f01f22225f9d758e6d (patch) | |
| tree | ffac2af2a00dd7b51e59abda0e2036d9130350e9 /python | |
| parent | 325f18984a0d4bc2b8b9c2067af901f9d542dedc (diff) | |
| download | lasso-3ed5fa5681451b2407e316f01f22225f9d758e6d.tar.gz lasso-3ed5fa5681451b2407e316f01f22225f9d758e6d.tar.xz lasso-3ed5fa5681451b2407e316f01f22225f9d758e6d.zip | |
Replaced SWIG specific functions to access "request" and "response"
attributes of profiles, with SWIG read-only attributes.
Diffstat (limited to 'python')
| -rw-r--r-- | python/lasso.py | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/python/lasso.py b/python/lasso.py index 2ce9f9d6..cd03230a 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -354,6 +354,20 @@ class _ProfileChild(object): # Attributes + def get_authn_request(self): + authn_request = self.parent.authn_request + if authn_request is not None: + _setRegisteredClass(authn_request) + return authn_request + authn_request = property(get_authn_request) + + def get_authn_response(self): + authn_response = self.parent.authn_response + if authn_response is not None: + _setRegisteredClass(authn_response) + return authn_response + authn_response = property(get_authn_response) + def get_identity(self): identity = lassomod.lasso_profile_get_identity(self.parent) if identity is not None: @@ -390,12 +404,13 @@ class _ProfileChild(object): def get_request(self): request_type = self.request_type if request_type == messageTypeAuthnRequest: - request = lassomod.lasso_profile_get_authn_request_ref(self.parent) + request = self.parent.authn_request elif request_type == messageTypeRequest: - request = lassomod.lasso_profile_get_request_ref(self.parent) + request = self.parent.request else: - raise ErrorUnknownRequestType('lasso_profile_get_???_request', request_type) - _setRegisteredClass(request) + raise ErrorUnknownRequestType('lasso_profile_get_request', request_type) + if request is not None: + _setRegisteredClass(request) return request request = property(get_request) @@ -406,12 +421,13 @@ class _ProfileChild(object): def get_response(self): response_type = self.response_type if response_type == messageTypeAuthnResponse: - response = lassomod.lasso_profile_get_authn_response_ref(self.parent) + response = self.parent.authn_response elif response_type == messageTypeResponse: - response = lassomod.lasso_profile_get_response_ref(self.parent) + response = self.parent.response else: - raise ErrorUnknownResponseType('lasso_profile_get_???_response', response_type) - _setRegisteredClass(response) + raise ErrorUnknownResponseType('lasso_profile_get_response', response_type) + if response is not None: + _setRegisteredClass(response) return response response = property(get_response) |
