univention.ldap_cache package#

Subpackages#

Submodules#

univention.ldap_cache.frontend module#

univention.ldap_cache.frontend.groups_for_user(user_dn: str, consider_nested_groups: bool = True, cache: dict[str, set[str]] | None = None) list[str][source]#
univention.ldap_cache.frontend.users_in_group(group_dn: str, consider_nested_groups: bool = True, readers: tuple[Any | None, Any | None] = (None, None), group_cache: dict[str, list[str]] = {}) list[str][source]#
univention.ldap_cache.frontend.users_groups() dict[str, list[str]][source]#

Find all user-group relationship, including implicit ones: if Group1 have Group2 as a subgroup, all users from Group2 are also considered members of Group1.

univention.ldap_cache.listener_module module#

class univention.ldap_cache.listener_module.LdapCacheHandler(*args: Any, **kwargs: Any)[source]#

Bases: ListenerModuleHandler

When subclassing, in __init__() first call must be:

super(.., self).__init__(*args, **kwargs)

self.config will be set by the metaclass.

create(dn: str, new: Mapping[str, Sequence[bytes]]) None[source]#

Called when a new object was created.

Parameters:
  • dn (str) – current objects DN

  • new (dict) – new LDAP objects attributes

modify(dn: str, old: Mapping[str, Sequence[bytes]], new: Mapping[str, Sequence[bytes]], old_dn: str | None) None[source]#

Called when an existing object was modified or moved.

A move can be be detected by looking at old_dn. Attributes can be modified during a move.

Parameters:
  • dn (str) – current objects DN

  • old (dict) – previous LDAP objects attributes

  • new (dict) – new LDAP objects attributes

  • old_dn (str or None) – previous DN if object was moved/renamed, None otherwise

remove(dn: str, old: Mapping[str, Sequence[bytes]]) None[source]#

Called when an object was deleted.

Parameters:
  • dn (str) – current objects DN

  • old (dict) – previous LDAP objects attributes

post_run() None[source]#

Called only, when no change happens for 15 seconds - for any listener module.

Use for example to close an LDAP connection.

class Configuration(*args: Any, **kwargs: Any)[source]#

Bases: Configuration

priority = 2.0#

univention.ldap_cache.log module#

univention.ldap_cache.log.log(*msgs: Any) None[source]#
univention.ldap_cache.log.debug(*msgs: Any) None[source]#