1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-12-22 12:50:18 +01:00

698 Commits

Author SHA1 Message Date
kakwa
6265d04f09 stuff 2024-03-12 22:33:34 +01:00
kakwa
3c9bc8a0ac more complete content for self.backend_attributes in attributes class
* pass additional information in a dictionary (the type)
* manage multiple declaration of a given backend attribute (content
could be lists, not only a lonely string)
2019-02-26 23:55:43 +01:00
kakwa
245bafb01c typo 2019-02-13 09:44:47 +01:00
kakwa
5ee8a74040 update documentation 2019-02-13 09:41:17 +01:00
kakwa
96acda7aa6 fix formatting 2019-02-13 09:19:08 +01:00
kakwa
30c28c5feb slightly more robust unit tests
pre-cleanup to avoid contamination if other tests fail
1.1.1
2019-02-12 23:28:52 +01:00
kakwa
dc60300a29 version + changelog 2019-02-12 23:28:41 +01:00
kakwa
882a303474 fix crash due to encoding in python 2 2019-02-12 23:27:30 +01:00
kakwa
d831b09293 improve documentation
* improve documentation for key: True flag in attributes.yml
* improve documentation for the ldap filters and their templating
* improve comment in the .ini file
2019-02-12 23:06:42 +01:00
kakwa
7ac7118c9a adding a debug log to help figure out issues with filters. 2019-02-12 22:43:03 +01:00
kakwa
d690bbdc41 passing the correct logger to the backend
previously, the default logger was passed, this logger was using the
default configuration and log level, not honoring log level in
particular.
As a consequence, it was impossible to get debug logs from the backend.
This is now working as expected.
2019-02-12 22:40:42 +01:00
kakwa
73c02ccff4 disable default logger if running in debug mode (-D)
Debug mode can lead to log sensitive data (like password changes).
Having -D to log exclusively to stderr is a safer option.
2019-02-12 22:36:16 +01:00
kakwa
799ca2403f fix the urls for modify and delete
The id of the user is passed through the querystring in this page.
But the id was not properly escaped to be included as a querystring
parameter leading to weird issues like.
2019-02-12 21:24:24 +01:00
kakwa
bbafafae60 remove the double escaping.
Now the escaping is done by in the templates.
We need to remove the previous escaping done by hand in the code.
Otherwise, we end-up with double escaping and funky displaying of
fields.
2019-02-12 21:18:45 +01:00
kakwa
0cf5483785 add warning in documentation for log level 'debug' 2019-02-10 18:19:55 +01:00
kakwa
df2746b996 version bump + changelog 1.1.0 2019-02-10 18:15:07 +01:00
kakwa
e6bcf9d97d adding the possibility to log to stdout 2019-02-10 18:12:45 +01:00
kakwa
57bcaaed66 changelog and version bump 1.0.1 2019-02-09 20:49:23 +01:00
kakwa
b68214022c fix error handling when adding user that already exists 2019-02-09 20:47:34 +01:00
kakwa
932e7a8b40 adding (mostly) working configuration example 1.0.0 2019-02-09 20:24:32 +01:00
kakwa
abf1454278 changelog+version bump 2019-02-09 20:21:29 +01:00
kakwa
0793361d90 switch to "stable" in setup.py troves 2019-02-09 20:19:57 +01:00
kakwa
f824790849 another exception 2019-02-09 19:42:48 +01:00
kakwa
7390c931b9 another exception 2019-02-09 19:37:52 +01:00
kakwa
4a8aa1c655 another exception 2019-02-09 19:32:50 +01:00
kakwa
e50df5dde3 wider exception for <input> attribute "type" has invalid value 2019-02-09 19:26:31 +01:00
kakwa
fba2d32b44 another exception for todylib 2019-02-09 19:21:41 +01:00
kakwa
7a8468f8b1 adding another ignore 2019-02-09 19:15:31 +01:00
kakwa
9d0d321e9b another ignore for tidylib 2019-02-09 19:09:32 +01:00
kakwa
c5536bdc56 adding a fffew other exception in tidylib 2019-02-09 19:04:40 +01:00
kakwa
abfce4803a fix typo 2019-02-09 18:57:50 +01:00
kakwa
046afbbe29 html_tidy cleanup 2019-02-09 18:54:35 +01:00
kakwa
98fca30fba ignoring another nav error 2019-02-09 18:44:51 +01:00
kakwa
f13961790f adding exception for <nav> tags in html validation 2019-02-09 18:40:48 +01:00
kakwa
a56c491ee1 cleanup in html template + tidylib
* few small cleanup in html template (avoid empty tbody, put id between
quotes)
* switch to tidylib to validate the html instead of the previous hack
calling an external service (https://html5.validator.nu/)
* remove the previous validator script
* add exception for tidylib on empty <span> (these are required by
bootstrap)
2019-02-09 18:31:37 +01:00
kakwa
02357d886a remove debug print 2019-02-09 18:18:58 +01:00
kakwa
263e6be547 fix html validator test for python 3 2019-02-09 17:40:43 +01:00
kakwa
05aace0e9d force the groups in flatten roles to be sorted
* sorting the groups helps debuggability and also permits testing
that doesn't rely on python ordering (which is different between 2 and
3).
2019-02-09 17:36:01 +01:00
kakwa
baa3430e63 fix test and exception handling in code
With python 2 it was possible to do exception[0][...] to recover
details about an exception.
It's no longer authorized with python 3.
Now, we must do something like exception.args or exception.urls.
fortunately this syntax also works with python 2.
So we use it for both.
2019-02-09 17:12:39 +01:00
kakwa
90ff69586b remove deprecation warning for html escape
in python 2, (html) escape is part of the cgi module
in python 3, it's part of the html module

