Commit Graph

134 Commits

Author SHA1 Message Date
Benjamin Dauvergne 462c9a1cd0 [Core] replace all use of g_strcmp0 by lasso_strisequal and lasso_strisnotequal
Too much human errors with strcmp kind of functions. Also change name os
lasso_is_empty_string to lasso_strisempty.
2010-10-01 15:29:38 +02:00
Benjamin Dauvergne b9d5356259 [ID-WSFv1&ID-WSFv2] separate better strings for ID-WSF from other strings
Code in core source file which depend upon ID-WSF symbols have been
conditionalized, and each id-wsf source file now include directly its
need string header.
2010-09-09 01:09:28 +02:00
Benjamin Dauvergne 0a169eda51 Improve safety by replacing all g_free use by lasso_release 2010-04-22 00:44:45 +00:00
Benjamin Dauvergne 95f5d99be6 Core: add missing return value owner semantic annotations to getters
* lasso/id-ff/provider.c:
   fix lasso_provider_get_base64_succinct_id, it returned a libxml
   string, copy it with g_strdup before releasing it to stay with GLib
   allocated string in return values.
2010-02-17 10:14:59 +00:00
Benjamin Dauvergne 6b601b55ee Documentation: complete non finished documentation comments
* too much warnings when generating doc, now we can concentrate on
   undocumented symbols (in
   lasso/docs/reference/lasso/lasso-undocumented.txt).
2010-02-10 13:58:40 +00:00
Benjamin Dauvergne 1e581e05b7 ID-WSF 1.0 & 2.0: complete lasso-sections.txt, add internal API to access SOAP headers, complete WS-Addressing support
* docs/reference/lasso/lasso-sections.txt: complete documentation of
   LassoSoapEnvelope and LassoSoapFault with ID-WSF additions.

 * lasso/id-wsf-2.0/profile.c lasso/id-wsf-2.0/soap_binding.c
   lasso/id-wsf-2.0/soap_binding.h:
   add internal function _get_node and _get_header to simplify
   implementation of accessors for headers.
   change signature of lasso_soap_envelope_get_message_id and add new
   function lasso_soap_envelope_get_relates_to.
   update call points.
   add a message id when building a SOAP message.

 * lasso/xml/idwsf_strings.h:
   add element name for MessageID and RelatesTo WS-Addressing elements.

 * lasso/id-wsf/authentication.c lasso/id-wsf/data_service.c
   lasso/id-wsf/discovery.c lasso/id-wsf/wsf_profile.c
   lasso/id-wsf-2.0/saml2_login.c lasso/xml/disco_description.c:
   fix path name of header lasso/id-wsf/wsf_utils.h. make all internal
   include path relatives.
2010-01-26 20:59:26 +00:00
Benjamin Dauvergne 0279087029 Documentation: distribute stylesheet, fix documentation comments, compelte lasso-sections.txt 2010-01-18 10:03:54 +00:00
Benjamin Dauvergne 42c81da4f4 XML: move SOAP API to its own sub directory 2010-01-04 09:15:42 +00:00
Benjamin Dauvergne 29558f6a6a ID-WSF 2.0&ID-WSF: in profile.c, wsf_profile.c, errors.c, errors.h, and in lasso-sections.txt change LASSO_SOAP_FAULT_REDIRECT_REQUEST to LASSO_SOAP_ERROR_REDIRECT_REQUEST_FAULT 2010-01-04 09:15:20 +00:00
Benjamin Dauvergne e2aa7b401f ID-WSF: in wsf_profile.c, fix mem leaks 2010-01-04 09:14:41 +00:00
Benjamin Dauvergne 6921dd1d9b ID-FF1.2 and SAML2: remove direct access to profile->server->providers
* client of LassoServer should use lasso_server_get_provider.
 * LASSO_PROFILE_ERRROR_UNKNOWN_PROVIDER was a mistake, it is
   superfluous, use LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND.
2009-10-30 14:47:23 +00:00
Benjamin Dauvergne 16ba173270 ID-WSF 1.0: use the common wsse:Security object
* lasso/id-wsf/wsf_profile.c:
   use the common LassoWsSec1SecurityHeader object instead of the
   specific LassoWsseSecurity, and set the needed namespace using
   lasso_node_set_custom_namespace.
   add implementation comments.
