Commit Graph

132 Commits

Author SHA1 Message Date
Benjamin Dauvergne a041a2ef81 Initialize all uninitialized rc variables 2010-04-30 09:23:01 +00:00
Benjamin Dauvergne 2f5ef5fef0 Improve safety by replacing all g_list_free use by lasso_release_list 2010-04-22 00:44:57 +00: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 19b7cc0bbc ID-WSF: change name of Personal Profile namespace symbols, add symbols for ID-SIS PP 1.1 2010-01-28 15:31:52 +00:00
Benjamin Dauvergne fa9566aa59 Core: fix gtk-doc annotations 2010-01-28 15:31:43 +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 1c8c8a4688 ID-WSF: in discovery.c:lasso_discovery_init_resource_offering, add doc annotations, use assignment macros to set output argument 2010-01-04 09:14:48 +00:00
Benjamin Dauvergne 02a2b92f92 ID-WSF: in discovery.c, update documentation annotations
* lasso/id-wsf/discovery.c:
   - add annotations to lasso_discovery_init_query,
     lasso_discovery_init_modify, lasso_discovery_process_request_msg.
   - initialize response in lasso_discovery_process_query_mesg and
     lasso_discovery_process_modify_msg, so that modifications of the
     response can be done between _process_ and _build_ calls.
2010-01-04 09:14:46 +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 d4e28010be ID-WSF 1.0: fix memory leak
* lasso/id-wsf/discovery.c (lasso_discovery_add_insert_entry):
   the rule is that callee is responsible for becoming owner of a resource,
   so no g_object_ref before a call on an argument.
2009-08-26 15:13:18 +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 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
Damien Laniel 5aafc13002 documentation-related fixes 2009-01-26 16:42:19 +00:00
Damien Laniel fad3fa581b added documentation for id-wsf 2.0 functions 2009-01-26 16:10:24 +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
Damien Laniel 5a51211f40 fixed fault code and use a more precise fault string 2008-12-12 16:48:18 +00:00
Damien Laniel 6fa7664794 if no identity is found while building disco response, create a soap fault response 2008-12-12 16:29:57 +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 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 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 eeca0e7f01 * remove useless code 2008-08-05 14:52:39 +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 e12388204e polish code in lasso_discovery_build_credential 2008-08-01 14:12:06 +00:00
Benjamin Dauvergne 2be854e07e * lasso/id-wsf/discovery.c: fix macros assign_resource_id to adapt to standard return code name: rc 2008-08-01 14:11:17 +00:00
Benjamin Dauvergne 89bcfd78bf * lasso/id-wsf/discovery.c:
(lasso_discovery_build_credential, lasso_discovery_add_remove_entry,
  lasso_discovery_add_requested_service_type) use macro g_list_add, to reduce
  code size.
2008-08-01 14:10:54 +00:00
Benjamin Dauvergne 9d1fd3c23e fix wrong const modifier 2008-08-01 14:10:45 +00:00
Benjamin Dauvergne ca2828a8f7 * lasso/id-wsf/discovery.c: In lasso_discovery_get_resource_offering_auto, do
not increment reference count of the returned value, it is not how it is done
in the rest of the library. Returned gobject are always not-owned reference,
you reference them only to keep them around.
2008-08-01 14:10:23 +00:00
Benjamin Dauvergne 36e234627a start rework of lasso_discovery_init_request, my intention is to base toher init_ function on this one 2008-08-01 14:10:08 +00:00
Benjamin Dauvergne 4d2d8552dc fix a reference counting error when building response message 2008-08-01 14:10:05 +00:00
Benjamin Dauvergne 80a031f3ac add documentation to lasso/id-wsf/discovery.c 2008-08-01 14:10:02 +00:00
Benjamin Dauvergne 373a9de324 instead of moving assertion from session to new sessions, reference the old session in newly created ID-WSF services proxy 2008-08-01 14:09:52 +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 4113e7c5af add a lasso_discovery_new_full function 2008-08-01 14:09:40 +00:00
Benjamin Dauvergne ae7f4f7424 deprecated lasso_discovery_init_modify 2008-08-01 14:09:38 +00:00
Benjamin Dauvergne 76d9fce5d5 forked lasso branch for adeline 2008-08-01 14:08:54 +00:00
Benjamin Dauvergne bbd7e083b2 * lasso/id-wsf/discovery.c:
- include utils.h
 - move lasso_wsf_profile_build_key_info_node here
 - add a comment for future review of lasso_discovery_build_credential
 - remove direct use of lasso_wsf_profile_build_soap_envelope, use
   lasso_wsf_profile_init_soap_request instead.

