csle_common.dao.management package
Submodules
csle_common.dao.management.management_user module
- class csle_common.dao.management.management_user.ManagementUser(username: str, password: str, email: str, first_name: str, last_name: str, organization: str, admin: bool, salt: str)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO representing a management user
- static from_dict(d: Dict[str, Any]) csle_common.dao.management.management_user.ManagementUser [source]
Converts a dict representation of the DTO into an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_common.dao.management.management_user.ManagementUser [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
csle_common.dao.management.session_token module
- class csle_common.dao.management.session_token.SessionToken(token: str, timestamp: float, username: str)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO representing a session token
- expired(valid_length_hours: int) bool [source]
Checks if the token has expired or not
- Parameters
valid_length_hours – the number of hours that a token is valid
- Returns
True if the token has expired otherwise False
- static from_dict(d: Dict[str, Any]) csle_common.dao.management.session_token.SessionToken [source]
Converts a dict representation of the DTO into an instance
- Parameters
d – the dict to convert
- Returns
the created instance
- static from_json_file(json_file_path: str) csle_common.dao.management.session_token.SessionToken [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO