doc: minor various improvements

This commit is contained in:
Éloi Rivard 2024-03-29 09:35:29 +01:00
parent 4067634c40
commit be2fa8b7f5
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
4 changed files with 21 additions and 19 deletions

View file

@ -6,20 +6,22 @@ from canaille.app import classproperty
class Model: class Model:
"""Model abstract class.""" """The model abstract class.
created: Optional[datetime.datetime] It details all the methods and attributes that are expected to be
"""The "DateTime" that the resource was added to the service provider. implemented for every model and for every backend.
This attribute MUST be a DateTime.
""" """
created: Optional[datetime.datetime]
"""The :class:`~datetime.datetime` that the resource was added to the
service provider."""
last_modified: Optional[datetime.datetime] last_modified: Optional[datetime.datetime]
"""The most recent DateTime that the details of this resource were updated """The most recent :class:`~datetime.datetime` that the details of this
at the service provider. resource were updated at the service provider.
If this resource has never been modified since its initial creation, If this resource has never been modified since its initial creation,
the value MUST be the same as the value of "created". the value MUST be the same as the value of :attr:`~canaille.backends.models.Model.created`.
""" """
@classproperty @classproperty
@ -50,14 +52,14 @@ class Model:
@classmethod @classmethod
def fuzzy(cls, query, attributes=None, **kwargs): def fuzzy(cls, query, attributes=None, **kwargs):
"""Works like :meth:`~canaille.backends.models.query` but attribute """Works like :meth:`~canaille.backends.models.Model.query` but
values loosely be matched.""" attribute values loosely be matched."""
raise NotImplementedError() raise NotImplementedError()
@classmethod @classmethod
def get(cls, identifier=None, **kwargs): def get(cls, identifier=None, **kwargs):
"""Works like :meth:`~canaille.backends.models.query` but return only """Works like :meth:`~canaille.backends.models.Model.query` but return
one element or :py:data:`None` if no item is matching.""" only one element or :py:data:`None` if no item is matching."""
raise NotImplementedError() raise NotImplementedError()
@property @property

View file

@ -26,7 +26,7 @@ It is used when the ``CANAILLE_SQL`` configuration parameter is defined. For ins
[CANAILLE_SQL] [CANAILLE_SQL]
SQL_DATABASE_URI = "postgresql://user:password@localhost/database" SQL_DATABASE_URI = "postgresql://user:password@localhost/database"
You can find more details on the SQL configuration in the :class:`~canaille.backends.sql.configuration.SQLSettings` section. You can find more details on the SQL configuration in the :class:`dedicated section <canaille.backends.sql.configuration.SQLSettings>`.
LDAP LDAP
==== ====
@ -46,7 +46,7 @@ It is used when the ``CANAILLE_LDAP`` configuration parameter is defined. For in
GROUP_BASE = "ou=groups,dc=mydomain,dc=tld" GROUP_BASE = "ou=groups,dc=mydomain,dc=tld"
You can find more details on the LDAP configuration in the :class:`~canaille.backends.ldap.configuration.LDAPSettings` section. You can find more details on the LDAP configuration in the :class:`dedicated section <canaille.backends.ldap.configuration.LDAPSettings>`.
.. note :: .. note ::
Currently, only the ``inetOrgPerson`` and ``groupOfNames`` schemas have been tested. Currently, only the ``inetOrgPerson`` and ``groupOfNames`` schemas have been tested.
@ -61,8 +61,8 @@ Canaille can integrate with several OpenLDAP overlays:
memberof / refint memberof / refint
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
`memberof <https://www.openldap.org/doc/admin24/overlays.html#Reverse%20Group%20Membership%20Maintenance>`_ `memberof <https://www.openldap.org/doc/admin26/overlays.html#Reverse%20Group%20Membership%20Maintenance>`_
and `refint <https://www.openldap.org/doc/admin24/overlays.html#Referential Integrity>`_ and `refint <https://www.openldap.org/doc/admin26/overlays.html#Referential%20Integrity>`_
overlays are needed for the Canaille group membership to work correctly. overlays are needed for the Canaille group membership to work correctly.
Here is a configuration example compatible with canaille: Here is a configuration example compatible with canaille:
@ -86,7 +86,7 @@ You can adapt and load those configuration files with:
ppolicy ppolicy
~~~~~~~ ~~~~~~~
If the `ppolicy <https://www.ietf.org/archive/id/draft-behera-ldap-password-policy-11.html>`_ overlay is configured and the ``pwdEndTime`` attribute is available (since OpenLDAP 2.6), then account locking support will be enabled in canaille. To allow users to manage account expiration, they need to have a *write* permission on the ``lock_date`` attribute. If the `ppolicy <https://www.ietf.org/archive/id/draft-behera-ldap-password-policy-11.html>`_ overlay is configured and the ``pwdEndTime`` attribute is available (since OpenLDAP 2.6), then account locking support will be enabled in canaille. To allow users to manage account expiration, they need to have a *write* permission on the :attr:`~canaille.core.models.User.lock_date` attribute.
Here is a configuration example compatible with canaille: Here is a configuration example compatible with canaille:

View file

@ -68,7 +68,7 @@ LDAP schemas
As of OpenLDAP 2.4, two configuration methods are available: As of OpenLDAP 2.4, two configuration methods are available:
- The `deprecated <https://www.openldap.org/doc/admin24/slapdconf2.html>`_ one, based on a configuration file (generally ``/etc/ldap/slapd.conf``); - The `deprecated <https://www.openldap.org/doc/admin26/slapdconf2.html>`_ one, based on a configuration file (generally ``/etc/ldap/slapd.conf``);
- The new one, based on a configuration directory (generally ``/etc/ldap/slapd.d``). - The new one, based on a configuration directory (generally ``/etc/ldap/slapd.d``).
Depending on the configuration method you use with your OpenLDAP installation, you need to chose how to add the canaille schemas: Depending on the configuration method you use with your OpenLDAP installation, you need to chose how to add the canaille schemas:

View file

@ -6,4 +6,4 @@ The web interface throws unuseful error messages
Unless the current user has admin permissions, or the installation is in debug mode, error messages won't be too technical. Unless the current user has admin permissions, or the installation is in debug mode, error messages won't be too technical.
For instance, you can see *The request you made is invalid*. For instance, you can see *The request you made is invalid*.
To enable detailed error messages, you can **temporarily** enable the :attr:`~canaille.core.configuration.RootSettings.DEBUG` configuration parameter. To enable detailed error messages, you can **temporarily** enable the :attr:`~canaille.app.configuration.RootSettings.DEBUG` configuration parameter.