we now do a conditional import depending on the version, and name the
function html_escape.
2019-02-09 16:29:16 +01:00
kakwa
79983c078f fix behavior of get_attributes()
* make sure it returns an ordered list in both python 2 and python 3
2019-02-09 16:22:42 +01:00
kakwa
10747cff93 add some python 3 support in the LDAP and AD backends
python-ldap talks in bytes,
as the rest of ldapcherry talks in unicode utf-8:
* everything passed to python-ldap must be converted to bytes
* everything coming from python-ldap must be converted to unicode

The previous statement was true for python-ldap < version 3.X.
With versions > 3.0.0 and python 3, it gets tricky,
some parts of python-ldap takes string, specially the filters/escaper.

so we have now:
*_byte_p2 (unicode -> bytes conversion for python 2)
*_byte_p3 (unicode -> bytes conversion for python 3)
*_byte_p23 (unicode -> bytes conversion for python AND 3)
2019-02-09 16:08:18 +01:00
kakwa
979d4eeda8 disable ppolicy in samba test deployment 2019-02-09 15:42:48 +01:00
kakwa
fb6b0a5d31 limit cherrypy to < 18.0.0 in setup.py
cherrypy dropped support for python2 with 18.0.0, 17.X is the last
version usable with python 2.
2019-02-09 12:12:24 +01:00
kakwa
bbfe96d4f7 pep8 2019-02-09 12:05:09 +01:00
kakwa
b9437abefb * support for python-ldap 2 and 3
* python-ldap 3 is slightly different than 2 on how it handles modify
the modified attributes used to be transmitted as a dict, now it should
be transmitted as a list of dict)
2019-02-09 11:58:09 +01:00
kakwa
60d57d8530 changelog 2019-02-08 20:47:15 +01:00
kakwa
8c0bf94904 better log+fix in conf checking + fix in ppolicy handler
* log where the backend is declared (role or attribute) when
inconsistency with main .ini file
* fix check of configuration, only role file was checked 2 times instead
on checking role one time and attribute one time
* <dict>.keys() seems to have a different behavior between 2 (return
"list") and 3 (return "dict_keys"), casting to "list" to avoid that.
2019-02-08 20:38:29 +01:00
kakwa
42759f1cc4 pep8 2019-02-08 20:38:03 +01:00
kakwa
18fdeb483e better handling of the str/byte mess for python3
* add dedicated methods for python 3 in handling of bytearrays/strings
* using them to compare attributes checks in AD backend
2019-02-08 20:33:58 +01:00