diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-27 22:32:59 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-27 22:32:59 +0000 |
| commit | 8425480fb7bf6906c970a75c13826da480ae46e1 (patch) | |
| tree | cac8afcc8f07c39e276084741e8333052eb0130b | |
| parent | 0791ef056f421368f4a8079d17ccf96cbbfbd8d5 (diff) | |
| download | lasso-8425480fb7bf6906c970a75c13826da480ae46e1.tar.gz lasso-8425480fb7bf6906c970a75c13826da480ae46e1.tar.xz lasso-8425480fb7bf6906c970a75c13826da480ae46e1.zip | |
Transformed LassoAuthnRequest as a true SWIG class with attributes and
methods for all bindings.
| -rw-r--r-- | python/lasso.py | 39 | ||||
| -rw-r--r-- | python/tests/login_tests.py | 4 | ||||
| -rw-r--r-- | swig/Lasso.i | 153 |
3 files changed, 129 insertions, 67 deletions
diff --git a/python/lasso.py b/python/lasso.py index 1fcb26a4..c4987f40 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -221,45 +221,6 @@ class AuthnRequest(_ObjectMixin, lassomod.LassoAuthnRequest): lassomodClass = lassomod.LassoAuthnRequest - # Attributes - - def set_affiliationID(self, affiliationID): - lassomod.lasso_lib_authn_request_set_affiliationID(self.parent, affiliationID) - affiliationID = property(None, set_affiliationID) - - def set_assertionConsumerServiceID(self, assertionConsumerServiceID): - lassomod.lasso_lib_authn_request_set_assertionConsumerServiceID( - self.parent, assertionConsumerServiceID) - assertionConsumerServiceID = property(None, set_assertionConsumerServiceID) - - def set_consent(self, consent): - lassomod.lasso_lib_authn_request_set_consent(self.parent, consent) - consent = property(None, set_consent) - - def set_forceAuthn(self, forceAuthn): - lassomod.lasso_lib_authn_request_set_forceAuthn(self.parent, forceAuthn) - forceAuthn = property(None, set_forceAuthn) - - def set_isPassive(self, isPassive): - lassomod.lasso_lib_authn_request_set_isPassive(self.parent, isPassive) - isPassive = property(None, set_isPassive) - - def set_nameIDPolicy(self, nameIDPolicy): - lassomod.lasso_lib_authn_request_set_nameIDPolicy(self.parent, nameIDPolicy) - nameIDPolicy = property(None, set_nameIDPolicy) - - def set_protocolProfile(self, protocolProfile): - lassomod.lasso_lib_authn_request_set_protocolProfile(self.parent, protocolProfile) - protocolProfile = property(None, set_protocolProfile) - - def set_providerID(self, providerID): - lassomod.lasso_lib_authn_request_set_providerID(self.parent, providerID) - providerID = property(None, set_providerID) - - def set_relayState(self, relayState): - lassomod.lasso_lib_authn_request_set_relayState(self.parent, relayState) - relayState = property(None, set_relayState) - registerClass(AuthnRequest) diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py index 614ea4cc..a7ac8cd2 100644 --- a/python/tests/login_tests.py +++ b/python/tests/login_tests.py @@ -60,12 +60,12 @@ class LoginTestCase(unittest.TestCase): login.init_authn_request(lasso.httpMethodRedirect) self.failUnlessEqual(login.request_type, lasso.messageTypeAuthnRequest) login.authn_request - login.authn_request.set_protocolProfile(lasso.libProtocolProfileBrwsArt) + login.authn_request.protocolProfile = lasso.libProtocolProfileBrwsArt class LogoutTestCase(unittest.TestCase): def test01(self): - """SP logout without session and indentity; testing init_request.""" + """SP logout without session and identity; testing init_request.""" lassoServer = lasso.Server( os.path.join(dataDir, 'sp1-la/metadata.xml'), diff --git a/swig/Lasso.i b/swig/Lasso.i index 4c084c85..26bd5119 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -336,8 +336,103 @@ typedef struct _LassoLibAuthnResponse { %nodefault _LassoAuthnRequest; typedef struct _LassoAuthnRequest { LassoLibAuthnRequest parent; + + %extend { + /* Attributes inherited from LassoLibAuthnRequest */ + + xmlChar *affiliationID; + xmlChar *assertionConsumerServiceID; + xmlChar *consent; + gboolean forceAuthn; + gboolean isPassive; + xmlChar *nameIDPolicy; + xmlChar *protocolProfile; + xmlChar *providerID; + xmlChar *relayState; + } } LassoAuthnRequest; +/* Attributes Implementations */ + +%{ + +/* affiliationID */ +xmlChar *LassoAuthnRequest_affiliationID_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_affiliationID_set(LassoAuthnRequest *self, xmlChar *affiliationID) { + lasso_lib_authn_request_set_affiliationID(LASSO_LIB_AUTHN_REQUEST(self), affiliationID); +} + +/* assertionConsumerServiceID */ +xmlChar *LassoAuthnRequest_assertionConsumerServiceID_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_assertionConsumerServiceID_set(LassoAuthnRequest *self, + xmlChar *assertionConsumerServiceID) { + lasso_lib_authn_request_set_assertionConsumerServiceID(LASSO_LIB_AUTHN_REQUEST(self), + assertionConsumerServiceID); +} + +/* consent */ +xmlChar *LassoAuthnRequest_consent_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_consent_set(LassoAuthnRequest *self, xmlChar *consent) { + lasso_lib_authn_request_set_consent(LASSO_LIB_AUTHN_REQUEST(self), consent); +} + +/* forceAuthn */ +gboolean LassoAuthnRequest_forceAuthn_get(LassoAuthnRequest *self) { + return 0; /* FIXME */ +} +void LassoAuthnRequest_forceAuthn_set(LassoAuthnRequest *self, gboolean forceAuthn) { + lasso_lib_authn_request_set_forceAuthn(LASSO_LIB_AUTHN_REQUEST(self), forceAuthn); +} + +/* isPassive */ +gboolean LassoAuthnRequest_isPassive_get(LassoAuthnRequest *self) { + return 0; /* FIXME */ +} +void LassoAuthnRequest_isPassive_set(LassoAuthnRequest *self, gboolean isPassive) { + lasso_lib_authn_request_set_isPassive(LASSO_LIB_AUTHN_REQUEST(self), isPassive); +} + +/* nameIDPolicy */ +xmlChar *LassoAuthnRequest_nameIDPolicy_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_nameIDPolicy_set(LassoAuthnRequest *self, xmlChar *nameIDPolicy) { + lasso_lib_authn_request_set_nameIDPolicy(LASSO_LIB_AUTHN_REQUEST(self), nameIDPolicy); +} + +/* protocolProfile */ +xmlChar *LassoAuthnRequest_protocolProfile_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_protocolProfile_set(LassoAuthnRequest *self, xmlChar *protocolProfile) { + lasso_lib_authn_request_set_protocolProfile(LASSO_LIB_AUTHN_REQUEST(self), + protocolProfile); +} + +/* providerID */ +xmlChar *LassoAuthnRequest_providerID_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_providerID_set(LassoAuthnRequest *self, xmlChar *providerID) { + lasso_lib_authn_request_set_providerID(LASSO_LIB_AUTHN_REQUEST(self), providerID); +} + +/* relayState */ +xmlChar *LassoAuthnRequest_relayState_get(LassoAuthnRequest *self) { + return NULL; /* FIXME */ +} +void LassoAuthnRequest_relayState_set(LassoAuthnRequest *self, xmlChar *relayState) { + lasso_lib_authn_request_set_relayState(LASSO_LIB_AUTHN_REQUEST(self), relayState); +} + +%} + /*********************************************************************** * AuthnResponse @@ -554,36 +649,42 @@ typedef struct _LassoProfile { } } LassoProfile; -/* Implementations */ +/* Attributes Implementations */ %{ - LassoAuthnRequestPtr LassoProfile_authn_request_get(LassoProfile *profile) { - if (profile->request_type == lassoMessageTypeAuthnRequest) - return LASSO_AUTHN_REQUEST(profile->request); - else - return NULL; - } - LassoAuthnResponsePtr LassoProfile_authn_response_get(LassoProfile *profile) { - if (profile->response_type == lassoMessageTypeAuthnResponse) - return LASSO_AUTHN_RESPONSE(profile->response); - else - return NULL; - } +/* authn_request */ +LassoAuthnRequestPtr LassoProfile_authn_request_get(LassoProfile *profile) { + if (profile->request_type == lassoMessageTypeAuthnRequest) + return LASSO_AUTHN_REQUEST(profile->request); + else + return NULL; +} + +/* authn_response */ +LassoAuthnResponsePtr LassoProfile_authn_response_get(LassoProfile *profile) { + if (profile->response_type == lassoMessageTypeAuthnResponse) + return LASSO_AUTHN_RESPONSE(profile->response); + else + return NULL; +} + +/* request */ +LassoRequestPtr LassoProfile_request_get(LassoProfile *profile) { + if (profile->request_type == lassoMessageTypeRequest) + return LASSO_REQUEST(profile->request); + else + return NULL; +} + +/* response */ +LassoResponsePtr LassoProfile_response_get(LassoProfile *profile) { + if (profile->response_type == lassoMessageTypeResponse) + return LASSO_RESPONSE(profile->response); + else + return NULL; +} - LassoRequestPtr LassoProfile_request_get(LassoProfile *profile) { - if (profile->request_type == lassoMessageTypeRequest) - return LASSO_REQUEST(profile->request); - else - return NULL; - } - - LassoResponsePtr LassoProfile_response_get(LassoProfile *profile) { - if (profile->response_type == lassoMessageTypeResponse) - return LASSO_RESPONSE(profile->response); - else - return NULL; - } %} /* Methods */ |
