Commit Graph

301 Commits

Author SHA1 Message Date
Benjamin Dauvergne 4a880977d1 Remove ID-WSF 1.0, 2.0 and WS-* support (#56644)
It has been deprecated for a long time.
2021-09-11 18:54:41 +02:00
Benjamin Dauvergne 3d6bc26021 docs: update gtk-doc-tools integration (#50441)
Using reference documentation on https://developer.gnome.org/gtk-doc-manual/stable/index.html.en
2021-02-24 23:13:49 +01:00
Thomas NOËL 18cc55d773 docs/xsltproc: do not use Internet to fetch DTDs, entities or documents (#35590) 2019-08-27 11:03:58 +02:00
John Dennis 3d9d58d52c Make more Python scripts compatible with both Py2 and Py3
While porting other Python code in the repo to run under Py3 (as well
as Py2) it was discovered there were a number of other Python scripts
which also needed porting. However these scripts are never invoked
during a build so there was no easy way to test the porting work. I
assume these scripts are for developers only and/or are
historical. Because there was no way for me to test the porting
changes on these scripts I did not want to include the changes in the
patch for the Py3 porting which fixed scripts that are invoked during
the build (the former patch is mandatory, this patch is optional at
the moment). I did verify the scripts compile cleanly under both Py2
and Py3, however it's possible I missed porting something or the error
does not show up until run-time.

Examples of the required changes are:

* Replace use of the built-in function file() with open().  file()
  does not exist in Py3, open works in both Py2 and Py3.  The code was
  also modified to use a file context manager (e.g. with open(xxx) as
  f:). This assures open files are properly closed when the code block
  using the file goes out of scope. This is a standard modern Python
  idiom.

* Replace all use of the print keyword with the six.print_()
  function, which itself is an emulation of Py3's print function. Py3
  no longer has a print keyword, only a print() function.

* The dict methods .keys(), .values(), .items() no longer return a
  list in Py3, instead they return a "view" object which is an
  iterator whose result is an unordered set. The most notable
  consequence is you cannot index the result of these functions like
  your could in Py2 (e.g. dict.keys()[0] will raise a run time
  exception).

* Replace use of StringIO.StringIO and cStringIO with
  six.StringIO. Py3 no longer has cStringIO and the six variant
  handles the correct import.

* Py3 no longer allows the "except xxx, variable" syntax, where
  variable appering after the comma is assigned the exception object,
  you must use the "as" keyword to perform the variable assignment
  (e.g. execpt xxx as variable)

* Python PEP 3113 removed tuple parameter unpacking. Therefore you can
  no longer define a formal parameter list that contains tuple
  notation representing a single parameter that is unpacked into
  multiple arguments.

License: MIT
Signed-off-by: John Dennis <jdennis@redhat.com>
2018-07-24 11:03:09 +02:00
John Dennis 4544ea9e9d Add function to set protocol conformance
Lasso uses an internal private variable bound to the provider to
indicate which protocol the provider is servicing. It is vital this
value be correctly set because many Lasso routines used it to dispatch
to the appropriate protocol handlers.

Normally the provider's protocol conformance is set as a side-effect
of parsing the XML metadata that describes the provider (e.g. an SP or
IdP). However there are some providers (e.g. an ECP client) which do
not have metadata. For providers lacking metadata it is essential
there be a mechanism to set the protocol conformance otherwise the
library will malfunction.

The function comes with documentation that includes a clear warning
this is to be used only in limited circumstances.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis 1c31736ded Implement ECP client functionality
Implement everything needed to support a SAMLv2 ECP client.

Re-implement lasso_ecp_process_authn_request_msg() and
lasso_ecp_process_response_msg() to use the Lasso XML serialization
subsystem with the ECP and PASO LassoNode's introduced earlier. This
replaces one-off explicit direct use of the libxml API with Lasso
common code. In the process provide support for 100% of the ECP and
PAOS SAMLv2 parameters, not just a subset. Include support for
receiving an IDPList from the SP in conjuction with selecting an IdP
known to the ECP client. Add extensive documentation.

Modify LassoSamlp2AuthnRequest to preserve it's original XML (enable
keep_xmlnode flag) so that when serializing the SOAP request the
LassoSamlp2AuthnRequest received from the SP is exactly duplicated.

Add the following internal static utility functions:

is_provider_in_sp_idplist()
is_idp_entry_in_entity_id_list()
intersect_sp_idplist_with_entity_id_list()

Add the following exported utility functions:

lasso_ecp_is_provider_in_sp_idplist()
lasso_ecp_is_idp_entry_known_idp_supporting_ecp()
lasso_ecp_set_known_sp_provided_idp_entries_supporting_ecp()
lasso_ecp_has_sp_idplist()
lasso_ecp_get_endpoint_url_by_entity_id()
lasso_ecp_process_sp_idp_list()

Add the following members to the ECP class:

message_id
response_consumer_url
relaystate
issuer
provider_name
is_passive
sp_idp_list
known_sp_provided_idp_entries_supporting_ecp
known_idp_entity_ids_supporting_ecp

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis 75b0284c8e Clean up ECP and PAOS XML generation
Re-implement lasso_node_export_to_ecp_soap_response() and
lasso_node_export_to_paos_request(). Add new function
lasso_node_export_to_paos_request_full() with full functionality which
deprecates lasso_node_export_to_paos_request().

The existing code had two significant deficiencies, it performed
explicit direct xml manipulation using the libxml API rather than
calling into Lasso's extensive XML utilities, this was in stark
contrast the rest of the Lasso library. It also failed to handle a
number of ECP parameters leaving a functionality gap in the API.

The new code makes use of the Lasso XML serialization
subsystem. Rather than hand crafted xml manipulation we use the ECP
and PAOS LassoNode objects introduced in an earlier patch. This is
consistent with the rest of Lasso and because those LassoNodes are
used elsewhere we have a better guarantee of robustness because the
same common code is being called from multiple places. Other Lasso
common utilities (some introduced in previous patches) are invoked
instead of handcrafted xml manipulation, once again common code is
preferred.

Finally lasso_node_export_to_paos_request_full() was introduced to
expose in the Lasso API all ECP
parameters. lasso_node_export_to_paos_request() now trivially calls
into lasso_node_export_to_paos_request_full().

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis 6102c73fd7 Server utility returns list of providers supporting endpoint type
Add lasso_server_get_filtered_provider_list() utility.

Iterate over the server providers and build a list of provider EntityID's who
have the specified role and at least one endpoint matching the
protocol_type and http_method. Return a GList list of EntityID's

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis 237b7424bd Add server utility lasso_server_get_endpoint_url_by_id()
Locate the provider in the server's list of providers, then select an
endpoint given the @endpoint_description and return that endpoint's URL.
If the provider cannot be found or if the provider does not have a
matching endpoint NULL will be returned.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis a7a54cabad Export LassonNode to SOAP with arbitrary SOAP headers
Add function lasso_node_export_to_soap_with_headers()

Utility function to build a full SOAP envelope message with arbitrary
headers. The LassoNode becomes the body of the SOAP envelope. The
headers are passed as a GList of LassoNode's and are added as header
elements to the SOAP envelope header. This is a flexible way to build
a SOAP envelope that contains headers without constraints on the
headers.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis 9629925c1e Add LassoNode objects for ECP and PAOS
The SAMLv2 protocol defines 5 XML types which we need to map to
LassoNode objectes so thay can be serialized from XML and back into
XML.

ecp:RelayState
ecp:Request
ecp:Response
paos:Request
paso:Response

This patch addes these 5 new LassoNode's and updates the build
configuration to include them.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis a0909e732f Add new LassoSoapEnvelope constructor, lasso_soap_envelope_new_full()
The existing LassoSoapEnvelope constructors did not populate the node
with it's constituent members, namely a SOAP header (LassoSoapHeader)
and a SOAP body (LassoSoapBody). lasso_soap_envelope_new_full() allows
one to create a SOAP envelope and immediately begin to add header and
body elements.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
Benjamin Dauvergne fd10b952a8 doc: add lasso_server_add_provider2 and lasso_server_load_metadata 2014-08-12 10:11:33 +02:00
Simon Josefsson ced1f047c2 fix pkg-config typo. 2014-08-11 09:12:42 +02:00
Benjamin Dauvergne ce3cab2e5a docs: remove section 2014-01-07 01:15:43 +01:00
Frédéric Péters b30e2463a7 doc: remove broken gtk-doc tests for now 2013-12-06 02:13:03 +01:00
Frédéric Péters ff0b9ba8d4 doc: remove reference to init.xml that is not created anymore 2013-12-05 18:21:10 +01:00
Benjamin Dauvergne 078831bd0e docs/Makefile: always set DIST_SUBDIRS 2013-09-26 15:48:39 +02:00
Benjamin Dauvergne 72e1558b21 Revert "doc: fix EXTRA_DIST definition in reference/lasso/Makefile.am"
This reverts commit a223afc607.
It seems to be incompatible with recent version of gtk-doc, I need to
investigate more this problem.
2013-08-27 01:08:48 +02:00
Benjamin Dauvergne a223afc607 doc: fix EXTRA_DIST definition in reference/lasso/Makefile.am 2013-08-27 00:06:20 +02:00
Benjamin Dauvergne f48cd5bbcf Merge remote-tracking branch 'origin/libxml2.9-compat' 2013-07-30 15:31:26 +02:00
Benjamin Dauvergne 1ebcc767a9 Fix distcheck build problem in docs/Makefile.am
Bug introduced in commit e97a36fa
2013-01-25 18:29:34 +01:00
Benjamin Dauvergne 267f91a5ca fix warning in docs/reference/lasso/Makefile.am 2013-01-25 18:29:27 +01:00
Benjamin Dauvergne bd0f935a24 Rewrite all xmlNode serialization code to be compatible with libxml 2.9.0
Libxml stopped exposing the internal of the xmlOutputBuffer structure;
it was replace by proper use of the API and of the xmlBuffer structure.

There could be regression for older version of libxml as some functions
appeared in recent version of libxml; but the reference API document
does not give any introduction date for functions so it's hard to be
sure.
2012-09-28 22:58:24 +02:00
Frédéric Péters e97a36faac Allow building from git without gtk-doc installed 2012-04-23 09:39:55 +02:00
Benjamin Dauvergne 3dca5c2afa [doc] do some documentation fixing 2011-12-22 18:21:12 +01:00
Benjamin Dauvergne 3e87282db3 [docs lasso-book] add figures to the tarball 2010-10-06 18:43:57 +02:00
Benjamin Dauvergne e2611e16d6 [docs] update copyright years 2010-10-06 17:00:18 +02:00
Benjamin Dauvergne a87ed1af5c [Documentation] add missing declaration to lasso-sections.txt 2010-07-21 14:14:49 +00:00
Benjamin Dauvergne 05e49cc37e [Core] remove now useless .cvsignore files 2010-07-21 14:12:06 +00:00
Benjamin Dauvergne ec435d244a [Doc] move style.css to the reference directory, and add it to EXTRA_DIST 2010-07-21 13:56:50 +00:00
Benjamin Dauvergne 6f617027e9 Merge branch 'issue-86' 2010-06-29 09:15:00 +00:00
Benjamin Dauvergne 49deb1ffcb SAMLv2: rename lasso_saml2_name_id_build_persistent to lasso_saml2_name_id_new_with_persistent_format
* keep the old one for compatibility
 * new one will be picked by bindings as a constructor
2010-06-12 00:43:20 +00:00
Benjamin Dauvergne ad081094e9 Documentation: add new AssertionQuery methods to documentation 2010-06-10 21:26:06 +00:00
Benjamin Dauvergne 0986fa439a Core: add method lasso_server_set_encryption_private_key_with_password
* fixes #91.
2010-06-10 13:38:02 +00:00
Frédéric Péters 4c130d779a Add new lasso_log_set_handler and lasso_log_remove_handler functions
They are modeled around the g_log... functions of GLib, they just don't
have a domain parameter.
2010-06-09 07:51:52 +00:00
Benjamin Dauvergne ba68d3a7fd SAML 2.0 Helper: add lasso_saml2_assertion_set_one_time_use 2010-05-01 05:40:38 +00:00
Benjamin Dauvergne 5ba5b4634e Add a lasso_profile_get_signature_status method 2010-05-01 05:40:31 +00:00
Benjamin Dauvergne 05aad98ec3 Fix documentation problems 2010-04-19 11:30:35 +00:00
Benjamin Dauvergne 81c35bbe2e Ameliorate support for lasso_profile_set_signature_verify_hint
* lasso/id-ff/profile.h:
   - add end symbol for enum LassoProfileSignatureVerifyHint
 * lasso/id-ff/profile.c:
   - fix documentation of lasso_profile_set_signature_verify_hint
   - do not allow to set or return invalid value for the
     signature_verify_hint attribute.
 * lasso/saml-2.0/login.c:
   - handle new enum value
 * lasso/saml-2.0/profile.c:
   - handle new enum value
   - fix missing catch of signature error reporting when
     signature_verify_hint is IGNORE.
 * docs/reference/lasso/lasso-sections.txt:
   - export enums LassoProfileSignatureHint and
     LassoProfileSignatureVerifyHint
 * tests/metadata_tests.c:
   - fix test of all Role enumerations
2010-04-16 15:37:17 +00:00
Benjamin Dauvergne ff911847a7 Docs: add/remove symbols from lasso-sections.txt 2010-04-06 13:11:42 +00:00
Benjamin Dauvergne 7db0387f5a ID-WSF 2.0 Data Service: new accessor, fix use of build_unique_id, change init_response to validate_request 2010-04-06 13:11:14 +00:00
Benjamin Dauvergne c07cd3898c SAML 2.0&ID-FF 1.2: simplify and complete metadata loading for multi-role support 2010-03-27 16:52:04 +00:00
Benjamin Dauvergne 688700f5b3 Doc: add all missing methods to documentation section file
* add missing LASSO_EXPORT too for functions already present in the
   documentation, but not exported previously.
2010-03-27 16:51:57 +00:00
Benjamin Dauvergne d5994b2bae Add signature_verify_hint accessor methods to LassoProfile
* lasso/id-ff/profile.{c,h}:
   add a LassoProfileSignatureVerifyHint enumeration and two accessor
   methods:
    - lasso_profile_get_signature_verify_hint
    - lasso_profile_set_signature_verify_hint
 * lasso/id-ff/profileprivate.h:
   add private field signature_verify_hint.
2010-03-27 16:51:34 +00:00
Benjamin Dauvergne 8598c1327a Core: add a level argument to lasso_xmlnode_to_string and _lasso_node_export_to_xml 2010-03-02 11:57:29 +00:00
Benjamin Dauvergne 887da70933 SAML 2.0: add more accessors for Conditions
* lasso/saml-2.0/saml2_helper.{c,h}:
   distribute code from lasso_saml2_assertion_validate_conditions to
   lasso_saml2_assertion_validate_time_checks and
   lasso_saml2_assertion_validate_audience.
   add lasso_saml2_assertion_allows_proxying and
   lasso_saml2_assertion_allows_proxying_to, to respectively check for
   proxying of the current assertion, and for proxying to a specific
   provider (you must call both of them to test completely the proxying
   status of an assertion).
 * docs/reference/lasso/lasso-sections.txt:
   reference new functions into documentation.
2010-02-22 13:30:48 +00:00
Benjamin Dauvergne c51e61a5ed Documentation: add example to LassoLogout, fix bad markup in id-wsf-2.0/profile.c 2010-02-17 16:08:35 +00:00
Benjamin Dauvergne 2224370d82 ID-WSF 2.0 Documentation: update lasso-sections.txt with LassoIdWsf2Profile methods 2010-02-17 10:14:34 +00:00
Benjamin Dauvergne e48619174b Documentation: fix typos in saml2_strings.h documentation, add new string symbols to lasso-sections.txt 2010-02-10 17:07:05 +00:00