2009-09-11 15:51:35 +00:00
Benjamin Dauvergne 819b9401f4 ID-WSF 1.0: Fixed missing or deprecated functions in public headers
Some new functions were missing from the headers, others were deprecated
some time ago and as the API is not considered stable for ID-WSF, I
removed them definitely.
2009-08-28 14:26:37 +00:00
Benjamin Dauvergne fd256b2269 Docs: change the doc production and lot of other fixes
* lasso/Makefile.am:
   distribute extract_sections.py
 * docs/references/lasso/lasso.types.in: add missing class (mainly SAML2
   and ID-WSF 1.0/2.0) from docs/references/lasso.types.in

 * lasso/xml/strings.h:
   add lots of documentation, or at least documentation template to
   strings constants.
 * id-ff/login.h:
 * saml-2.0/assertion_query.h:
 * xml/xml.h:
   document undocumented enumerations.
 * lasso/errors.h:
   add proper documentation about error codes.
 * lasso/errors.c:
   new version of the lasso_strerror function
 * lasso/build_strerror.py:
   update the script that generater lasso_strerror from the
   documentation comments.

   Remove usage of OFTYPE

 * lasso/id-ff/session.c:
 * lasso/id-ff/session.h:
   remove usage of oftype, prefer gtk-introspection annotations instead.
 * lasso/id-wsf/data_service.h:
 * lasso/id-wsf/data_service.c:
   do the same.

   Add a script to build lasso-sections.txt

 * lasso/extract_sections.py:
   this script parses header files and generated lasso-sections.txt
   content for GObject class descriptions.

   Add a template file for the lasso-section.txt file

 * docs/references/lasso-sections.txt.in:
   this file serves as a base for the generation of lasso-sections.txt

   Update docs/references/Makefile.am for generating lasso-sections.txt

 * docs/references/Makefile.am:
   always rebuild template, using out of source build directory is too
   weird without it.
   call new script extract_sections.py to regenerate lasso-sections.txt
   if header files changed.

   Update lasso.sgml file with all missing sections

 * docs/reference/lasso.sgml:
   add all missing sections, mainly objects from XML schemas.

 * docs/reference/lasso-sections.txt: update it

 * *.c: add section documentation to some files.
 * lasso/xml/strings.h: fix bad usage or docbook markup
