|
None | __init__ (self, RuntimeData runtime_data, int error=84, int success=0, bool debug=False) |
|
bool | token_correct (self, Request request) |
|
bool | logged_in (self, Request request) |
|
Dict[str, Any] | log_user_in (self, str email='') |
|
Union[str, None] | get_token_if_present (self, Request request) |
|
Dict[str, Any] | get_body (self, Request request) |
|
Dict[str, Any] | log_user_out (self, str token="") |
|
_summary_
Definition at line 12 of file incomming.py.
◆ __init__()
None src.lib.boilerplates.incomming.BoilerplateIncoming.__init__ |
( |
| self, |
|
|
RuntimeData | runtime_data, |
|
|
int | error = 84, |
|
|
int | success = 0, |
|
|
bool | debug = False ) |
◆ _insert_login_into_database()
int src.lib.boilerplates.incomming.BoilerplateIncoming._insert_login_into_database |
( |
| self, |
|
|
dict[str, any] | user_data ) |
|
protected |
_summary_
Insert the user data into the database.
Args:
user_data (dict[str, any]): _description_: The user data to insert into the database
Returns:
int: _description_: The status of the operation
Definition at line 71 of file incomming.py.
◆ get_body()
Dict[str, Any] src.lib.boilerplates.incomming.BoilerplateIncoming.get_body |
( |
| self, |
|
|
Request | request ) |
Get the body of a request, whether it's JSON or form data.
Args:
request (Request): The incoming request object.
Returns:
Dict[str, Any]: Parsed request body in dictionary format.
Definition at line 187 of file incomming.py.
◆ get_token_if_present()
Union[str, None] src.lib.boilerplates.incomming.BoilerplateIncoming.get_token_if_present |
( |
| self, |
|
|
Request | request ) |
_summary_
Return the token if it is present.
Args:
request (Request): _description_: the request header created by the endpoint caller.
Returns:
Union[str, None]: _description_: If the token is present, a string is returned, otherwise, it is None.
Definition at line 158 of file incomming.py.
◆ log_user_in()
Dict[str, Any] src.lib.boilerplates.incomming.BoilerplateIncoming.log_user_in |
( |
| self, |
|
|
str | email = '' ) |
_summary_
Attempt to log the user in based on the provided credentials and the database.
Args:
email (str): _description_: The email of the account
Returns:
Dict[str, Any]: _description_: The response status
{'status':Union[success, error], 'token':Union['some_token', '']}
Definition at line 117 of file incomming.py.
◆ log_user_out()
Dict[str, Any] src.lib.boilerplates.incomming.BoilerplateIncoming.log_user_out |
( |
| self, |
|
|
str | token = "" ) |
_summary_
Attempt to log the user out based on the provided token.
Args:
token (str): _description_: The token of the account
Returns:
Dict[str, Any]: _description_: The response status
{'status':Union[success, error], 'msg':'message'}
Definition at line 220 of file incomming.py.
◆ logged_in()
bool src.lib.boilerplates.incomming.BoilerplateIncoming.logged_in |
( |
| self, |
|
|
Request | request ) |
_summary_
This is a function that will check if the user is logged in or not.
Args:
request (Request): _description_: The request object
Returns:
bool: _description_: True if the user is logged in, False otherwise
Definition at line 52 of file incomming.py.
◆ token_correct()
bool src.lib.boilerplates.incomming.BoilerplateIncoming.token_correct |
( |
| self, |
|
|
Request | request ) |
_summary_
This is a function that will check if the token is correct or not.
Args:
request (Request): _description_: The request object
Returns:
bool: _description_: True if the token is correct, False otherwise
Definition at line 31 of file incomming.py.
◆ debug
bool src.lib.boilerplates.incomming.BoilerplateIncoming.debug = debug |
◆ disp
Disp src.lib.boilerplates.incomming.BoilerplateIncoming.disp |
Initial value:= Disp(
TOML_CONF,
FILE_DESCRIPTOR,
SAVE_TO_FILE,
FILE_NAME,
debug=self.debug,
logger=self.__class__.__name__
)
Definition at line 22 of file incomming.py.
◆ error
int src.lib.boilerplates.incomming.BoilerplateIncoming.error = error |
◆ runtime_data_initialised
RuntimeData src.lib.boilerplates.incomming.BoilerplateIncoming.runtime_data_initialised = runtime_data |
◆ success
int src.lib.boilerplates.incomming.BoilerplateIncoming.success = success |
The documentation for this class was generated from the following file: