user.sync

Module Contents

Classes

UserSourceArgsWithoutName

dict() -> new empty dictionary

UserSource

Generalized UserSource to facilitate ldap sync

ZugUserSource

Generalized UserSource to facilitate ldap sync

Attributes

_T

class user.sync.UserSourceArgsWithoutName[source]

Bases: typing_extensions.TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

bases: collections.abc.Sequence[str][source]
org: typing_extensions.NotRequired[Any][source]
filters: typing_extensions.NotRequired[collections.abc.Sequence[str]][source]
user_type: typing_extensions.NotRequired[str][source]
default_filter: typing_extensions.NotRequired[str][source]
user.sync._T[source]
class user.sync.UserSource(name: str, bases: Sequence[str], org: Any | None = None, filters: Sequence[str] | None = None, user_type: str | None = None, default_filter: str = '(objectClass=*)', verbose: bool = False)[source]

Generalized UserSource to facilitate ldap sync

abstract property ldap_attributes: Sequence[str][source]
abstract property ldap_mapping: Mapping[str, str][source]
property organisation: Any[source]
property bases: Sequence[str][source]
property default_filters: list[str][source]
property bases_filters_attributes: Sequence[tuple[str, str, Sequence[str]]][source]
static scalar(value: list[str] | str | None, default: str = '') str[source]
static scalar(value: list[_T] | _T | None, default: _T) _T
user_type_default(entry: ldap3.Entry) str | None[source]
user_type(entry: ldap3.Entry) str | None[source]
excluded_default(entry: ldap3.Entry) bool[source]

Default when no function specific to the source name exists.

excluded(entry: ldap3.Entry) bool[source]

Finds a specific exclusion function specific to the name or use the fallback

map_entry(entry: ldap3.Entry) dict[str, Any][source]
complete_entry(user: dict[str, Any], **kwargs: Any) dict[str, Any][source]

Add additional logic after the user is mapped before writing to the db.

map_entries(entries: Iterable[Entry], **kwargs: Any) Iterator[dict[str, Any]][source]
class user.sync.ZugUserSource(name: str, bases: Sequence[str], org: Any | None = None, filters: Sequence[str] | None = None, user_type: str | None = None, default_filter: str = '(objectClass=*)', verbose: bool = False)[source]

Bases: UserSource

Generalized UserSource to facilitate ldap sync

property ldap_attributes: list[str][source]
default_filter = '(objectClass=*)'[source]
ldap_mapping[source]
schools: dict[str, UserSourceArgsWithoutName][source]
ldap_users: dict[str, UserSourceArgsWithoutName][source]
user_type_ktzg(entry: ldap3.Entry) str | None[source]

KTZG specific user type

user_type_default(entry: ldap3.Entry) str | None[source]

For all the schools, we filter by Mail already, but we exclude the students. Name specific user_type functions will run first, this is

a fallback.

excluded(entry: ldap3.Entry) bool[source]

General exclusion pattern for all synced users.

map_entry(entry: ldap3.Entry) dict[str, Any][source]
complete_entry(user: dict[str, Any], **kwargs: Any) dict[str, Any][source]

Add additional logic after the user is mapped before writing to the db.

map_entries(entries: Iterable[Entry], **kwargs: Any) Iterator[dict[str, Any]][source]
classmethod factory(verbose: bool = False) list[ZugUserSource][source]