* lasso/id-wsf/utils.{c,h}:
 - new file with security mech id matching functions

* lasso/id-wsf/wsf_profile.c:
 - remove all credentials related static functions
 - empty all credentials related public functions
 - move function related to matching security mechanism into utils.{c,h} and
   xml/disco_description.h
 - add static function lasso_wsf_profile_comply_with_saml_authentication that
   tries to add credential to the request to a web service using the SAML
   WS-Security mechanism
 - add static function lasso_wsf_profile_comply_with_security_mechanism to
   dispatch upon the current chosen securirt mechanism.
 - extract build_soap_envelope to the static function
   build_soap_envelope_internal to remove warning of usage of a deprecated
   function.
 - remove lasso_wsf_profile_set_public_key
 - remove lasso_wsf_profile_set_security_mech_id
 - add lasso_wsf_profile_get_security_mechanism
 - add lasso_wsf_profile_set_description
 - empty function about online status of the principal
 - remove all (non-working) handling of the x509 security mechanism
 - add a new constructor function
 LassoWsfProfile* lasso_wsf_profile_new_full(LassoServer *server, LassoDiscoResourceOffering *offering)
 - and a new init function (for subclass):
 gint lasso_wsf_profile_init(LassoWsfProfile *profile, LassoServer *server, LassoDiscoResourceOffering *offering)

* lasso/id-wsf/wsf_profile.h:
 - mark as deprecated:
 lasso_wsf_profile_move_credentials
 lasso_wsf_profile_build_soap_envelope
 lasso_wsf_profile_set_provider_soap_request
 lasso_wsf_profile_principal_is_online
 lasso_wsf_profile_add_credential
 lasso_wsf_profile_set_principal_status
 lasso_wsf_profile_set_principal_online
 lasso_wsf_profile_set_principal_offline

* lasso/id-wsf/wsf_profile_private.h:
 - remove fields from LassoWsfProfilePrivate structure:
  - GList *credentials;
  - gchar *public_key;
 - add fields:
  - char *security_mech_id;
  - LassoDiscoResourceOffering *offering;
2008-08-01 14:08:41 +00:00
Benjamin Dauvergne ed41e73e77 * lasso/id-wsf/discovery.c: repurpose lasso_discovery_process_query_response_msg
in order to extract credentials informations and store them into
  the current session.
* lasso/id-wsf/wsf_profile.c: Remove any high-level processing from
  lasso_wsf_profile_process_soap_response_msg, just parse and setup
  the corresponding fields into the structure. Eventually signal a
  SOAP using a return code.
2008-08-01 14:08:17 +00:00
Benjamin Dauvergne a3de484677 rebase to trunk 2008-08-01 14:08:12 +00:00
Benjamin Dauvergne f46f9a0bcf add methods to handle the registry of WsfProfile constructors
- private: {lookup,remove,set}_registry handle access to the registry
 - public: lasso_discovery_[un]register_constructor_for_service_type
	gives access to this registry to other classes.

Conflicts:
2008-08-01 14:07:06 +00:00
Benjamin Dauvergne 273e6c2803 change return type of lasso_discovery_get_service (kein direct user in the rest of the code) 2008-08-01 14:06:59 +00:00
Benjamin Dauvergne 6bd8540bc2 polish code in lasso_discovery_build_credential 2008-08-01 14:06:57 +00:00
Benjamin Dauvergne c633afc3fd use lasso_discovery_build_wsf_profile commodity method in lasso_discovery_get_service(s) methods. 2008-08-01 14:06:55 +00:00
Frédéric Péters 2b9220186a removing unused variable 2008-05-20 20:21:16 +00:00
Damien Laniel 7860262cf6 some cleanups in id-wsf 1.1 code 2008-05-20 13:14:06 +00:00