2009-08-26 15:15:07 +00:00
Benjamin Dauvergne 55f2051534 ID-WSF: Lots of modifications
Migrate lots of code to use new utility macros. Try to simplify most
 code paths or to factorize with LassoWsfProfile.

 * lasso/id-wsf/wsf_profile.c:
   Add API:
    - lasso_wsf_profile_build_soap_response_msg to build SOAP fault for
      Lasso errors,
    - lasso_wsf_profile_set_msg_url_from_description, to set the
      destination URL using the chosen LassoDiscoDescription (with
      respect to the security mechanism),
    - lasso_wsf_profile_init_soap_response to initialize a response to
      the current request, to use in sub classes,
    - lasso_wsf_profile_get_remote_provider_id, retrieve the SOAP
      binding corresponding information,
    - lasso_wsf_profile_get_remote_provider, simplification of
      lasso_wsf_profile_get_remote_provider_id,
    - lasso_wsf_profile_get_soap_fault, retrieve the last setted SOAP
      fault, used by sub classes,
    - lasso_wsf_profile_set_soap_fault, set a SOAP fault, to be returned
      by the next call by lasso_wsf_profile_build_soap_response_msg, to
      use in sub classes,
    - lasso_wsf_profile_set/get_status_code, set/get the stored status
      code, to use in the next lasso_xxx_build_response_message, to use
      in sub classes.
   Change name lasso_wsf_profile_get_description_autos to
   lasso_wsf_profile_get_description_auto.
   Do not access directly the session is_dirty field (it has been
   sealed).

 * lasso/id-wsf/wsf_profile.h:
   Add helper macro lasso_wsf_profile_helper_set_status to set status
   code of an ID-WSF response message containing a Status element using
   the stored status code.
 * lasso/id-wsf/wsf_profile_private.h:
   Add new fields (moved public fields).
   Add lasso_wsf_profile_set_msg_url_from_description,
   lasso_wsf_profile_build_soap_fault_response_msg.
 * lasso/id-wsf/data_service_private.h:
   Remove file.
 * lasso/id-wsf/data_service.h: Remove all public fields.
 * lasso/id-wsf/data_service.c:
   Remove private structure. Use the equivalents LassoWsfProfile private
   fields. Update documentation. Use LassoWsfProfile generic functions
   for initializing requests. Add API lasso_data_service_get_query_item,
   lasso_data_service_get_answers, lasso_data_service_get_answer,
   lasso_data_service_get_answers_by_select,
   lasso_data_service_get_answer_for_item_id,
   lasso_data_service_add_modification.
   Remove lasso_data_service_need_redirect_user use equivalent function
   lasso_interaction_profile_service_build_redirect_response_msg. Remove
   lasso_data_service_get_resource_offering,
   lasso_data_service_set_offering.
 * lasso/id-wsf/discovery.c:
   Add documentation. Change some signatures. Remove
   lasso_discovery_get_description_auto. Change name of
   lasso_discovery_init_insert to lasso_discovery_init_modify. Add a
   generic lasso_discovery_process_request_msg.
   Add internal function lasso_discovery_init_offering, to get
   automatically an offering if possible. Remove useless init_from_xml.
   Rework lasso_discovery_build_credential implementation.
   overloading. Remove lasso_discovery_destroy.
 * lasso/id-wsf/discovery.h:
   Remove lasso_discovery_destroy.
 * lasso/id-wsf/interaction_profile_service.c:
   Add lasso_interaction_profile_service_build_redirect_response_msg.
 * lasso/id-wsf/personal_profile_service.c:
   Update lasso_personal_profile_service_get_email to use
   lasso_data_service_get_answers_by_select.
 * lasso/xml/dst_modify.c:
   make modification parameter optional to the constructor.
2009-08-26 15:13:46 +00:00
Benjamin Dauvergne 3da34a1b0d ID-WSF 1.0: fix off-by one ref counting error in lasso_wsf_profile_init_soap_request
* lasso/id-wsf/wsf_profile.c (lasso_wsf_profile_init_soap_request):
   envelope is an argument, increment its ref count
   before storing it.
2009-08-26 15:13:23 +00:00
Benjamin Dauvergne e3bf5c88d5 ID-WSF 1.0: improve error recovery in lasso_wsf_profile_comply_with_saml_authentication
* lasso/id-wsf/wsf_profile.c
   (lasso_wsf_profile_comply_with_saml_authentication):
   reuse existing wsse-security element if present,
   remove useless comments, move core code after argument type checks,
   return error if enveloppe or header is missing,
   fail if any referenced assertion is missing,
   correctly handle reference count of wsse_security depending on
   the situation (new or reused).
2009-08-26 15:13:21 +00:00
Benjamin Dauvergne 52e60ecb09 Rework cleanup handling
* lasso/utils.h:
   change 'goto exit' for 'goto cleanup'. rename all goto_exit macros to
   goto_cleanup_.  rename goto_cleanup_if_fail to
   goto_cleanup_if_fail_with_rc and add a
   goto_cleanup_if_fail for function which do not return an integer
   value. add documentation for goto_cleanup macro family.
 * lasso/id-ff/login.c:
 * lasso/id-ff/provider.c:
 * lasso/id-ff/server.c:
 * lasso/id-ff/session.c:
 * lasso/id-wsf/discovery.c:
 * lasso/id-wsf/wsf_profile.c:
 * lasso/saml-2.0/profile.c:
 * lasso/utils.h:
 * lasso/xml/lib_logout_request.c:
 * lasso/xml/tools.c:
 * lasso/xml/xml.c:
   update name of goto_exit_if_fail macros. rename 'exit' labels to
   'cleanup'.
2009-04-22 23:49:29 +00:00
Benjamin Dauvergne d0d71abe2c Core: rename lasso_release_xmlchar to lasso_release_xml_string
* lasso/id-wsf/wsf_profile.c, lasso/utils.h, lasso/xml/xml.c: rename
   lasso_release_xmlchar to lasso_release_xml_string.
2009-03-27 15:05:37 +00:00
Benjamin Dauvergne dfb0b91ed6 ID-WSF 2.0: make it work with --enabe-debugging
* lasso/id-wsf-2.0/data_service.c:
 * lasso/id-wsf-2.0/discovery.c:
 * lasso/id-wsf-2.0/profile.c:
 * lasso/id-wsf/data_service.c:
 * lasso/id-wsf/discovery.c:
 * lasso/id-wsf/wsf_profile.c:
   when --enable-debugging is activated much more type checking is done
   by internal macros, and code do not pass compile anymore.
 * bindings/python/tests/idwsf2_tests.py: nameIdentifier packing in SOAP
   ID-WSF calls headers is no longer supported, do not test it.
2009-03-27 15:05:04 +00:00
Benjamin Dauvergne b09ef2e015 Core: do not mix public and private headers
* lots of files:
   explicitely load the internal header xml/private.h where needed.
2009-03-27 15:04:26 +00:00
Benjamin Dauvergne 33bbf7a7de All: Fix missing field initializer problems
* lots of files: Explicitely set all field of initialized structures,
  in order to remove -Wno-missing-field-initilizers from needed
  compiler options when using -Wall -Wextra.
2009-01-24 09:33:40 +00:00
Benjamin Dauvergne 7103e81888 Change style of error and dellocation handling
- lasso/id-ff/provider.c:
   - in lasso_provider_verify_signature use standardised memory and
     error handling macros, and also standard return code variable name
     and exit label.
   - in lasso_providerl_load_metadata_from_buffer and
     lasso_provider_load_metadata use the standardised macros, exit
     labels and return code variable.
 - lasso/id-ff/server.c:
   - in lasso_server_load_affiliation use standardised allocation and
     error handling macros.
 - lasso/id-wsf/wsf_profile.c:
   - use standardised memory and error handling macros in
     lasso_wsf_profile_build_soap_request_msg.
2008-11-04 01:58:53 +00:00
Benjamin Dauvergne 0d66367f28 Remove use of xmlFreeDoc for lasso_release_doc
- bindings/java/wrapper_top.c, bindings/php4/lasso_php4_helper.c,
    bindings/php5/wrapper_source_top.c, bindings/python/wrapper_top.c,
    lasso/id-ff/identity.c, lasso/id-ff/lecp.c, lasso/id-ff/login.c,
    lasso/id-ff/logout.c, lasso/id-ff/name_registration.c,
    lasso/id-ff/profile.c, lasso/id-ff/provider.c, lasso/id-ff/server.c,
    lasso/id-ff/session.c, lasso/id-wsf-2.0/data_service.c,
    lasso/id-wsf/data_service.c, lasso/id-wsf/discovery.c,
    lasso/id-wsf/wsf_profile.c, lasso/saml-2.0/ecp.c,
    lasso/saml-2.0/login.c, lasso/saml-2.0/name_id_management.c,
    lasso/utils.h, lasso/xml/tools.c, lasso/xml/xml.c, swig/Lasso.i:
    Remove use of xmlFreeDoc. Use lasso_release_doc instead.
2008-11-04 01:58:49 +00:00
Damien Laniel 7290225b00 cleaned up some code 2008-10-01 10:25:52 +00:00
Damien Laniel 2599e7abb8 fixed segfaults 2008-10-01 09:55:40 +00:00
Damien Laniel 6b9a265102 fixed docstrings which fucked php5 binding 2008-09-17 08:32:01 +00:00
Damien Laniel a18ddb94e0 fixed various bugs with new compilation flags 2008-09-16 16:31:05 +00:00
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +00:00
Benjamin Dauvergne 68b0b87602 Fix changed name of g_assign_string in wsf_profile.c 2008-08-26 12:49:00 +00:00
Benjamin Dauvergne 207891ff29 * Fix blanks mismatch (space in *.c and *h files or tabs in *.py files) and formatting 2008-08-05 14:53:29 +00:00
Benjamin Dauvergne 0930e6046f * Fix typo 2008-08-05 14:52:50 +00:00
Benjamin Dauvergne fa9931c9eb * add Deprecated marker to documentation. 2008-08-05 14:52:36 +00:00
Benjamin Dauvergne 2d18a0d3f8 * Fix potential memory leaks
* id-wsf/wsf_profile.c: add error code path in
  lasso_wsf_profile_build_soap_request_msg for unsupported
  security mechanisms.
