cosapp.core.config¶
Configuration of CoSApp.
Classes
Encapsulate CoSApp configuration parameters and its handlers. |
-
class
cosapp.core.config.CoSAppConfiguration[source]¶ Bases:
objectEncapsulate CoSApp configuration parameters and its handlers.
CoSApp configuration folder are by default store in On Linux:
$HOME/.cosapp.d
On Windows:
%USERPROFILE%\.cosapp.d
This default configuration folder is overwritten by the environment variable
COSAPP_CONFIG_DIR.-
CONFIG_FILE: str = 'cosapp_config.json'¶
-
COSAPP_CONFIG_DIR= '.cosapp.d'¶
-
property
roles¶ Roles that the user can impersonate.
- Type
FrozenSet[FrozenSet[str]]
-
update_configuration() → None[source]¶ Update the configuration file for the current user.
The update process ask the server about updated role.
-
property
userid¶ User ID
- Type
str
-
static
validate_file(path: str) → dict[source]¶ Validate the provided file against JSON schema for configuration file.
- Parameters
path (str) – Absolute path to the file to be tested.
- Returns
The dictionary read in the validated file
- Return type
dict
- Raises
jsonschema.exceptions.ValidationError – If the provided file does not conform to the JSON schema.
-