Commit graph

160 commits

Author SHA1 Message Date
Éloi Rivard
d9d5c85b51
refactor: memory backend clears its cache on save() calls 2024-04-12 10:55:24 +02:00
Éloi Rivard
6e26656cc4
tests: move test_model_references_set_unsaved_object to the ldap tests directory 2024-04-12 10:49:56 +02:00
Éloi Rivard
fe2665ae32
fix: LDAP user group removal 2024-04-08 14:15:28 +02:00
Éloi Rivard
cbde5ba7b7
fix: LDAP objectClass guessing exception 2024-04-08 11:00:36 +02:00
Éloi Rivard
8c16a9dd6d
fix: Lazy permission loading exception 2024-04-08 10:50:37 +02:00
Éloi Rivard
fbbcd2fe78
fix: saving an object with the LDAP backend keeps the objectClass un-managed by Canaille 2024-04-08 10:29:47 +02:00
Éloi Rivard
fecfcfa8f3
refactor: factorize Model.__html__ 2024-04-07 20:23:43 +02:00
Éloi Rivard
702eec7aca
fix: MemoryModel.model_attribute type hint 2024-04-07 20:21:30 +02:00
Éloi Rivard
88832b5b3b
refactor: move User.check_password and User.set_password methods to Backend 2024-04-07 20:17:15 +02:00
Éloi Rivard
5a6ce24074
refactor: move User.get_from_login method to Backend 2024-04-07 20:17:15 +02:00
Éloi Rivard
6251455a1d
perf: cache the class attributes 2024-04-07 19:22:54 +02:00
Éloi Rivard
e339d1169d
refactor: User.has_password factorization 2024-04-07 18:33:43 +02:00
Éloi Rivard
c0a28c1480
refactor: set default values for core models 2024-04-07 16:51:55 +02:00
Éloi Rivard
b6c59b3eda
refactor: add some typing to models 2024-04-07 16:39:05 +02:00
Éloi Rivard
1fbb074cc5
refactor: user permissions lazy loading 2024-04-07 15:21:32 +02:00
Éloi Rivard
30bd71c5b5
tests: fix coverage 2024-04-07 09:33:56 +02:00
Éloi Rivard
f113188368
refactor: factorize match_filter in the main User class 2024-04-07 01:25:44 +02:00
Éloi Rivard
76cd3dc169
refactor: remove LDAPObject.get unused parameter 2024-04-07 00:36:52 +02:00
Éloi Rivard
945daee715
refactor: prefer typing.get_type_hints to __annotations__ 2024-04-06 23:22:38 +02:00
Éloi Rivard
75837fa207
refactor: model attributes are walked from the top to the bottom 2024-04-06 22:46:11 +02:00
Éloi Rivard
fe809161ff
refactor: factorized User.load_permissions 2024-04-06 19:22:47 +02:00
Éloi Rivard
f06f0c4e25
doc: fix references to BackendModel 2024-04-05 16:09:20 +02:00
Éloi Rivard
7734ed185e
refactor: the id attribute is attached to the Model class 2024-04-05 16:05:17 +02:00
Éloi Rivard
47ef573917
refactor: fix coverage 2024-04-05 15:59:17 +02:00
Éloi Rivard
ec7a721336
refactor: ldap objects id attribute is based on entryUUID instead of dn 2024-04-05 15:35:49 +02:00
Éloi Rivard
7b054bb571
refactor: ldap backend use a server control to re-read objects after update 2024-04-05 14:34:48 +02:00
Éloi Rivard
ab17137cd6
refactor: ldapbackend explicitly uses the DN attribute for LDAP operations 2024-04-03 09:40:10 +02:00
Éloi Rivard
18e3f8cde5
refactor: split the base model class in two 2024-04-01 18:55:05 +02:00
Éloi Rivard
0363a0a76e
refactor: remove unused var 2024-04-01 15:02:26 +02:00
Éloi Rivard
89354e281f
refactor: memory backend use __getattribute__ instead of __getattr__ 2024-04-01 15:02:19 +02:00
Éloi Rivard
a795c8460b
refactor: memory model keys are not models anymore 2024-04-01 15:01:53 +02:00
Éloi Rivard
b571818755
refactor: MemoryModel - rename klass in model 2024-04-01 15:01:12 +02:00
Éloi Rivard
fbd0d3029e
refactor: rename User read/write/permissions attributes 2024-04-01 14:59:56 +02:00
Éloi Rivard
48d6065e1c
refactor: memory model variable renaming 2024-04-01 14:59:40 +02:00
Éloi Rivard
006bf08b3d
refactor: improve memory model serialization
do not systematically store every attributes as a list
2024-03-31 12:06:19 +02:00
Éloi Rivard
8834c65bea
refactor: backend memory deserialize method 2024-03-31 01:20:39 +01:00
Éloi Rivard
d2df12236d
refactor: move memory backend methods as classmethods 2024-03-31 01:05:48 +01:00
Éloi Rivard
fa45ef6907
refactor: delete an unused index layer in the memory backend 2024-03-31 00:23:43 +01:00
Éloi Rivard
0a2d3d4629
fix: permissions loading with the SQL backend 2024-03-31 00:07:16 +01:00
Éloi Rivard
58b967a43e
refactor: reliably detect the model attribute cardinality 2024-03-30 23:39:09 +01:00
Éloi Rivard
efe3a3c4c4
refactor: assume ACL have default values 2024-03-30 17:21:40 +01:00
Éloi Rivard
e299c84cab
fix: default LDAP USER_FILTER 2024-03-29 14:45:04 +01:00
Éloi Rivard
be2fa8b7f5
doc: minor various improvements 2024-03-29 09:35:29 +01:00
Éloi Rivard
8625318341
feat: use pydantic to validate the configuration 2024-03-28 17:44:26 +01:00
Éloi Rivard
ffa12b0f71
feat: created and last_modified model attributes 2024-03-27 13:57:38 +01:00
Éloi Rivard
4edffcaa9f
chore: use isort instead of reoder-python-imports 2024-03-15 19:58:37 +01:00
Éloi Rivard
395b6ab4f3
chore: add docformatter pre-commit 2023-12-28 18:31:57 +01:00
Éloi Rivard
e8b620588e
refactor: LDAP backend initialization 2023-12-27 10:57:22 +01:00
Éloi Rivard
5c11ebf0d3
feat: ldap connection is lazilly opened 2023-12-25 14:26:08 +01:00
Éloi Rivard
d0dbaa588c
refactor: no more explicit conn argument in the LDAP backend 2023-12-25 14:03:47 +01:00
Éloi Rivard
95882c737b
fix: LDAP backend connection error display 2023-12-25 13:56:57 +01:00
Éloi Rivard
d4712b7971
refactor: backend cleanups 2023-12-25 13:22:43 +01:00
Éloi Rivard
3255eaa31c
fix: a crash when no ACL was defined 2023-12-15 10:50:53 +01:00
Éloi Rivard
a7e574f754
feat: use sqlalchemy-utils PasswordType to store and hash user passwords 2023-12-01 09:29:59 +01:00
Éloi Rivard
969f3e980c
fix: password comparision was too permissive on login 2023-11-28 18:10:47 +01:00
Éloi Rivard
d9dbd8ad0e
fix: crash when LDAP groups are refering to unexisting users 2023-11-28 09:37:37 +01:00
Éloi Rivard
27639081f0
feat: implement sqlalchemy backend
Co-authored-by: Loan Robert <loan@yaal.coop>
2023-11-24 13:57:46 +01:00
Éloi Rivard
8c2814c852
refactor: Backend.session can take parameters 2023-11-24 12:43:40 +01:00
Éloi Rivard
02c8f0b177
refactor: Backend.install calls uniformization 2023-11-24 11:13:17 +01:00
Éloi Rivard
1e9c77ad6d
refactor: compare models in memory backend user.load_permissions 2023-11-22 12:20:53 +01:00
Éloi Rivard
b6cfa1517c
refactor: form model attributes coercion 2023-11-22 11:30:30 +01:00
Éloi Rivard
bc56105b28
fix: remove useless print 2023-11-21 17:59:11 +01:00
Éloi Rivard
3a39fc191a
refactor: remove models __delattr__ methods 2023-11-21 14:57:28 +01:00
Éloi Rivard
1fd8af2cf4
refactor: models attributes cardinality is closer to SCIM models 2023-11-17 21:21:25 +01:00
Éloi Rivard
0ee374dea7
tests: back to 100% coverage 2023-11-16 18:06:23 +01:00
Éloi Rivard
0574460fe6
fix: when LDAP servers are down, rendering error pages would raise an exception 2023-10-02 14:06:06 +02:00
Éloi Rivard
f5083d0b15
fix: unique type in token memory model 2023-09-18 23:55:46 +02:00
Éloi Rivard
a2e3fce204
feat: flask-babel and pytz are now part of the front extras 2023-09-01 10:46:56 +02:00
Éloi Rivard
77cccc3a10
doc: better model inheritance to generate a clearer documentation 2023-08-23 16:41:41 +02:00
Éloi Rivard
553595c5ed
doc: model documentation 2023-08-17 16:11:24 +02:00
Éloi Rivard
96ccf12ad9
feat: split installation in different extras packages 2023-08-17 14:34:30 +02:00
Éloi Rivard
588ec8792e
Implement a dummy inmemory backend 2023-08-17 12:33:45 +02:00
Éloi Rivard
191791ac72
fix: import render_template from flask_themer instead of flask 2023-08-14 15:45:25 +02:00
Éloi Rivard
c895366684
refactor: store user profile in g.user 2023-08-13 22:08:28 +02:00
Éloi Rivard
54abdaea3b Dynamic model registration 2023-07-12 12:34:00 +02:00
Éloi Rivard
5163b11b9a Updated DEFAULT_USER_FILTER 2023-07-04 19:18:09 +02:00
Éloi Rivard
fd66f86a72 USER_FILTER is parsed with jinja 2023-07-04 18:34:16 +02:00
Éloi Rivard
4f42798e39 Refactored keypair management 2023-07-01 19:06:26 +02:00
Éloi Rivard
52482ca19c Implements flask OIDC converters 2023-06-29 15:55:39 +02:00
Éloi Rivard
7bce9b9a74 ldap backend: make sure to escape special chars in object identifiers 2023-06-29 15:55:39 +02:00
Éloi Rivard
3ecb8b4722 Implements a flask Group converter 2023-06-29 15:55:39 +02:00
Éloi Rivard
f504bb3a66 Implements a flask User converter 2023-06-29 15:55:39 +02:00
Éloi Rivard
e4e49da44a Renamed configuration entries
- USER_ID_ATTRIBUTE is now USER_RDN
- GROUP_ID_ATTRIBUTE is now GROUP_RDN
2023-06-29 15:55:39 +02:00
Éloi Rivard
57af18d557 Use a unique identifier to indentify users in URLS
Previously we used the uid since we supposed this value was always
valid, but some users user the mail attribute as the User RDN in their
OpenLDAP installation, and do not have a uuid.
2023-06-29 15:55:39 +02:00
Éloi Rivard
361fda0386 Renamed User.phone_number in User.phone_numbers 2023-06-22 15:33:03 +02:00
Éloi Rivard
371f806695 Renamed User.email in User.emails 2023-06-22 15:15:46 +02:00
Éloi Rivard
14ec6e9c9e ldap backend avoid to store empty values 2023-06-22 13:27:43 +02:00
Éloi Rivard
d65dbfbe96 listify utility 2023-06-22 13:09:44 +02:00
Éloi Rivard
caf434a1fc debug template variable is available everywhere 2023-06-20 14:22:19 +02:00
Éloi Rivard
23e9e7e71a Renamed Backend in BaseBackend 2023-06-05 18:10:37 +02:00
Éloi Rivard
e5ba0a8c86 compatibility bugfix for flask 2.3 2023-06-03 13:42:23 +02:00
Éloi Rivard
17c2f7a5cd Implemented LDAP ppolicy support. 2023-05-26 15:23:43 +02:00
Éloi Rivard
d8158d6a72 Use ruff linter 2023-05-25 13:37:58 +02:00
Éloi Rivard
77d3a1a656 Do not event attempt to add oauth schema if present 2023-05-24 16:59:36 +02:00
Éloi Rivard
a92542cd81 Moved models specificities in the backend module 2023-05-20 21:24:14 +02:00
Éloi Rivard
c75108344b Moved login placeholder mechanism in the backend module 2023-05-20 20:07:40 +02:00
Éloi Rivard
033d436878 Moved LDAP schema installation in the ldap backend module 2023-05-20 20:04:23 +02:00
Éloi Rivard
c1d1706007 Moved every model import to canaille.models 2023-05-20 20:02:00 +02:00
Éloi Rivard
e110c4851b Backend singleton logic moved to backend.Backend 2023-05-20 18:39:49 +02:00
Éloi Rivard
6f637b8129 Refactored the unit test backend fixtures 2023-05-20 17:17:46 +02:00