Commit Graph

43 Commits

Author SHA1 Message Date
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 efc5429cfc Python 3: Fix a string conversion helper 2015-02-12 19:21:12 +01:00
Houzéfa Abbasbhay 4c79280ed8 Python 3: Fix Python 2 support (use six.print_) 2015-02-12 19:21:12 +01:00
Houzéfa Abbasbhay e5d5acf9df Python 3:
- file(...) -> open(...)
- print ... -> print(...)
- print >> fd, ... -> print(..., file=fd)
- basestring -> str
- map(...) -> list(map(...))
2015-02-12 19:21:11 +01:00
Benjamin Dauvergne c3d451559a bindings/python: fix conversion of unicode value to UTF-8 for setters 2014-05-28 09:13:34 +02:00
Simo Sorce 7a36f17982 Fix generators for parsing of integer values
All number types including enums are parse as if they were integers,
this breaks in many ways, long and int are not the same size in all
architectures as well as enum may vary in size depening on compiler,
architecture and optimizations.

Always pass an actual long to PyArg_ParseTuple() and rely on the a
cast from long to the destination variable type in the following
assignment.

Signed-off-by: Simo Sorce <simo@redhat.com>
2014-04-23 15:40:27 +02:00
Benjamin Dauvergne 309a9ab6bc bindings/python: automatically encode string into utf-8 when passing unicode string to Lasso methods
fixes #4077
2013-12-11 15:35:17 +01:00
Simo Sorce 3a6b2fdee7 Fix license boilerplates
Instad of referring to an old FSF address, point the reader to the FSF
website where the latest licenses and addresses are published.