2008-08-05 14:52:34 +00:00
Benjamin Dauvergne d012fcfd52 change last g_* macros to lasso_ prefix 2008-08-05 14:52:26 +00:00
Benjamin Dauvergne b9b65ed9fc * change g_list_add* to lasso_list_add* 2008-08-05 14:52:23 +00:00
Benjamin Dauvergne fd1294504f change g_assign_* to lasso_assgin_* and g_release_* to lasso_release_* 2008-08-05 14:52:20 +00:00
Benjamin Dauvergne b449c26f5a * remove blanks (review by F. Peters) 2008-08-05 14:52:18 +00:00
Benjamin Dauvergne 26a0b96f29 * remove body->id and correlation->id setup, no need to set id on everything. 2008-08-01 14:11:59 +00:00
Benjamin Dauvergne d82175f993 Match is:RedirectRequest and set msg_url to the url to redirect to 2008-08-01 14:11:49 +00:00
Benjamin Dauvergne 905f718a36 add assertion_id to TokenSecurityReference 2008-08-01 14:11:30 +00:00
Benjamin Dauvergne 0aa45087ad * lasso/id-wsf/wsf_profile.c:
- change return code variable from 'ret' to 'rc' to permit use of
   standardised macros like goto_exit_if_fail.
 - add initialization to NULL of lot of variables, to enable error return
   paths.
 - adapt to change bo soap:Body id field to its new name 'Id'
 - fix numerous mem leaks by using assignment macros (g_assign_gobject,
   g_list_add_gobject) and release macros (g_release_gobject).
2008-08-01 14:11:23 +00:00
Benjamin Dauvergne 33ac0485ad * lasso/id-wsf/wsf_profile.c: In lasso_wsf_profile_set_security_mech_id if
security_mech_id is NULL, default to LASSO_SECURITY_MECH_NULL.
  In lasso_wsf_profile_init_soap_request increment ref count of the argument
  when new reference are created.
2008-08-01 14:10:52 +00:00
Benjamin Dauvergne 605b1b38e6 * lasso/id-wsf/wsf_profile.c: fix wrong namespace in a call to xmlSecFindNode 2008-08-01 14:10:42 +00:00
Benjamin Dauvergne a28637d091 * lasso/id-wsf/wsf_profile.c: implement creation of the signature for ID-WSF
SAML security mechanism. Implemented many utility function that could be shared
  with other part of the library.
2008-08-01 14:10:39 +00:00
Benjamin Dauvergne e9403b8f71 * lasso/id-wsf/wsf_profile.c: add documentation to the function lasso_wsf_profile_set_resource_offering: 2008-08-01 14:10:31 +00:00
Benjamin Dauvergne 2310313cb1 * lasso/id-wsf/wsf_profile.c,wsf_profile.h,wsf_profile_private.h: add const modifier to signature when possible 2008-08-01 14:10:29 +00:00
Benjamin Dauvergne 558bdb7074 move session storage of assertion for SAML ID-WSF authentication of request to xmlNode instead of LassoNode; add error handling when no description has been found in comply_with_saml_authentication 2008-08-01 14:09:49 +00:00
Benjamin Dauvergne e4fda38df5 beginning of signature implementation for SAML authentication 2008-08-01 14:09:47 +00:00
Benjamin Dauvergne 0e6b3cd72e fix naming in documentation of lasso_wsf_profile_set_description_from_offering, add new private function lasso_wsf_profile_set_resource_offering 2008-08-01 14:09:44 +00:00