Skip to content

Commit

Permalink
doc: minor various improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Mar 29, 2024
1 parent 4067634 commit be2fa8b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
26 changes: 14 additions & 12 deletions canaille/backends/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@


class Model:
"""Model abstract class."""
"""The model abstract class.
created: Optional[datetime.datetime]
"""The "DateTime" that the resource was added to the service provider.
This attribute MUST be a DateTime.
It details all the methods and attributes that are expected to be
implemented for every model and for every backend.
"""

created: Optional[datetime.datetime]
"""The :class:`~datetime.datetime` that the resource was added to the
service provider."""

last_modified: Optional[datetime.datetime]
"""The most recent DateTime that the details of this resource were updated
at the service provider.
"""The most recent :class:`~datetime.datetime` that the details of this
resource were updated at the service provider.
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
Expand Down Expand Up @@ -50,14 +52,14 @@ def query(cls, **kwargs):

@classmethod
def fuzzy(cls, query, attributes=None, **kwargs):
"""Works like :meth:`~canaille.backends.models.query` but attribute
values loosely be matched."""
"""Works like :meth:`~canaille.backends.models.Model.query` but
attribute values loosely be matched."""
raise NotImplementedError()

@classmethod
def get(cls, identifier=None, **kwargs):
"""Works like :meth:`~canaille.backends.models.query` but return only
one element or :py:data:`None` if no item is matching."""
"""Works like :meth:`~canaille.backends.models.Model.query` but return
only one element or :py:data:`None` if no item is matching."""
raise NotImplementedError()

@property
Expand Down
10 changes: 5 additions & 5 deletions doc/databases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ It is used when the ``CANAILLE_SQL`` configuration parameter is defined. For ins
[CANAILLE_SQL]
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
====
Expand All @@ -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"

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 ::
Currently, only the ``inetOrgPerson`` and ``groupOfNames`` schemas have been tested.
Expand All @@ -61,8 +61,8 @@ Canaille can integrate with several OpenLDAP overlays:
memberof / refint
~~~~~~~~~~~~~~~~~

`memberof <https://www.openldap.org/doc/admin24/overlays.html#Reverse%20Group%20Membership%20Maintenance>`_
and `refint <https://www.openldap.org/doc/admin24/overlays.html#Referential Integrity>`_
`memberof <https://www.openldap.org/doc/admin26/overlays.html#Reverse%20Group%20Membership%20Maintenance>`_
and `refint <https://www.openldap.org/doc/admin26/overlays.html#Referential%20Integrity>`_
overlays are needed for the Canaille group membership to work correctly.

Here is a configuration example compatible with canaille:
Expand All @@ -86,7 +86,7 @@ You can adapt and load those configuration files with:
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:

Expand Down
2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ LDAP schemas

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``).

Depending on the configuration method you use with your OpenLDAP installation, you need to chose how to add the canaille schemas:
Expand Down
2 changes: 1 addition & 1 deletion doc/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.

0 comments on commit be2fa8b

Please sign in to comment.