Commit Graph

38 Commits

Author SHA1 Message Date
Benjamin Dauvergne 0289da907f python: add a failure label to method wrappers (#44287)
To separate wrapping code from unwinding and error handling code.
2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 35682272ec python: add macro for early return (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne 9db28c0c32 python: simplify get_logger_object (#44287) 2020-10-12 15:24:11 +02:00
Benjamin Dauvergne a8f82e67ef python: fix warning about discarded const modifier (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 637514a874 python: replace exception by warning on logging path (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 8ae9d3a09b python: use simpler call format to prevent warning about PY_SSIZE_T_CLEAN (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 11bc68bbbc python: remove deprecated PyErr_Warn (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne a1dbd489fc python: remove unused PyString_Size (#44287) 2020-10-12 15:24:10 +02:00
Benjamin Dauvergne 187b4b1b28 python: route logs for libxml2 and libxmlsec2 to their own logger 2018-04-29 19:59:56 +02:00
Benjamin Dauvergne 81fad67ad2 saml-2.0: improve support for free content inside samlp2:Extensions (fixes #18581)
Four new accesors:

	lasso_samlp2_extensions_get_any
	lasso_samlp2_extensions_set_any
	lasso_samlp2_extensions_get_attributes
	lasso_samlp2_extensions_set_attributes

The two new pseudo field are fully supported in the python binding.

	node = lasso.Samlp2Extensions()
	node.any = '<test>ok</test>'
	node.attributes = {'{http://entrouvert.org/}attribute1': 'value'}
	print node.dump()
2017-09-11 15:14:41 +02:00
Benjamin Dauvergne a231eaff33 Make python generator scripts and tests run with python >= 3.2 2015-02-12 19:21:13 +01:00
Houzéfa Abbasbhay 8938f87220 Python 3: Fix the pygobject init macro and restore it 2015-02-12 19:21:13 +01:00
Houzéfa Abbasbhay 70b9d765bc Python 3: Fix a string function 2015-02-12 19:21:12 +01:00
Houzéfa Abbasbhay e4ebeefab3 Python 3: PyObject_HEAD_INIT(NULL) -> PyVarObject_HEAD_INIT(NULL, 0)
(to play better with C strict aliasing rules - see PEP 3123)
2015-02-12 19:21:11 +01:00
Houzéfa Abbasbhay 25d2cec7ab Python 3: Defs for int & string related functions 2015-02-12 19:21:11 +01:00
Houzéfa Abbasbhay e315898e24 Python 3: PyObject.ob_type is deeper in the structure; use the Py_TYPE
macro instead
2015-02-12 19:21:11 +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
Benjamin Dauvergne 0e0511c686 [binding python] prevent warning in wrapper_top.c under hardy with gcc 4.2.4 2011-11-18 15:36:41 +01:00
Benjamin Dauvergne 3534792285 [Bindings] accept simple string in string<->xmlNode converter
Some use case ask for passing simple libxml content node (i.e just an
UTF-8 string) when a method argument or a field of the xmlNode* type.
This commit add a static method in bindings/utils.c named
lasso_string_fragment_to_xmlnode which does this transform by trying to
parse an XML document then by trying to parse a well balanced XML
fragment of only one node (if there is more than one node such as in the
string " xxx <tag/> yyy ", we free the node list and return NULL).
2010-06-29 14:15:08 +00:00
Benjamin Dauvergne fbb0ef52ee Binding python: find a work around for random behaviour of PyImport_ImportModule
* it seems that PyImport_ImportModule is not deterministic. Sometimes it
   returns True for modules which we know are present ('logging').
   Importing 'sys' first seems to make 'logging' accessible (complete
   cargo cult programming).
2010-06-12 00:43:51 +00:00
Benjamin Dauvergne 94377b822f Binding python: fix bad refcounting in get_logger and lasso_python_log 2010-06-12 00:42:58 +00:00
Benjamin Dauvergne 72361f16b3 Binding python: if lasso.logger exists use it for logging
* There is now two paths to get a logger in the python binding:
   - first try to get an objet from lasso.logger
   - if it doesn't exist or is None, the try logging.getLogger('lasso')
2010-06-10 07:58:14 +00:00
Benjamin Dauvergne 05b537876b Binding python: add GLog handler to redirect logs to Python logger named "lasso"
* fixes #20
2010-06-09 16:54:50 +00:00
Benjamin Dauvergne 8447c5549c Binding python: for empty GList return empty tuples, not None 2010-04-06 13:11:02 +00:00
Benjamin Dauvergne 0c67831f55 Bindings: use lasso_return_xxx macros instead of GLib ones 2010-02-01 19:50:09 +00:00
Benjamin Dauvergne 1dab7b59e5 Bindings: java, php5, python simplify logic in binding generator
* use utils.h macros to manipulate fields.
 * use utils.py function to filter variables, argument and return types.
 * finish support of hashtables of strings for php5 and python.
2010-01-28 15:31:49 +00:00
Benjamin Dauvergne ade4c7ed11 Python binding: add a pyobject->time_t conversion function 2010-01-04 09:13:40 +00:00
Benjamin Dauvergne 0f3a963399 Bindings python: in wrapper_top.c, mark internal function as potentially unused 2010-01-04 09:13:39 +00:00
Benjamin Dauvergne 28bf7912f0 Python Binding: fix bug of uninitialized ppos argument to PyDict_Next
* bindings/pyhton/wrapper_top.c (set_hashtable_of_pygobject):
   second argument (int*ppos) of PyDict_Next must be reinitialized to
   zero before each traversal (see Python C API
   http://docs.python.org/c-api/dict.html).

   Patch from Iban Rodríguez of the Desarrollo de Producto Electrónico,
   Spain.
2009-06-15 12:38:16 +00:00
Benjamin Dauvergne 7e4a554d61 Fix leak in python binding
* bindings/python/wrapper_top.c:
   keep a pointer on beginning of list to free it.
2009-04-30 14:58:23 +00:00
Jerome Schneider 827d79af7c Fix python 2.4 binding build 2009-04-17 14:12:43 +00:00
Jerome Schneider 699f72e568 Fix build issues on amd64 / gcc 4.3
* bindings/java/lang.py:
  fix cast issue
* bindings/python/wrapper_top.c
  fix type issue
* lasso/registry.c
  fix cast issue
2009-04-09 16:55:39 +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 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
Benjamin Dauvergne ef42f2cbc8 add functionality to enable debugging flags at runtime
This code permit to set flags, separated by commas, space,
tabulations, or colons. This flags activates debug functions like,
suppressing validations of signatures or print debugging message about
deallocations.

The new flags are defined in /lasso/debug.h they can be set using an
environment variable named LASSO_FLAG or a function named
lasso_set_flag.

There are two flags currently:
- verify-signature:
  To deactivate it, pass 'no-verify-signature' inside LASSO_DEBUG.
  It desactivate signature verification, inside two functions:
  lasso_query_verify_signature and lasso_provider_verify_signature.
- memory-debug:
  It enabled reporting of memory deallocation inside generic memory
  dellaocator for LassoNode objects and also in bindings.

- lasso/xml/xml.c: do not free a null hash table pointer.
2008-10-01 10:31:58 +00:00
Benjamin Dauvergne 9ed0670e48 * Remove ending blanks 2008-09-12 15:06:58 +00:00
Benjamin Dauvergne dd81d97761 * Add G_GNUC_UNUSED for unused parameter we can't remove (python wrappers). 2008-09-12 13:57:32 +00:00
Benjamin Dauvergne 1fae093527 Move all python binding related files inside the python subdirectory 2008-08-05 14:52:52 +00:00