univention.management.console.modules.passwordreset package#
- univention.management.console.modules.passwordreset.forward_to_master_if_authentication_disabled(func)[source]#
- class univention.management.console.modules.passwordreset.ScanSettings(url: str, timeout: int, cafile: str | None, max_files: int)[source]#
Bases:
NamedTupleSettings of the malware scan, see
malware_scan_settings().Create new instance of ScanSettings(url, timeout, cafile, max_files)
- univention.management.console.modules.passwordreset.scan_files_for_malware(files: list[tuple[str, bytes]], settings: ScanSettings, username: str | None) None[source]#
Scan uploaded files with the ICAP server. This runs in a worker thread.
The function only gets prepared data, see
uploaded_files()andmalware_scan_settings(), so that it doesn’t touch shared state of the module. All scans of one request together must finish within the configured timeout.- Parameters:
files (list) – Pairs of property name and decoded file content.
settings (ScanSettings) – The URL, the timeout and the CA file of the ICAP server.
username (str) – The name of the user, for the log messages.
- Raises:
UMC_Error – If the ICAP server finds malware or cannot scan a file.
- univention.management.console.modules.passwordreset.malware_scan_settings() ScanSettings[source]#
Get the settings of the malware scan: the URL, the timeout and the CA file of the ICAP server and the maximum number of files in one request.
The environment variables SELF_SERVICE_MALWARE_SCAN_ICAP_URL, SELF_SERVICE_MALWARE_SCAN_ICAP_TIMEOUT, SELF_SERVICE_MALWARE_SCAN_ICAP_CA_FILE and SELF_SERVICE_MALWARE_SCAN_MAX_FILES have priority over the UCR variables umc/self-service/malware-scan/icap/url, …/icap/timeout, …/icap/ca-file and …/max-files. Empty or invalid environment variables are ignored.
- Returns:
The settings. The URL is empty if the scan is disabled, the CA file is None if the CA certificates of the system are used.
- univention.management.console.modules.passwordreset.upload_values(property_descriptions: dict[str, Any], attributes: dict[str, Any]) list[tuple[str, Any]][source]#
Collect the non-empty values of the attributes with an upload syntax from
UPLOAD_SYNTAXES, for example jpegPhoto, without decoding them. Multivalue attributes, also extended attributes, give one entry per value.
- univention.management.console.modules.passwordreset.check_upload_limit(property_descriptions: dict[str, Any], attributes: dict[str, Any], settings: ScanSettings) None[source]#
Reject a request with more uploaded files than allowed, before any file is decoded, validated or scanned.
The limit only applies when the malware scan is enabled. All non-empty values of all upload properties count, also values that are not valid Base64.
- Parameters:
property_descriptions (dict) – The UDM property descriptions of the users/user module.
attributes (dict) – The attribute values that the user sent.
settings (ScanSettings) – The settings of the malware scan, max_files is the limit, 0 allows no file.
- Raises:
UMC_Error – If the request contains more files than allowed.
- univention.management.console.modules.passwordreset.uploaded_files(property_descriptions: dict[str, Any], attributes: dict[str, Any]) list[tuple[str, bytes]][source]#
Decode the uploaded files in the attributes, see
upload_values().Values that are not Base64 are skipped, UDM rejects them later. Call
check_upload_limit()first.
- exception univention.management.console.modules.passwordreset.ConnectionLimitReached(seconds)[source]#
Bases:
UMC_Error- status = 503#
- exception univention.management.console.modules.passwordreset.ServiceForbidden[source]#
Bases:
UMC_Error- status = 403#
- exception univention.management.console.modules.passwordreset.TokenNotFound[source]#
Bases:
UMC_Error- status = 400#
- exception univention.management.console.modules.passwordreset.NoMethodsAvailable[source]#
Bases:
UMC_Error- status = 403#
- exception univention.management.console.modules.passwordreset.TokenSendMessage[source]#
Bases:
UMC_Error- status = 200#
- class univention.management.console.modules.passwordreset.Instance(*args, **kwargs)[source]#
Bases:
Base- property usersmod#
- get_service_specific_passwords(request)[source]#
Get users (possible) service specific passwords.
- Returns:
list of dicts with users ssp
- set_service_specific_passwords(request)[source]#
Set a new service specific password.
- Returns:
The password in cleartext
- get_contact(request)[source]#
Get users contact data.
- Returns:
list of dicts with users contact data
Subpackages#
- univention.management.console.modules.passwordreset.sending package
get_plugins()- Submodules
- univention.management.console.modules.passwordreset.sending.send_email module
- univention.management.console.modules.passwordreset.sending.send_sms module
- univention.management.console.modules.passwordreset.sending.send_with_external module
- univention.management.console.modules.passwordreset.sending.verify_email module
Submodules#
univention.management.console.modules.passwordreset.send_plugin module#
univention.management.console.modules.passwordreset.tokendb module#
- exception univention.management.console.modules.passwordreset.tokendb.MultipleTokensInDB[source]#
Bases:
Exception