Signed-off-by: Simo Sorce <simo@redhat.com>
2013-12-03 21:55:06 +01:00
Frédéric Péters 080548538d python: do not fail displaying a non-C error (fixes #3866)
The binding does a raise Error('failed to create object') but the local Error
exception class expects a lasso error code, and will thus fail if printed.

  File ".../lasso.py", line 54, in __str__
    return '<lasso.%s(%s): %s>' % (self.__class__.__name__, self.code,
             _lasso.strError(self.code))
  TypeError: an integer is required
2013-10-23 17:38:39 +02:00
Benjamin Dauvergne e6d9048004 [bindings/python] in constructors wrappers build the return value before 2012-05-05 23:18:32 +02:00
Benjamin Dauvergne 1473b92b86 [bindings/python] free xmlnode argument owned by the callee 2012-05-05 23:00:05 +02:00
Benjamin Dauvergne f4fb55bd89 [bindings/python] fix some indentation 2012-05-05 22:58:26 +02:00
Benjamin Dauvergne df3656df4d [bindings/python] boolean values does not need to be released 2012-05-05 22:58:09 +02:00
Benjamin Dauvergne 762f88cd37 [bindings python] make constructor failure raise a lasso.Error exception 2010-12-14 01:52:31 +01:00
Benjamin Dauvergne 35ff3d6950 [Strings] add string constant for the internal XML attributes used in dumps
Add string constants for signature method, signature type, private key
(file path or content), private key password and certificate (file path
or content).

Add cast for xmlChar constant strings definition in python bindings, it
assumed all constant strings were char*.
2010-09-03 19:02:37 +02:00
Benjamin Dauvergne eca31dd63c [Python binding] do not throw lasso.Error for python exceptions 2010-07-05 21:24:08 +00:00
Benjamin Dauvergne 900a8008c4 Binding python: fix freeing of list return values for methods with the transfer full flag
The output 'print' were missing, oups :(
2010-06-14 21:21:25 +00:00
Benjamin Dauvergne 9078ad41fd Binding python: call lasso_init() first in init_lasso() 2010-06-09 16:54:52 +00:00
Benjamin Dauvergne 52372fa437 Bindings: keep retro compatibility for member field names
* Special kludge price go to PHP:
   methods name are insensitive so nothing to do here, BUT, if you use
   getters/setters then your objects fields can be case insensitive too
   ;-) (DNS, dns, DnS, dNs all maps to get_dns ).
2010-06-06 14:03:57 +00:00
Benjamin Dauvergne cb1573c61c Binding python: fix use of raise_on_rc, simplift Node.__setstate__ 2010-04-06 13:11:07 +00:00
Benjamin Dauvergne 7b8c1f6dab Binding python: fix problem of classes without an initializer 2010-03-27 16:51:26 +00:00
Benjamin Dauvergne 3f146262d1 Binding python: accept a functio as setter, if it has only two arguments 2010-03-02 11:57:44 +00:00
Benjamin Dauvergne 333aee05e4 Bindings python: use more accessors from utils.py
* binings/python/lang.py: remove direct access to type tuples in favor
   of using accesors from utils.py.
2010-02-22 13:30:46 +00:00
Benjamin Dauvergne 24c7a4f8a7 Binding python: add pickling support to LassoNode
* bindings/python/lang.py:
   support pickling protocol methods __getstate__ and __setstate__
   leveraging the lasso_node_dump and lasso_node_new_from_dump methods
   from Lasso.
2010-02-22 13:30:42 +00:00
Benjamin Dauvergne a803cc710b Binding python: simplify special constructor, use cptrToPy 2010-02-17 10:15:11 +00:00
Benjamin Dauvergne 9709ec4342 Binding python: factorize value freeing generation code
* lasso/python/lang.py:
   extract value freeing generation code to method free_value,
   add proper liberation of values at exit of wrapper functions, remove
   g_free call from return_value generated code.
2010-02-17 10:15:01 +00:00
Benjamin Dauvergne 8fe484f903 Binding python: fix leak in string getters 2010-02-15 10:37:51 +00:00
Benjamin Dauvergne 63a210a507 Bindings python: remove default argument if there is parameters without default argument following 2010-02-12 09:48:24 +00:00
Benjamin Dauvergne 7808c4cffa Bindings: restore ID-WSF constants, improve python getters,
* bindings/bindings.py:
   parse idwsf_strings.h to get ID-WSF constants.
 * bindings/utils.py:
   add an is_rc check function, to check for 'error code' return type.
 * bindings/perl/lang.py:
   only raise errors for 'int' or 'gint' return type
 * bindings/python/lang.py:
   - always create a normal function binding.
   - for functions starting with 'get' try to create a corresponding
     property, but if a corresponding member already exists, fails, and
     print a warning about getter function/member field clash.
   - make type dispatching on return_type more explicite.
2010-02-04 22:24:06 +00:00
Benjamin Dauvergne 38ef0a86d9 Binding python: fix getter for non-object fields
* bindings/python/lang.py:
   transition to bindings/utils.py methods broke getters.
2010-02-04 01:23:45 +00:00
Benjamin Dauvergne 43b1e52fbc Binding python: make a better use of default value annotation for creating method declarations 2010-01-29 00:58:20 +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 020a7583ab Bindings python: use is_cstring for matching GList element type 2010-01-14 16:18:34 +00:00
Benjamin Dauvergne b77c9cf2e8 Bindings: add support for time_t to bindings, add support for 'string' type for list in java binding 2010-01-12 15:40:21 +00:00
Benjamin Dauvergne ddbe21ae5b Binding python: provide old binding name for set_encryptionMode 2010-01-12 15:39:55 +00:00
Benjamin Dauvergne fcd8739f49 Bindings: simplify GList handling 2010-01-04 09:16:00 +00:00
Benjamin Dauvergne 5224c7cf67 Bindings: make the binding infrastructure understand GObject-introspections annotations
* bindings/bindings.py
 * bindings/utils.py:
   add convenience function to treat arguments tuple:
   (type,name,{annotations}).
   introduce new argument options, fix that arguments are 3-tuple of the
   form (type,name,annotations), where annotations is a dictionary.
   Key of this dictionnary can be:
    - optional, wheter the argument is necessary, it means it has a
      default value.
    - out, means that the pointer is a pointer of pointer, for bindings
      that can return exceptions, it will be returned instead of the
      integer error code, the only way to access error codes will be
      exceptions.
    - element-type, contained type of a list or an array,
    - key-type, value-type, type of respectively the key and value of a
      GHashTable.
    - transfer, wheter a the callee(for arguments)/caller(for return
      values) owns the values passed, it can be none,container(if the
      callee/caller only owns the container not the contained value) or
      full.
    doc.parameters is now a 3-tuple of (attribute-name,
    attribute-description, attribute-annotations) where
    attribute-annotations is a string of the form '(option1)(option2
    option-arguments) etc.'.
   - add predicates for xml, list and time_t values. improve predicates
     for cstring and const modifier.

*  bindings/overrides.xml:
    'out' arguments are not well supported for java, so skip functions
    using them.

 *  bindings/java/lang.py bindings/php5/php_code.py
    bindings/php5/wrapper_source.py bindings/python/lang.py:
    - update language specifig binding generators for handling new
      annotations.
    - improve python method declaration, handle optional arguments with
      default values, factorize this chode in two methods,
      get_python_arg_decl and defval_to_python_value.

 *  bindings/python/tests/Makefile.am
    bindings/python/tests/idwsf1_tests.py
    bindings/python/tests/idwsf2_tests.py:
    make test work with out of source build dir.
2010-01-04 09:13:36 +00:00
Benjamin Dauvergne e25410461c Bindings: add support for guchar
* bindings/java/lang.py:
 * bindings/python/lang.py:
   add guchar to list of C types everywhere.
2009-09-11 15:51:28 +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 99b303eab3 Lookup wrapper_{top,bottom}.c files in the src_dir, useful for VPATH build
(i.e. distcheck). Add top_srcdir/binings to python syspath.
2008-08-05 14:53:35 +00:00
Benjamin Dauvergne 1fae093527 Move all python binding related files inside the python subdirectory 2008-08-05 14:52:52 +00:00