linkahead.common.administration module#
- class linkahead.common.administration.PermissionRule(action: str, permission: str, priority: bool = False)#
Bases:
objectPermission rules.
- Parameters:
action (str) – Either “grant” or “deny”
permission (str) – For example
RETRIEVE:*.priority (bool, optional)
set (Whether the priority shall be)
False. (defaults is)
- linkahead.common.administration.generate_password(length: int)#
Create a random password that fulfills the security requirements
- Parameters:
length (int) – Length of the generated password. Has to be greater than 7.
- Returns:
password – Generated random password of the given length
- Return type:
string
- Raises:
ValueError: – If the length is less than 8.
- linkahead.common.administration.get_server_properties() dict[str, str | None]#
get_server_properties.
Get all server properties as a dict.
- Returns:
The server properties.
- Return type:
dict
- linkahead.common.administration.get_server_property(key: str) str | None#
get_server_property.
Get a server property.
- Parameters:
key (str) – The name of the server property
- Returns:
value – The string value of the server property.
- Return type:
str
- Raises:
KeyError – If the server property is no defined.
- linkahead.common.administration.set_server_property(key: str, value: str)#
set_server_property.
Set a server property.
- Parameters:
key (str) – The name of the server property.
value (str) – The value of the server property.
- Return type:
None