Skip to content

Issue laurent

Laurent Gay requested to merge laurent.gay/canaille:issue_laurent into main

Merge request to correct small bugs.
Each commit treats only one bug.
Unit tests are not green for me: i can run it in my PC (for me, all failed) 😞

Append ldap connexion in Flask singleton for check configuration
After installation, with using command env CONFIG="$CANAILLE_CONF_DIR/config.toml" "$CANAILLE_INSTALL_DIR/env/bin/canaille" check, we have an exception:

...  
File "/opt/canaille/env/lib/python3.8/site-packages/canaille/ldap_backend/ldapobject.py", line 154, in ldap_object_attributes  
conn = conn or cls.ldap()  
File "/opt/canaille/env/lib/python3.8/site-packages/canaille/ldap_backend/ldapobject.py", line 70, in ldap  
return g.ldap  
File "/opt/canaille/env/lib/python3.8/site-packages/flask/ctx.py", line 52, in **getattr**  
raise AttributeError(name) from None  
AttributeError: ldap

--> Correction with assign value in g.ldap

correction about installation of ldif in LDAP
When we install Canaille with official pip package, with using command env CONFIG="$CANAILLE_CONF_DIR/config.toml" "$CANAILLE_INSTALL_DIR/env/bin/canaille" install, we have an exception:
FileNotFoundError: [Errno 2] No such file or directory: 'canaille/ldap_backend/schemas/oauth2-openldap.ldif'
--> Correction to access to ldif file with relative directory.

Installation: Create default user (root) if LDAP user empty
New featuring
Using command env CONFIG="$CANAILLE_CONF_DIR/config.toml" "$CANAILLE_INSTALL_DIR/env/bin/canaille" install.
Check if no user in LDAP: so create "root" user (same password) and groups using in "config.toml" file.

Client: client_secret not show -> bad attribut name
When we edit a client, we can show client_secret attribut.
--> Correction about name using ("client.secret" -> "client.client_secret")

profile user: always filter with uid for login
Error for edit profile user from different connection.
--> Function User.get() must be used with filter="uid={username}", not used logon parameter.

group manage if GROUP_NAME_ATTRIBUTE="description" in config.toml
Error for edit groupe if configuration don't want used "cn" like GROUP_NAME_ATTRIBUTE.
--> In group management, "Name" field must be always "cn".

CSS with customize logo
Graphic problem if customize LOGO, in config.toml, is not good size.
--> Correction in base.html and base.css

Merge request reports