diff options
author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-19 22:36:50 +0000 |
---|---|---|
committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-19 22:36:50 +0000 |
commit | 74509f54ebda964e14a90fcbb29b90fba1490787 (patch) | |
tree | 94c63c582076ae4e1739e2090aa912bd7e945940 | |
parent | 79aff14be4c75d5419bc3335dd74c01f5b9b4f94 (diff) | |
download | lasso-74509f54ebda964e14a90fcbb29b90fba1490787.tar.gz lasso-74509f54ebda964e14a90fcbb29b90fba1490787.tar.xz lasso-74509f54ebda964e14a90fcbb29b90fba1490787.zip |
Created a high-level API above SWIG Python API.
Removed a trailing "s" from an enum.
-rw-r--r-- | lasso/id-ff/login.h | 4 | ||||
-rw-r--r-- | python/lasso.py | 1579 | ||||
-rw-r--r-- | swig/Lasso.c | 38 | ||||
-rw-r--r-- | swig/Lasso.i | 348 |
4 files changed, 452 insertions, 1517 deletions
diff --git a/lasso/id-ff/login.h b/lasso/id-ff/login.h index 0700c3a5..c86ae3c2 100644 --- a/lasso/id-ff/login.h +++ b/lasso/id-ff/login.h @@ -52,12 +52,12 @@ typedef struct _LassoLoginPrivate LassoLoginPrivate; typedef enum { lassoLoginProtocolProfileBrwsArt = 1, lassoLoginProtocolProfileBrwsPost, -} lassoLoginProtocolProfiles; +} lassoLoginProtocolProfile; struct _LassoLogin { LassoProfile parent; /*< public >*/ - lassoLoginProtocolProfiles protocolProfile; + lassoLoginProtocolProfile protocolProfile; gchar *assertionArtifact; gchar *response_dump; diff --git a/python/lasso.py b/python/lasso.py index 77cd8d61..dda25e09 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -3,12 +3,12 @@ # # $Id$ # -# PyLasso - Python bindings for Lasso Library +# PyLasso - High-level Python bindings for Lasso Library # # Copyright (C) 2004 Entr'ouvert # http://lasso.entrouvert.org # -# Author: Valery Febvre <vfebvre@easter-eggs.com> +# Author: Emmanuel Raviart <eraviart@entrouvert.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,16 +24,33 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + __docformat__ = "plaintext en" + import lassomod -from lasso_strings import * -_initialized = False + +################################################################################ +# Constants +################################################################################ + + +# Copy constants from lassomod as is, except that the 'lasso' prefix is removed +# and the first letter is lowered. +_globals = globals() +for constantName, constantValue in lassomod.__dict__.iteritems(): + if constantName.startswith('lassoHttpMethod') \ + or constantName.startswith('lassoLoginProtocolProfile') \ + or constantName.startswith('lassoMessageType') \ + or constantName.startswith('lassoProviderType') \ + or constantName.startswith('lassoRequestType') \ + or constantName.startswith('lassoSignatureMethod'): + _globals[constantName[5].lower() + constantName[6:]] = constantValue ################################################################################ -# Lasso Errors +# Errors ################################################################################ @@ -73,6 +90,32 @@ class ErrorInstanceCreationFailed(Error): def __str__(self): return 'Instance creation failed in Lasso function %s()' % self.functionName + +class ErrorUnknownRequestType(Error): + code = 4 + requestType = None + + def __init__(self, functionName, requestType): + super(ErrorUnknownRequestType, self).__init__(functionName) + self.requestType = requestType + + def __str__(self): + return 'Unknown request type (= %s) in Lasso function %s()' % ( + self.requestType, self.functionName) + + +class ErrorUnknownResponseType(Error): + code = 5 + responseType = None + + def __init__(self, functionName, responseType): + super(ErrorUnknownResponseType, self).__init__(functionName) + self.responseType = responseType + + def __str__(self): + return 'Unknown response type (= %s) in Lasso function %s()' % ( + self.responseType, self.functionName) + def newError(code, functionName): # FIXME: Use proper ErrorClass, when Lasso will have well defined error codes. @@ -80,1446 +123,406 @@ def newError(code, functionName): ################################################################################ -# Initialization +# Common ################################################################################ -def init(): - """ - Init Lasso Library. - """ - global _initialized - if _initialized: - raise ErrorLassoAlreadyInitialized() - _initialized = True - return lassomod.init() +class _ObjectMixin(object): + """Abstract mixin class""" + def __init__(self, *arguments, **keywordArguments): + # Don't execute SWIG __init__ method, because object has already be inited in constructor. + pass -def shutdown(): - """ - Shutdown Lasso Library. - """ - global _initialized - if not _initialized: - raise ErrorLassoNotInitialized() - _initialized = False - return lassomod.shutdown() + def __repr__(self): + return '<Lasso %s instance wrapping %s>' % (self.__class__.__name__, self.this) + + def swig_init(self): + # Call SWIG __init__. + super(_ObjectMixin, self).__init__() ################################################################################ -# xml: low level classes +# Protocols ################################################################################ -# Export types -NodeExportTypeXml = 1 -NodeExportTypeBase64 = 2 -NodeExportTypeQuery = 3 -NodeExportTypeSoap = 4 - -class Node: - """\brief The base class of the Lasso hierarchy. - - Node is the base class for all Lasso classes. - """ - - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - - def destroy(self): - """ - Destroys the node. - """ - lassomod.node_destroy(self) - - def dump(self, encoding="utf8", format=0): - """ - Dumps the node. All datas in object are dumped in an XML format. - - \param encoding the name of the encoding to use or None. - \param format is formatting allowed? - \return an XML dump of the node - """ - return lassomod.node_dump(self, encoding, format) - - def export(self): - """ - Exports the node. - - \return an XML dump of the node (UTF-8 encoded) - """ - return lassomod.node_export(self) - - def export_to_base64(self): - """ - Like export() method except that result is Base64 encoded. - - \return a Base64 encoded export of the node - """ - return lassomod.node_export_to_base64(self) - - def export_to_query(self, sign_method=0, private_key_file=None): - """ - URL-encodes and signes the node. - If private_key_file is None, query won't be signed. - - \param sign_method the Signature transform method - \param private_key_file a private key - \return a query - """ - return lassomod.node_export_to_query(self, sign_method, private_key_file) - - def export_to_soap(self): - """ - Like export() method except that result is SOAP enveloped. - - \return a SOAP enveloped export of the node - """ - return lassomod.node_export_to_soap(self) - - def get_attr_value(self, name): - """ - Gets the value of an attribute associated to node. - - \param name an attribut name - \return the attribut value or None if not found. - """ - return lassomod.node_get_attr_value(self, name) - - def get_child(self, name, href=None): - """ - Gets child of node having given \a name and namespace \a href. - - \param name the child name - \param href the namespace - \return a child node - """ - obj = lassomod.node_get_child(self, name, href) - if obj: - return Node(_obj=obj) - return None - - def get_content(self): - """ - Read the value of node, this can be either the text carried directly by - this node if it's a TEXT node or the aggregate string of the values carried - by this node child's (TEXT and ENTITY_REF). Entity references are - substituted. - - \return a string or None if no content is available. - """ - return lassomod.node_get_content(self) - - def verify_signature(self, certificate_file): - """ - Verify the node signature. - - \param certificate_file a certificate - \return 1 if signature is valid, 0 if invalid. -1 if an error occurs. - """ - return lassomod.node_verify_signature(self, certificate_file) - - -class SamlAssertion(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.saml_assertion_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_saml_assertion_new') - Node.__init__(self, _obj=_obj) - - def add_authenticationStatement(self, authenticationStatement): - """ - bla bla - """ - lassomod.saml_assertion_add_authenticationStatement(self, - authenticationStatement) - - def set_signature(self, sign_method, private_key_file, certificate_file): - lassomod.saml_assertion_set_signature(self, sign_method, - private_key_file, certificate_file) - - -class SamlAuthenticationStatement(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.saml_authentication_statement_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_saml_authentication_statement_new') - Node.__init__(self, _obj=_obj) - - -class SamlNameIdentifier(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.saml_name_identifier_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_saml_name_identifier_new') - Node.__init__(self, _obj=_obj) - - def set_format(self, format): - lassomod.saml_name_identifier_set_format(self, format) - - def set_nameQualifier(self, nameQualifier): - lassomod.saml_name_identifier_set_nameQualifier(self, nameQualifier) - - -class SamlpResponse(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.samlp_response_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_samlp_response_new') - Node.__init__(self, _obj=_obj) - - def add_assertion(self, assertion): - lassomod.samlp_response_add_assertion(self, assertion) - - -class LibAuthenticationStatement(SamlAuthenticationStatement): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_authentication_statement_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_saml_authentication_statement_new') - SamlAuthenticationStatement.__init__(self, _obj=_obj) - def set_sessionIndex(self, sessionIndex): - lassomod.lib_authentication_statement_set_sessionIndex(self, sessionIndex) - - -class LibAuthnRequest(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_authn_request_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_authn_request_new') - Node.__init__(self, _obj=_obj) - +class AuthnRequest(_ObjectMixin, 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.lib_authn_request_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.lib_authn_request_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.lib_authn_request_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.lib_authn_request_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.lib_authn_request_set_protocolProfile(self, protocolProfile) - - def set_relayState(self, relayState): - lassomod.lib_authn_request_set_relayState(self, relayState) - - -class LibAuthnResponse(SamlpResponse): - """\brief Blabla - - Bla bla - """ - - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_authn_response_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_authn_response_new') - SamlpResponse.__init__(self, _obj=_obj) - - -class LibFederationTerminationNotification(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_federation_termination_notification_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_federation_termination_notification_new') - Node.__init__(self, _obj=_obj) - - def set_consent(self, consent): - lassomod.lib_federation_termination_notification_set_consent(self, consent) - - -class LibLogoutRequest(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_logout_request_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_logout_request_new') - Node.__init__(self, _obj=_obj) - - def set_consent(self, consent): - lassomod.lib_logout_request_set_consent(self, consent) - - def set_nameIdentifier(self, nameIdentifier): - lassomod.lib_logout_request_set_nameIdentifier(self, nameIdentifier) + lassomod.lasso_lib_authn_request_set_protocolProfile(self.parent, protocolProfile) + protocolProfile = property(None, set_protocolProfile) def set_providerID(self, providerID): - lassomod.lib_logout_request_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.lib_logout_request_set_relayState(self, relayState) - - def set_sessionIndex(self, sessionIndex): - lassomod.lib_logout_request_set_sessionIndex(self, sessionIndex) - - -class LibLogoutResponse(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj = None): - if _obj!=None: - self._o = _obj - return - - _obj = lassomod.lib_logout_response_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_logout_response_new') - Node.__init__(self, _obj = _obj) - - -class LibNameIdentifierMappingRequest(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_name_identifier_mapping_request_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_name_identifier_mapping_request_new') - Node.__init__(self, _obj=_obj) + lassomod.lasso_lib_authn_request_set_relayState(self.parent, relayState) + relayState = property(None, set_relayState) - def set_consent(self, consent): - lassomod.lib_name_identifier_mapping_request_set_consent(self, consent) - - -class LibNameIdentifierMappingResponse(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj = None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_name_identifier_mapping_response_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_name_identifier_mapping_response_new') - Node.__init__(self, _obj=_obj) - - -class LibRegisterNameIdentifierRequest(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_register_name_identifier_request_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_register_name_identifier_request_new') - Node.__init__(self, _obj=_obj) - - -class LibRegisterNameIdentifierResponse(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj = None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.lib_register_name_identifier_response_new() - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_lib_register_name_identifier_response_new') - Node.__init__(self, _obj=_obj) - -################################################################################ -# protocols: middle level classes -################################################################################ - - -def authn_request_get_protocolProfile(query): - return lassomod.authn_request_get_protocolProfile(query) - - -class AuthnRequest(LibAuthnRequest): - """\brief Blabla - - Bla bla - """ - def __init__(self, providerID, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.authn_request_new(providerID) - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_authn_request_new') - LibAuthnRequest.__init__(self, _obj=_obj) - - def set_requestAuthnContext(self, authnContextClassRefs=None, - authnContextStatementRefs=None, - authnContextComparison=None): - lassomod.authn_request_set_requestAuthnContext(self, - authnContextClassRefs, - authnContextStatementRefs, - authnContextComparison) - - def set_scoping(self, proxyCount): - lassomod.authn_request_set_scoping(self, proxyCount) - - -class AuthnResponse(SamlpResponse): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - SamlpResponse.__init__(self, _obj=_obj) - - def new_from_export(cls, buffer, type=0): - obj = lassomod.authn_response_new_from_export(buffer, type) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_authn_response_new_from_export') - return AuthnResponse(obj) - new_from_export = classmethod(new_from_export) - - -class FederationTerminationNotification(LibFederationTerminationNotification): - """\brief Blabla - - Bla bla - """ - def __init__(self, obj): - """ - The constructor - """ - self._o = obj - LibFederationTerminationNotification.__init__(self, _obj=self._o) - - def new(cls, providerID, nameIdentifier, nameQualifier, format): - obj = lassomod.federation_termination_notification_new( - providerID, nameIdentifier, nameQualifier, format) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_federation_termination_notification_new') - return FederationTerminationNotification(obj) - new = classmethod(new) - - def new_from_export(cls, buffer, export_type = 0): - obj = lassomod.federation_termination_notification_new_from_export(buffer, export_type) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_federation_termination_notification_new_from_export') - return LogoutRequest(obj) - new_from_export = classmethod(new_from_export) - -class LogoutRequest(LibLogoutRequest): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - LibLogoutRequest.__init__(self, _obj = self._o) - - def new(cls, providerID, nameIdentifier, nameQualifier, format): - obj = lassomod.logout_request_new(providerID, nameIdentifier, nameQualifier, format) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_logout_request_new') - return LogoutRequest(obj) - new = classmethod(new) - - def new_from_export(cls, buffer, export_type = 0): - obj = lassomod.logout_request_new_from_export(buffer, export_type) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_logout_request_new_from_export') - return LogoutRequest(obj) - new_from_export = classmethod(new_from_export) - - -class LogoutResponse(LibLogoutResponse): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - LibLogoutResponse.__init__(self, _obj = self._o) - - def new_from_export(cls, buffer, export_type = 0): - obj = lassomod.logout_response_new_from_export(buffer, export_type) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_logout_response_new_from_export') - return LogoutResponse(obj) - new_from_export = classmethod(new_from_export) - - def new_from_request_export(cls, buffer, export_type, providerID, statusCodeValue): - obj = lassomod.logout_response_new_from_request_export( - buffer, export_type, providerID, statusCodeValue) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_logout_response_new_from_request_export') - return LogoutResponse(obj) - new_from_export = classmethod(new_from_request_export) - - -class NameIdentifierMappingRequest(LibNameIdentifierMappingRequest): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - LibNameIdentifierMappingRequest.__init__(self, _obj = self._o) - - def new(cls, providerID, nameIdentifier, nameQualifier, format): - obj = lassomod.name_identifier_mapping_request_new( - providerID, nameIdentifier, nameQualifier, format) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_name_identifier_mapping_request_new') - return NameIdentifierMappingRequest(obj) - new = classmethod(new) - - def new_from_soap(cls, envelope): - obj = lassomod.name_identifier_mapping_request_new_from_soap(envelope) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_request_new_from_soap') - return NameIdentifierMappingRequest(obj) - new_from_soap = classmethod(new_from_soap) - - def new_from_query(cls, query): - obj = lassomod.name_identifier_mapping_request_new_from_query(query) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_request_new_from_query') - return NameIdentifierMappingRequest(obj) - new_from_query = classmethod(new_from_query) - - -class NameIdentifierMappingResponse(LibNameIdentifierMappingResponse): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - LibNameIdentifierMappingResponse.__init__(self, _obj = self._o) - - def new_from_dump(cls, dump): - obj = lassomod.name_identifier_mapping_response_new_from_dump(dump) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_response_new_from_dump') - return NameIdentifierMappingResponse(obj) - new_from_dump = classmethod(new_from_dump) - - def new_from_query(cls, query): - obj = lassomod.name_identifier_mapping_response_new_from_query(query) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_response_new_from_query') - return NameIdentifierMappingResponse(obj); - new_from_query = classmethod(new_from_query) - - def new_from_request_query(cls, query, providerID, status_code_value): - obj = lassomod.name_identifier_mapping_response_new_from_request_query( - query, providerID, status_code_value) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_response_new_from_request_query') - return NameIdentifierMappingResponse(obj); - new_from_request_query = classmethod(new_from_request_query) - - def new_from_request_soap(cls, envelope, providerID, status_code_value): - obj = lassomod.name_identifier_mapping_response_new_from_request_soap( - envelope, providerID, status_code_value) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_response_new_from_request_soap') - return NameIdentifierMappingResponse(obj) - new_from_request_soap = classmethod(new_from_request_soap) - - def new_from_soap(cls, envelope): - obj = lassomod.name_identifier_mapping_response_new_from_soap(envelope) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_name_identifier_mapping_response_new_from_soap') - return NameIdentifierMappingResponse(obj) - new_from_soap = classmethod(new_from_soap) - - -class RegisterNameIdentifierRequest(LibRegisterNameIdentifierRequest): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - LibRegisterNameIdentifierRequest.__init__(self, _obj = self._o) - - def new(cls, providerID, idpNameIdentifier, idpNameQualifier, idpFormat, - spNameIdentifier, spNameQualifier, spFormat, - oldNameIdentifier, oldNameQualifier, oldFormat): - obj = lassomod.register_name_identifier_request_new( - providerID, idpNameIdentifier, idpNameQualifier, idpFormat, - spNameIdentifier, spNameQualifier, spFormat, - oldNameIdentifier, oldNameQualifier, oldFormat) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_register_name_identifier_request_new') - return RegisterNameIdentifierRequest(obj) - new = classmethod(new) - - def new_from_export(cls, buffer, export_type = 0): - obj = lassomod.register_name_identifier_request_new_from_export(buffer, export_type) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_register_name_identifier_request_new_from_export') - return RegisterNameIdentifierRequest(obj) - new_from_export = classmethod(new_from_export) - - def rename_attributes_for_encoded_query(self): - lassomod.register_name_identifier_request_rename_attributes_for_query(self) - - -class RegisterNameIdentifierResponse(LibRegisterNameIdentifierResponse): - """\brief Blabla - - Bla bla - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - LibRegisterNameIdentifierResponse.__init__(self, _obj = self._o) - - def new_from_export(cls, buffer, export_type = 0): - obj = lassomod.register_name_identifier_response_new_from_export(buffer, export_type) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_register_name_identifier_response_new_from_export') - return RegisterNameIdentifierResponse(obj) - new_from_export = classmethod(new_from_export) - - def new_from_request_export(cls, buffer, export_type, providerID, statusCodeValue): - obj = lassomod.register_name_identifier_response_new_from_request_export( - buffer, export_type, providerID, statusCodeValue) - if obj is None: - raise ErrorInstanceCreationFailed( - 'lasso_register_name_identifier_response_new_from_request_export') - return RegisterNameIdentifierResponse(obj) - new_from_export = classmethod(new_from_request_export) +class Request(_ObjectMixin, lassomod.LassoRequestPtr): + pass ################################################################################ -# elements +# Profiles ################################################################################ -class Assertion(SamlAssertion): - """\brief Blabla - - Bla bla - """ - def __init__(self, issuer, requestID, _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.assertion_new(issuer, requestID) - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_assertion_new') - SamlAssertion.__init__(self, _obj=_obj) - - -class AuthenticationStatement(Node): - """\brief Blabla - - Bla bla - """ - def __init__(self, - authenticationMethod, - reauthenticateOnOrAfter, - nameIdentifier, - nameQualifier, - format, - idp_nameIdentifier, - idp_nameQualifier, - idp_format, - _obj=None): - """ - The constructor - """ - if _obj != None: - self._o = _obj - return - _obj = lassomod.authentication_statement_new(authenticationMethod, - reauthenticateOnOrAfter, - nameIdentifier, - nameQualifier, - format, - idp_nameIdentifier, - idp_nameQualifier, - idp_format) - if _obj is None: - raise ErrorInstanceCreationFailed('lasso_authentication_statement_new') - Node.__init__(self, _obj=_obj) +get_request_type_from_soap_msg = lassomod.lasso_profile_get_request_type_from_soap_msg -################################################################################ -# environs: high level classes -################################################################################ - - -signatureMethodRsaSha1 = 1 -signatureMethodDsaSha1 = 2 - -httpMethodGet = 1 -httpMethodPost = 2 -httpMethodRedirect = 3 -httpMethodSoap = 4 - -messageTypeNone = 0 -messageTypeAuthnRequest = 1 -messageTypeAuthnResponse = 2 -messageTypeRequest = 3 -messageTypeResponse = 4 -messageTypeArtifact = 5 +class Server(_ObjectMixin, lassomod.LassoServer): + # Constructors - -class Server: - """\brief Short desc - - Long desc - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - - def new(cls, metadata=None, public_key=None, private_key=None, - certificate=None, signature_method=0): - obj = lassomod.server_new(metadata, public_key, private_key, - certificate, signature_method) - if obj is None: + def __new__(cls, metadata = None, public_key = None, private_key = None, certificate = None, + signature_method = signatureMethodRsaSha1): + self = lassomod.lasso_server_new( + metadata, public_key, private_key, certificate, signature_method) + if self is None: raise ErrorInstanceCreationFailed('lasso_server_new') - return Server(obj) - new = classmethod(new) + object.__setattr__(self, '__class__', cls) + return self def new_from_dump(cls, dump): - obj = lassomod.server_new_from_dump(dump) - if obj is None: + self = lassomod.lasso_server_new_from_dump(dump) + if self is None: raise ErrorInstanceCreationFailed('lasso_server_new_from_dump') - return Server(obj) + object.__setattr__(self, '__class__', cls) + return self new_from_dump = classmethod(new_from_dump) - def add_provider(self, metadata, public_key=None, certificate=None): - errorCode = lassomod.server_add_provider(self, metadata, public_key, certificate) + # Methods + + def add_provider(self, metadata, public_key = None, certificate = None): + errorCode = lassomod.lasso_server_add_provider(self, metadata, public_key, certificate) if errorCode: raise newError(errorCode, 'lasso_server_add_provider') def dump(self): - return lassomod.server_dump(self) - - def destroy(self): - lassomod.server_destroy(self) + return lassomod.lasso_server_dump(self) -class Identity: - """ - """ - def __init__(self, _obj): - """ - """ - self._o = _obj +class _ProfileChild(object): + """Abstract class for all Lasso objects that inherit from LassoProfile""" - def new(cls): - obj = lassmod.identity_new() - if obj is None: - raise ErrorInstanceCreationFailed('lasso_identity_new') - return Identity(obj) - new = classmethod(new) + # Attributes - def new_from_dump(cls, dump): - obj = lassomod.identity_new_from_dump(dump) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_identity_new_from_dump') - return Identity(obj) - new_from_dump = classmethod(new_from_dump) - - def dump(self): - return lassomod.identity_dump(self) - -class Session: - """ - """ - - def __init__(self, _obj): - """ - """ - self._o = _obj - - def __isprivate(self, name): - return name == '_o' - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.session_getattr(self, name) - if ret is None: - raise AttributeError, name - return ret - - def new(cls): - obj = lassmod.session_new() - if obj is None: - raise ErrorInstanceCreationFailed('lasso_session_new') - return Session(obj) - new = classmethod(new) - - def new_from_dump(cls, dump): - obj = lassomod.session_new_from_dump(dump) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_session_new_from_dump') - return Session(obj) - new_from_dump = classmethod(new_from_dump) - - def add_assertion(self, remote_providerID, assertion): - lassomod.session_add_assertion(self, remote_providerID, assertion) - - def dump(self): - return lassomod.session_dump(self) - - def destroy(self): - lassomod.session_destroy(self) - - def get_assertion(self, remote_providerID): - return Node(lassomod.session_get_assertion(self, remote_providerID)) - - def get_authentication_method(self, remote_providerID = None): - return lassomod.session_get_authentication_method(self, remote_providerID) - - def get_next_assertion_remote_providerID(self): - return lassomod.session_get_next_assertion_remote_providerID(self) - - def remove_assertion(self, remote_providerID): - lassomod.session_remove_assertion(self, remote_providerID) - -## Profile -# Request types -requestTypeLogin = 1 -requestTypeLogout = 2 -requestTypeFederationTermination = 3 -requestTypeRegisterNameIdentifier = 4 -requestTypeNameIdentifierMapping = 5 -requestTypeLecp = 6 - -def get_request_type_from_soap_msg(soap_buffer): - return lassomod.profile_get_request_type_from_soap_msg(soap_buffer); - -class Profile: - """\brief Short desc + def get_identity(self): + return lassomod.lasso_profile_get_identity(self.parent) + def set_identity(self, identity): + lassomod.lasso_profile_set_identity(self.parent, identity) + identity = property(get_identity, set_identity) + + def get_msg_body(self): + return self.parent.msg_body + msg_body = property(get_msg_body) + + def get_msg_relayState(self): + return self.parent.msg_relayState + msg_relayState = property(get_msg_relayState) + + def get_msg_url(self): + return self.parent.msg_url + msg_url = property(get_msg_url) + + def get_nameIdentifier(self): + return self.parent.nameIdentifier + nameIdentifier = property(get_nameIdentifier) + + def get_provider_type(self): + return self.parent.provider_type + provider_type = property(get_provider_type) + + def set_remote_providerID(self, remote_providerID): + lassomod.lasso_profile_set_remote_providerID(self.parent, remote_providerID) + remote_providerID = property(None, set_remote_providerID) + + def get_request(self): + request_type = self.request_type + if request_type == messageTypeAuthnRequest: + request = lassomod.lasso_profile_get_authn_request_ref(self.parent) + object.__setattr__(request, '__class__', AuthnRequest) + elif request_type == messageTypeRequest: + request = lassomod.lasso_profile_get_request_ref(self.parent) + object.__setattr__(request, '__class__', Request) + else: + raise ErrorUnknownRequestType('lasso_profile_get_???_request', request_type) + return request + request = property(get_request) + + def get_request_type(self): + return self.parent.request_type + request_type = property(get_request_type) + + def get_response(self): + response_type = self.response_type + if response_type == messageTypeAuthnResponse: + response = lassomod.lasso_profile_get_authn_response_ref(self.parent) + object.__setattr__(response, '__class__', AuthnResponse) + elif response_type == messageTypeResponse: + response = lassomod.lasso_profile_get_response_ref(self.parent) + object.__setattr__(response, '__class__', Response) + else: + raise ErrorUnknownResponseType('lasso_profile_get_???_response', response_type) + return response + response = property(get_response) - Long desc - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj + def set_response_status(self, response_status): + lassomod.lasso_profile_set_response_status(self.parent, response_status) + response_status = property(None, set_response_status) - def new(cls, server, identity=None, session=None): - obj = lassomod.profile_new(server, identity, session) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_profile_new') - return Profile(obj) - new = classmethod(new) + def get_response_type(self): + return self.parent.response_type + response_type = property(get_response_type) - def get_identity(self): - obj = lassomod.profile_get_identity(self) - if obj != None: - return Identity(_obj=obj) - else: - return None + def get_server(self): + return self.parent.server + server = property(get_server) def get_session(self): - obj = lassomod.profile_get_session(self) - if obj != None: - return Session(_obj=obj) - else: - return None - + return lassomod.lasso_profile_get_session(self.parent) + def set_session(self, session): + lassomod.lasso_profile_set_session(self.parent, session) + session = property(get_session, set_session) + def is_identity_dirty(self): - return lassomod.profile_is_identity_dirty(self) + return lassomod.lasso_profile_is_identity_dirty(self.parent) + identity_dirty = property(is_identity_dirty) def is_session_dirty(self): - return lassomod.profile_is_session_dirty(self) + return lassomod.lasso_profile_is_session_dirty(self.parent) + session_dirty = property(is_session_dirty) - def set_identity(self, identity): - errorCode = lassomod.profile_set_identity(self, identity) - if errorCode: - raise newError(errorCode, 'lasso_profile_set_identity') + # Methods - def set_identity_from_dump(self, dump): - errorCode = lassomod.profile_set_identity_from_dump(self, dump) - if errorCode: - raise newError(errorCode, 'lasso_profile_set_identity_from_dump') + def dump(self): + return lassomod.lasso_profile_dump(self.parent) - def set_session(self, session): - errorCode = lassomod.profile_set_session(self, session) - if errorCode: - raise newError(errorCode, 'lasso_profile_set_session') + def set_identity_from_dump(self, dump): + lassomod.lasso_profile_set_identity_from_dump(self.parent, dump) def set_session_from_dump(self, dump): - errorCode = lassomod.profile_set_session_from_dump(self, dump) - if errorCode: - raise newError(errorCode, 'lasso_profile_set_session_from_dump') - -## login -loginProtocolProfileBrwsArt = 1 -loginProtocolProfileBrwsPost = 2 - -class Login(Profile): - """\brief Short desc - - Long desc - """ - - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - Profile.__init__(self, _obj=_obj) - - def __isprivate(self, name): - return name == '_o' - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.login_getattr(self, name) - if ret is None: - raise AttributeError, name - elif name == "request": - if lassomod.login_getattr(self, "request_type") == messageTypeAuthnRequest: - ret = AuthnRequest(None, _obj=ret) - elif lassomod.login_getattr(self, "request_type") == messageTypeRequest: - ret = Node(_obj=ret) - # FIXME ret = Request(_obj=ret) - elif name == "response": - if lassomod.login_getattr(self, "response_type") == messageTypeAuthnResponse: - ret = AuthnResponse(None, _obj=ret) - elif lassomod.login_getattr(self, "response_type") == messageTypeResponse: - ret = SamlpResponse(_obj=ret) - # FIXME ret = Response(_obj=ret) - elif lassomod.login_getattr(self, "response_type") == messageTypeArtifact: - ret = Node(_obj=ret) - return ret - - def new(cls, server): - obj = lassomod.login_new(server) - if obj is None: + lassomod.lasso_profile_set_session_from_dump(self.parent, dump) + + +class Login(_ObjectMixin, lassomod.LassoLogin, _ProfileChild): + # Constructors + + def __new__(cls, server): + self = lassomod.lasso_login_new(server) + if self is None: raise ErrorInstanceCreationFailed('lasso_login_new') - return Login(obj) - new = classmethod(new) + object.__setattr__(self, '__class__', cls) + return self def new_from_dump(cls, server, dump): - obj = lassomod.login_new_from_dump(server, dump) - if obj is None: + self = lassomod.lasso_login_new_from_dump(server, dump) + if self is None: raise ErrorInstanceCreationFailed('lasso_login_new_from_dump') - return Login(obj) + object.__setattr__(self, '__class__', cls) + return self new_from_dump = classmethod(new_from_dump) + # Methods + def accept_sso(self): - errorCode = lassomod.login_accept_sso(self) + errorCode = lassomod.lasso_login_accept_sso(self) if errorCode: raise newError(errorCode, 'lasso_login_accept_sso') def build_artifact_msg(self, authentication_result, authenticationMethod, reauthenticateOnOrAfter, method): - errorCode = lassomod.login_build_artifact_msg( + errorCode = lassomod.lasso_login_build_artifact_msg( self, authentication_result, authenticationMethod, reauthenticateOnOrAfter, method) if errorCode: raise newError(errorCode, 'lasso_login_build_artifact_msg') def build_authn_request_msg(self, remote_providerID): - errorCode = lassomod.login_build_authn_request_msg(self, remote_providerID) + errorCode = lassomod.lasso_login_build_authn_request_msg(self, remote_providerID) if errorCode: raise newError(errorCode, 'lasso_login_build_authn_request_msg') def build_authn_response_msg(self, authentication_result, authenticationMethod, reauthenticateOnOrAfter): - errorCode = lassomod.login_build_authn_response_msg( + errorCode = lassomod.lasso_login_build_authn_response_msg( self, authentication_result, authenticationMethod, reauthenticateOnOrAfter) if errorCode: raise newError(errorCode, 'lasso_login_build_authn_response_msg') def build_request_msg(self): - errorCode = lassomod.login_build_request_msg(self) + errorCode = lassomod.lasso_login_build_request_msg(self) if errorCode: raise newError(errorCode, 'lasso_login_build_request_msg') def dump(self): - return lassomod.login_dump(self) + return lassomod.lasso_login_dump(self) def init_authn_request(self): - errorCode = lassomod.login_init_authn_request(self) + errorCode = lassomod.lasso_login_init_authn_request(self) if errorCode: raise newError(errorCode, 'lasso_login_init_authn_request') def init_from_authn_request_msg(self, authn_request_msg, authn_request_method): - errorCode = lassomod.login_init_from_authn_request_msg( + errorCode = lassomod.lasso_login_init_from_authn_request_msg( self, authn_request_msg, authn_request_method) if errorCode: raise newError(errorCode, 'lasso_login_init_from_authn_request_msg') def init_request(self, response_msg, response_method): - errorCode = lassomod.login_init_request(self, response_msg, response_method) + errorCode = lassomod.lasso_login_init_request(self, response_msg, response_method) if errorCode: raise newError(errorCode, 'lasso_login_init_request') def must_authenticate(self): - return lassomod.login_must_authenticate(self) + return lassomod.lasso_login_must_authenticate(self) def process_authn_response_msg(self, authn_response_msg): - errorCode = lassomod.login_process_authn_response_msg(self, authn_response_msg) + errorCode = lassomod.lasso_login_process_authn_response_msg(self, authn_response_msg) if errorCode: raise newError(errorCode, 'lasso_login_process_authn_response_msg') def process_request_msg(self, request_msg): - errorCode = lassomod.login_process_request_msg(self, request_msg) + errorCode = lassomod.lasso_login_process_request_msg(self, request_msg) if errorCode: raise newError(errorCode, 'lasso_login_process_request_msg') def process_response_msg(self, response_msg): - errorCode = lassomod.login_process_response_msg(self, response_msg) + errorCode = lassomod.lasso_login_process_response_msg(self, response_msg) if errorCode: raise newError(errorCode, 'lasso_login_process_response_msg') -providerTypeNone = 0 -providerTypeSp = 1 -providerTypeIdp = 2 - -class Logout(Profile): - """\brief Short desc - - Long desc - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - Profile.__init__(self, _obj=_obj) - - def __isprivate(self, name): - return name == '_o' - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.logout_getattr(self, name) - if ret is None: - return None - elif name == "request": - ret = LogoutRequest(_obj=ret) - elif name == "response": - ret = LogoutResponse(_obj=ret) - return ret - - def new(cls, server, provider_type): - obj = lassomod.logout_new(server, provider_type) - if obj is None: +class Logout(_ObjectMixin, lassomod.LassoLogout, _ProfileChild): + # Constructors + + def __new__(cls, server, provider_type): + self = lassomod.lasso_logout_new(server, provider_type) + if self is None: raise ErrorInstanceCreationFailed('lasso_logout_new') - return Logout(obj) - new = classmethod(new) + object.__setattr__(self, '__class__', cls) + return self + new = classmethod(__new__) + + # Methods def build_request_msg(self): - errorCode = lassomod.logout_build_request_msg(self) + errorCode = lassomod.lasso_logout_build_request_msg(self) if errorCode: raise newError(errorCode, 'lasso_logout_build_request_msg') def build_response_msg(self): - errorCode = lassomod.logout_build_response_msg(self) + errorCode = lassomod.lasso_logout_build_response_msg(self) if errorCode: raise newError(errorCode, 'lasso_logout_build_response_msg') - def destroy(self): - lassomod.logout_destroy(self); - def get_next_providerID(self): - return lassomod.logout_get_next_providerID(self); + return lassomod.lasso_logout_get_next_providerID(self) def init_request(self, remote_providerID = None): - errorCode = lassomod.logout_init_request(self, remote_providerID); + errorCode = lassomod.lasso_logout_init_request(self, remote_providerID) if errorCode: raise newError(errorCode, 'lasso_logout_init_request') def process_request_msg(self, request_msg, request_method): - errorCode = lassomod.logout_process_request_msg(self, request_msg, request_method); + errorCode = lassomod.lasso_logout_process_request_msg(self, request_msg, request_method) if errorCode: raise newError(errorCode, 'lasso_logout_process_request_msg') - def validate_request(self): - errorCode = lassomod.logout_validate_request(self); - if errorCode: - raise newError(errorCode, 'lasso_logout_validate_request') - def process_response_msg(self, response_msg, response_method): - errorCode = lassomod.logout_process_response_msg(self, response_msg, response_method); + errorCode = lassomod.lasso_logout_process_response_msg( + self, response_msg, response_method) if errorCode: raise newError(errorCode, 'lasso_logout_process_response_msg') -class FederationTermination(Profile): - """\brief Short desc - - Long desc - """ - def __init__(self, _obj): - """ - The constructor - """ - self._o = _obj - Profile.__init__(self, _obj=_obj) - - def __isprivate(self, name): - return name == '_o' - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.federation_termination_getattr(self, name) - if ret: - if name == "identity": - ret= Identity(_obj=ret) - elif name == "session": - ret= Session(_obj=ret) - return ret - - def new(cls, server, provider_type): - obj = lassomod.federation_termination_new(server, provider_type) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_federation_termination_new') - return FederationTermination(obj) - new = classmethod(new) - - def build_notification_msg(self): - errorCode = lassomod.federation_termination_build_notification_msg(self) - if errorCode: - raise newError(errorCode, 'lasso_federation_termination_build_notification_msg') - - def destroy(self): - lassomod.federation_termination_destroy(self) - - def init_notification(self, remote_providerID = None): - errorCode = lassomod.federation_termination_init_notification(self, remote_providerID) - if errorCode: - raise newError(errorCode, 'lasso_federation_termination_init_notification') - - def process_notification_msg(self, notification_msg, notification_method): - errorCode = lassomod.federation_termination_process_notification_msg( - self, notification_msg, notification_method) - if errorCode: - raise newError(errorCode, 'lasso_federation_termination_load_notification_msg') - - def validate_notification(self): - errorCode = lassomod.federation_termination_validate_notification(self) - if errorCode: - raise newError(errorCode, 'lasso_federation_termination_process_notification') - - -class RegisterNameIdentifier(Profile): - """\brief Short desc - - Long desc - """ - - def __isprivate(self, name): - return name == '_o' - - def __init__(self, _obj): - """ - The constructor - """ - Profile.__init__(self, _obj=_obj) - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.register_name_identifier_getattr(self, name) - return ret - - def new(cls, server, identity, provider_type): - obj = lassomod.register_name_identifier_new(server, identity, provider_type) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_register_name_identifier_new') - return RegisterNameIdentifier(obj) - new = classmethod(new) - - def build_request_msg(self): - errorCode = lassomod.register_name_identifier_build_request_msg(self) - if errorCode: - raise newError(errorCode, 'lasso_register_name_identifier_build_request_msg') - - def build_response_msg(self): - errorCode = lassomod.register_name_identifier_build_response_msg(self) + def validate_request(self): + errorCode = lassomod.lasso_logout_validate_request(self) if errorCode: - raise newError(errorCode, 'lasso_register_name_identifier_build_response_msg') + raise newError(errorCode, 'lasso_logout_validate_request') - def destroy(self): - pass - def init_request(self, remote_providerID): - errorCode = lassomod.register_name_identifier_init_request(self, remote_providerID) - if errorCode: - raise newError(errorCode, 'lasso_register_name_identifier_init_request') - - def process_request_msg(self): - errorCode = lassomod.register_name_identifier_process_request_msg(self) - if errorCode: - raise newError(errorCode, 'lasso_register_name_identifier_process_request_msg') +################################################################################ +# Module Initialization +################################################################################ - def process_response_msg(self, response_msg, response_method): - errorCode = lassomod.register_name_identifier_process_response_msg( - self, response_msg, response_method) - if errorCode: - raise newError(errorCode, 'lasso_register_name_identifier_process_response_msg') - -class Lecp(Login): - """\brief Short desc - - Long desc - """ - - def __isprivate(self, name): - return name == '_o' - - def __init__(self, _obj): - """ - The constructor - """ - Login.__init__(self, _obj = _obj) - - def __getattr__(self, name): - if self.__isprivate(name): - return self.__dict__[name] - if name[:2] == "__" and name[-2:] == "__" and name != "__members__": - raise AttributeError, name - ret = lassomod.lecp_getattr(self, name) - if ret is None: - raise AttributeError, name - elif name == "request": - if lassomod.lecp_getattr(self, "request_type") == messageTypeAuthnRequest: - ret = AuthnRequest(None, _obj=ret) - elif lassomod.lecp_getattr(self, "request_type") == messageTypeRequest: - ret = Node(_obj=ret) - # FIXME ret = Request(_obj=ret) - elif name == "response": - if lassomod.lecp_getattr(self, "response_type") == messageTypeAuthnResponse: - ret = AuthnResponse(_obj=ret) - elif lassomod.lecp_getattr(self, "response_type") == messageTypeResponse: - ret = SamlpResponse(_obj=ret) - # FIXME ret = Response(_obj=ret) - elif lassomod.lecp_getattr(self, "response_type") == messageTypeArtifact: - ret = Node(_obj=ret) - return ret - - def new(cls, server = None): - obj = lassomod.lecp_new(server) - if obj is None: - raise ErrorInstanceCreationFailed('lasso_lecp_new') - return Lecp(obj) - new = classmethod(new) - - def build_authn_request_envelope_msg(self): - errorCode = lassomod.lecp_build_authn_request_envelope_msg(self) - if errorCode: - raise newError(errorCode, 'lasso_lecp_build_authn_request_envelope_msg') - - def build_authn_response_envelope_msg(self, authentication_result, - authenticationMethod, - reauthenticateOnOrAfter): - errorCode = lassomod.lecp_build_authn_response_envelope_msg(self, - authentication_result, - authenticationMethod, - reauthenticateOnOrAfter) - if errorCode: - raise newError(errorCode, 'lasso_lecp_build_authn_response_envelope_msg') - def build_authn_request_msg(self, remote_providerID): - errorCode = lassomod.lecp_build_authn_request_msg(self, remote_providerID) - if errorCode: - raise newError(errorCode, 'lasso_lecp_build_authn_request_msg') +_initialized = False - def build_authn_response_msg(self): - errorCode = lassomod.lecp_build_authn_response_msg(self) - if errorCode: - raise newError(errorCode, 'lasso_lecp_build_authn_response_msg') +def init(): + """Initialize Lasso library.""" + global _initialized + if _initialized: + raise ErrorLassoAlreadyInitialized() + _initialized = True + lassomod.lasso_init() - def destroy(self): - lassomod.lecp_destroy(self) - def init_authn_request(self): - errorCode = lassomod.lecp_init_authn_request(self) - if errorCode: - raise newError(errorCode, 'lasso_lecp_init_authn_request') +def shutdown(): + """Shutdown Lasso Library.""" + global _initialized + if not _initialized: + raise ErrorLassoNotInitialized() + _initialized = False + lassomod.lasso_shutdown() - def init_from_authn_request_msg(self, authn_request_msg, authn_request_method): - errorCode = lassomod.lecp_init_from_authn_request_msg( - self, authn_request_msg, authn_request_method) - if errorCode: - raise newError(errorCode, 'lasso_lecp_init_from_authn_request_msg') - def process_authn_request_envelope_msg(self, request_msg): - errorCode = lassomod.lecp_process_authn_request_envelope_msg(self, request_msg) - if errorCode: - raise newError(errorCode, 'lasso_lecp_process_authn_request_envelope_msg') +################################################################################ +# Module Test +################################################################################ - def process_authn_response_envelope_msg(self, response_msg): - errorCode = lassomod.lecp_process_authn_response_envelope_msg(self, response_msg) - if errorCode: - raise newError(errorCode, 'lasso_lecp_process_authn_response_envelope_msg') +if __name__ == '__main__': + import os -if not _initialized: init() + dataDirectoryPath = '../tests/data' + + server = Server( + os.path.join(dataDirectoryPath, 'sp1-la/metadata.xml'), + os.path.join(dataDirectoryPath, 'sp1-la/public-key.pem'), + os.path.join(dataDirectoryPath, 'sp1-la/private-key-raw.pem'), + os.path.join(dataDirectoryPath, 'sp1-la/certificate.pem'), + signatureMethodRsaSha1) + server.add_provider( + os.path.join(dataDirectoryPath, 'idp1-la/metadata.xml'), + os.path.join(dataDirectoryPath, 'idp1-la/public-key.pem'), + os.path.join(dataDirectoryPath, 'idp1-la/certificate.pem')) + login = Login(server) + login.init_authn_request() + login.request.set_isPassive(False) + login.request.set_nameIDPolicy('federated') + login.request.set_consent('urn:liberty:consent:obtained') + login.build_authn_request_msg('https://idp1/metadata') + print login.msg_url + shutdown() +else: + if not _initialized: + init() diff --git a/swig/Lasso.c b/swig/Lasso.c index d7d70dfc..5baecce6 100644 --- a/swig/Lasso.c +++ b/swig/Lasso.c @@ -87,6 +87,44 @@ void delete_LassoSession(LassoSession *session) /*********************************************************************** + * Profile + ***********************************************************************/ + + +LassoAuthnRequest* lasso_profile_get_authn_request_ref(LassoProfile *profile) +{ + if (profile->request_type == lassoMessageTypeAuthnRequest) + return LASSO_AUTHN_REQUEST(profile->request); + else + return NULL; +} + +LassoAuthnResponse* lasso_profile_get_authn_response_ref(LassoProfile *profile) +{ + if (profile->response_type == lassoMessageTypeAuthnResponse) + return LASSO_AUTHN_RESPONSE(profile->response); + else + return NULL; +} + +LassoRequest* lasso_profile_get_request_ref(LassoProfile *profile) +{ + if (profile->request_type == lassoMessageTypeRequest) + return LASSO_REQUEST(profile->request); + else + return NULL; +} + +LassoResponse* lasso_profile_get_response_ref(LassoProfile *profile) +{ + if (profile->response_type == lassoMessageTypeResponse) + return LASSO_RESPONSE(profile->response); + else + return NULL; +} + + +/*********************************************************************** * Login ***********************************************************************/ diff --git a/swig/Lasso.i b/swig/Lasso.i index d0d4886c..7783d0cb 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -106,6 +106,8 @@ #define gldouble long double #define gpointer void* +#define xmlChar char + /* SWIG instructions telling how to deallocate Lasso structures */ %typemap(newfree) gchar * "g_free($1);"; @@ -119,6 +121,55 @@ int lasso_shutdown(void); /*********************************************************************** + * Constants + ***********************************************************************/ + + +typedef enum { + lassoHttpMethodGet = 1, + lassoHttpMethodPost, + lassoHttpMethodRedirect, + lassoHttpMethodSoap +} lassoHttpMethod; + +typedef enum { + lassoLoginProtocolProfileBrwsArt = 1, + lassoLoginProtocolProfileBrwsPost, +} lassoLoginProtocolProfile; + +typedef enum { + lassoMessageTypeNone = 0, + lassoMessageTypeAuthnRequest, + lassoMessageTypeAuthnResponse, + lassoMessageTypeRequest, + lassoMessageTypeResponse, + lassoMessageTypeArtifact +} lassoMessageType; + +typedef enum { + lassoProviderTypeNone = 0, + lassoProviderTypeSp, + lassoProviderTypeIdp +} lassoProviderType; + +/* Request types (used by SOAP endpoint) */ +typedef enum { + lassoRequestTypeInvalid = 0, + lassoRequestTypeLogin, + lassoRequestTypeLogout, + lassoRequestTypeFederationTermination, + lassoRequestTypeRegisterNameIdentifier, + lassoRequestTypeNameIdentifierMapping, + lassoRequestTypeLecp +} lassoRequestType; + +typedef enum { + lassoSignatureMethodRsaSha1 = 1, + lassoSignatureMethodDsaSha1 +} lassoSignatureMethod; + + +/*********************************************************************** *********************************************************************** * XML *********************************************************************** @@ -130,8 +181,6 @@ int lasso_shutdown(void); ***********************************************************************/ -/* Object */ - %nodefault _LassoSamlpRequest; typedef struct _LassoSamlpRequest { LassoSamlpRequestAbstract parent; @@ -139,11 +188,21 @@ typedef struct _LassoSamlpRequest { /*********************************************************************** - * LibAuthnRequest + * SamlpResponse ***********************************************************************/ -/* Object */ +%nodefault _LassoSamlpResponse; +typedef struct _LassoSamlpResponse { + LassoSamlpResponseAbstract parent; +} LassoSamlpResponse; + + + +/*********************************************************************** + * LibAuthnRequest + ***********************************************************************/ + %nodefault _LassoLibAuthnRequest; typedef struct _LassoLibAuthnRequest { @@ -179,6 +238,17 @@ void lasso_lib_authn_request_set_scoping(LassoLibAuthnRequest *node, LassoLibSco /*********************************************************************** + * LibAuthnResponse + ***********************************************************************/ + + +%nodefault _LassoLibAuthnResponse; +typedef struct _LassoLibAuthnResponse { + LassoSamlpResponse parent; +} LassoLibAuthnResponse; + + +/*********************************************************************** *********************************************************************** * Protocols *********************************************************************** @@ -190,8 +260,6 @@ void lasso_lib_authn_request_set_scoping(LassoLibAuthnRequest *node, LassoLibSco ***********************************************************************/ -/* Object */ - %nodefault _LassoAuthnRequest; typedef struct _LassoAuthnRequest { LassoLibAuthnRequest parent; @@ -199,6 +267,44 @@ typedef struct _LassoAuthnRequest { /*********************************************************************** + * AuthnResponse + ***********************************************************************/ + + +%nodefault _LassoAuthnResponse; +typedef struct _LassoAuthnResponse { + LassoLibAuthnResponse parent; +} LassoAuthnResponse; + +/* Methods */ + +%newobject lasso_authn_response_get_status; +xmlChar* lasso_authn_response_get_status(LassoAuthnResponse *response); + + +/*********************************************************************** + * Request + ***********************************************************************/ + + +%nodefault _LassoRequest; +typedef struct _LassoRequest { + LassoSamlpRequest parent; +} LassoRequest; + + +/*********************************************************************** + * Response + ***********************************************************************/ + + +%nodefault _LassoResponse; +typedef struct _LassoResponse { + LassoSamlpResponse parent; +} LassoResponse; + + +/*********************************************************************** *********************************************************************** * Profiles *********************************************************************** @@ -210,8 +316,6 @@ typedef struct _LassoAuthnRequest { ***********************************************************************/ -/* Object */ - typedef struct { LassoProvider parent; GPtrArray *providers; @@ -254,8 +358,6 @@ gchar* lasso_server_dump(LassoServer *server); ***********************************************************************/ -/* Object */ - typedef struct { GObject parent; GPtrArray *providerIDs; /* list of the remote provider ids for federations hash table */ @@ -291,8 +393,6 @@ gchar* lasso_identity_dump(LassoIdentity *identity); ***********************************************************************/ -/* Object */ - typedef struct { GObject parent; GPtrArray *providerIDs; /* list of the remote provider ids for federations hash table */ @@ -331,37 +431,6 @@ gchar* lasso_session_get_authentication_method(LassoSession *session, gchar *rem ***********************************************************************/ -/* Constants */ - -typedef enum { - lassoHttpMethodGet = 1, - lassoHttpMethodPost, - lassoHttpMethodRedirect, - lassoHttpMethodSoap -} lassoHttpMethod; - -typedef enum { - lassoMessageTypeNone = 0, - lassoMessageTypeAuthnRequest, - lassoMessageTypeAuthnResponse, - lassoMessageTypeRequest, - lassoMessageTypeResponse, - lassoMessageTypeArtifact -} lassoMessageType; - -/* Request types (used by SOAP endpoint) */ -typedef enum { - lassoRequestTypeInvalid = 0, - lassoRequestTypeLogin, - lassoRequestTypeLogout, - lassoRequestTypeFederationTermination, - lassoRequestTypeRegisterNameIdentifier, - lassoRequestTypeNameIdentifierMapping, - lassoRequestTypeLecp -} lassoRequestType; - -/* Object */ - %nodefault _LassoProfile; typedef struct _LassoProfile { GObject parent; @@ -379,9 +448,17 @@ typedef struct _LassoProfile { /* Methods */ +LassoAuthnRequest* lasso_profile_get_authn_request_ref(LassoProfile *profile); + +LassoAuthnResponse* lasso_profile_get_authn_response_ref(LassoProfile *profile); + %newobject lasso_profile_get_identity; LassoIdentity* lasso_profile_get_identity(LassoProfile *profile); +LassoRequest* lasso_profile_get_request_ref(LassoProfile *profile); + +LassoResponse* lasso_profile_get_response_ref(LassoProfile *profile); + %newobject lasso_profile_get_session; LassoSession* lasso_profile_get_session(LassoProfile *profile); @@ -411,18 +488,9 @@ lassoRequestType lasso_profile_get_request_type_from_soap_msg(gchar *soap); ***********************************************************************/ -/* Constants */ - -typedef enum { - lassoLoginProtocolProfileBrwsArt = 1, - lassoLoginProtocolProfileBrwsPost, -} lassoLoginProtocolProfiles; - -/* Object */ - typedef struct { LassoProfile parent; - lassoLoginProtocolProfiles protocolProfile; + lassoLoginProtocolProfile protocolProfile; gchar *assertionArtifact; gchar *response_dump; @@ -485,8 +553,6 @@ gint lasso_login_process_response_msg(LassoLogin *login, gchar *response_msg); ***********************************************************************/ -/* Object */ - typedef struct { LassoProfile parent; @@ -530,8 +596,6 @@ gint lasso_logout_validate_request(LassoLogout *logout); ***********************************************************************/ -/* Object */ - typedef struct { LassoLogin parent; @@ -792,40 +856,6 @@ LassoNode* lasso_authn_request_envelope_new_from_export (gchar *b /* */ -#define LASSO_TYPE_AUTHN_RESPONSE (lasso_authn_response_get_type()) -#define LASSO_AUTHN_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_AUTHN_RESPONSE, LassoAuthnResponse)) -/*#define LASSO_AUTHN_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), - * LASSO_TYPE_AUTHN_RESPONSE, LassoAuthnResponseClass))*/ -#define LASSO_IS_AUTHN_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_AUTHN_RESPONSE)) -#define LASSO_IS_AUTHN_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_AUTHN_RESPONSE)) -/*#define LASSO_AUTHN_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), - * LASSO_TYPE_AUTHN_RESPONSE, LassoAuthnResponseClass)) */ - -/*typedef struct _LassoAuthnResponseClass LassoAuthnResponseClass;*/ - -typedef struct _LassoAuthnResponse { - LassoLibAuthnResponse parent; - /*< public >*/ - /*< private >*/ -} LassoAuthnResponse; - -/*struct _LassoAuthnResponseClass { - LassoLibAuthnResponseClass parent; -};*/ - -GType lasso_authn_response_get_type (void); - -LassoNode* lasso_authn_response_new (char *providerID, - LassoNode *request); - -LassoNode* lasso_authn_response_new_from_export (xmlChar *buffer, - lassoNodeExportType type); - -xmlChar* lasso_authn_response_get_status (LassoAuthnResponse *response); - -/* - */ - #define LASSO_TYPE_AUTHN_RESPONSE_ENVELOPE (lasso_authn_response_envelope_get_type()) #define LASSO_AUTHN_RESPONSE_ENVELOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_AUTHN_RESPONSE_ENVELOPE, LassoAuthnResponseEnvelope)) /*#define LASSO_AUTHN_RESPONSE_ENVELOPE_CLASS(klass) @@ -1131,12 +1161,6 @@ LassoNode *lasso_name_identifier_mapping_response_new_from_request_query (const /*typedef struct _LassoProviderClass LassoProviderClass;*/ typedef struct _LassoProviderPrivate LassoProviderPrivate; -typedef enum { - lassoProviderTypeNone = 0, - lassoProviderTypeSp, - lassoProviderTypeIdp -} lassoProviderType; - typedef struct _LassoProvider { GObject parent; @@ -1319,65 +1343,6 @@ LassoNode* lasso_register_name_identifier_response_new_from_request_export (gch gchar *providerID, gchar *statusCodeValue); -/* - */ -#define LASSO_TYPE_REQUEST (lasso_request_get_type()) -#define LASSO_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_REQUEST, LassoRequest)) -/*#define LASSO_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), - * LASSO_TYPE_REQUEST, LassoRequestClass))*/ -#define LASSO_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_REQUEST)) -#define LASSO_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_REQUEST)) -/*#define LASSO_REQUEST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), - * LASSO_TYPE_REQUEST, LassoRequestClass)) */ - -/*typedef struct _LassoRequestClass LassoRequestClass;*/ - -typedef struct _LassoRequest { - LassoSamlpRequest parent; - /*< public >*/ - /*< private >*/ -} LassoRequest; - -/*struct _LassoRequestClass { - LassoSamlpRequestClass parent; -};*/ - -GType lasso_request_get_type (void); - -LassoNode* lasso_request_new (const xmlChar *assertionArtifact); - -LassoNode* lasso_request_new_from_export (gchar *buffer, - lassoNodeExportType export_type); - -/* - */ -#define LASSO_TYPE_RESPONSE (lasso_response_get_type()) -#define LASSO_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_RESPONSE, LassoResponse)) -/*#define LASSO_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), - * LASSO_TYPE_RESPONSE, LassoResponseClass))*/ -#define LASSO_IS_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_RESPONSE)) -#define LASSO_IS_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_RESPONSE)) -/*#define LASSO_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), - * LASSO_TYPE_RESPONSE, LassoResponseClass)) */ - -/*typedef struct _LassoResponseClass LassoResponseClass;*/ - -typedef struct _LassoResponse { - LassoSamlpResponse parent; - /*< public >*/ - /*< private >*/ -} LassoResponse; - -/*struct _LassoResponseClass { - LassoSamlpResponseClass parent; -};*/ - -GType lasso_response_get_type (void); - -LassoNode* lasso_response_new (void); - -LassoNode* lasso_response_new_from_export (xmlChar *buffer, - lassoNodeExportType export_type); /* */ @@ -1592,41 +1557,6 @@ void lasso_lib_authn_request_envelope_set_isPassive (LassoLibAuthnReque /* */ -#define LASSO_TYPE_LIB_AUTHN_RESPONSE (lasso_lib_authn_response_get_type()) -#define LASSO_LIB_AUTHN_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_LIB_AUTHN_RESPONSE, LassoLibAuthnResponse)) -/*#define LASSO_LIB_AUTHN_RESPONSE_CLASS(klass) - * (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_LIB_AUTHN_RESPONSE, - * LassoLibAuthnResponseClass))*/ -#define LASSO_IS_LIB_AUTHN_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_LIB_AUTHN_RESPONSE)) -#define LASSO_IS_LIB_AUTHN_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_LIB_AUTHN_RESPONSE)) -/*#define LASSO_LIB_AUTHN_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), - * LASSO_TYPE_LIB_AUTHN_RESPONSE, LassoLibAuthnResponseClass)) */ - -/*typedef struct _LassoLibAuthnResponseClass LassoLibAuthnResponseClass;*/ - -typedef struct _LassoLibAuthnResponse { - LassoSamlpResponse parent; - /*< private >*/ -} LassoLibAuthnResponse; - -/*struct _LassoLibAuthnResponseClass { - LassoSamlpResponseClass parent; -};*/ - -GType lasso_lib_authn_response_get_type(void); -LassoNode* lasso_lib_authn_response_new(void); - -void lasso_lib_authn_response_set_consent (LassoLibAuthnResponse *, - const xmlChar *); - -void lasso_lib_authn_response_set_providerID (LassoLibAuthnResponse *, - const xmlChar *); - -void lasso_lib_authn_response_set_relayState (LassoLibAuthnResponse *, - const xmlChar *); - -/* - */ #define LASSO_TYPE_LIB_AUTHN_RESPONSE_ENVELOPE (lasso_lib_authn_response_envelope_get_type()) #define LASSO_LIB_AUTHN_RESPONSE_ENVELOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_LIB_AUTHN_RESPONSE_ENVELOPE, LassoLibAuthnResponseEnvelope)) /*#define LASSO_LIB_AUTHN_RESPONSE_ENVELOPE_CLASS(klass) @@ -2289,38 +2219,6 @@ void lasso_samlp_request_abstract_set_requestID (LassoSamlpRequestAbstract *n /* */ -#define LASSO_TYPE_SAMLP_RESPONSE (lasso_samlp_response_get_type()) -#define LASSO_SAMLP_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP_RESPONSE, LassoSamlpResponse)) -/*#define LASSO_SAMLP_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), - * LASSO_TYPE_SAMLP_RESPONSE, LassoSamlpResponseClass))*/ -#define LASSO_IS_SAMLP_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP_RESPONSE)) -#define LASSO_IS_SAMLP_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP_RESPONSE)) -/*#define LASSO_SAMLP_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), - * LASSO_TYPE_SAMLP_RESPONSE, LassoSamlpResponseClass)) */ - -/*typedef struct _LassoSamlpResponseClass LassoSamlpResponseClass;*/ - -typedef struct _LassoSamlpResponse { - LassoSamlpResponseAbstract parent; - /*< private >*/ -} LassoSamlpResponse; - -/*struct _LassoSamlpResponseClass { - LassoSamlpResponseAbstractClass parent; -};*/ - -GType lasso_samlp_response_get_type(void); -LassoNode* lasso_samlp_response_new(void); - -void lasso_samlp_response_add_assertion (LassoSamlpResponse *node, - gpointer assertion); - -void lasso_samlp_response_set_status (LassoSamlpResponse *node, - LassoSamlpStatus *status); - -/* - */ - #define LASSO_TYPE_SAMLP_RESPONSE_ABSTRACT (lasso_samlp_response_abstract_get_type()) #define LASSO_SAMLP_RESPONSE_ABSTRACT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP_RESPONSE_ABSTRACT, LassoSamlpResponseAbstract)) /*#define LASSO_SAMLP_RESPONSE_ABSTRACT_CLASS(klass) @@ -3019,10 +2917,6 @@ const xmlChar lassoSoapEnvPrefix[]; /* */ -typedef enum { - lassoSignatureMethodRsaSha1 = 1, - lassoSignatureMethodDsaSha1 -} lassoSignatureMethod; xmlChar* lasso_build_random_sequence (guint8 size); |