pyauthorizer package¶
Copyright (c) 2023-2024 msclock. All rights reserved.
pyauthorizer: A simple authorizer for python project.
Subpackages¶
Submodules¶
pyauthorizer.cli module¶
- pyauthorizer.cli.convert_user_args_to_dict(user_list)[source]¶
Converts a list of user arguments to a dictionary.
- Parameters:
user_list (list) – A list of user arguments.
- Returns:
A dictionary containing the converted user arguments. The keys are the names extracted from the user arguments, and the values are the corresponding values.
- Return type:
- Raises:
PyAuthorizerError – If the user arguments are not in the correct format or if a parameter is repeated.
pyauthorizer.exceptions module¶
- class pyauthorizer.exceptions.ErrorName(internal_error=1, invalid_parameter_value=2, resource_does_not_exist=3)[source]¶
Bases:
object
Definitions for error codes.
- exception pyauthorizer.exceptions.PyAuthorizerError(message, error_code=1, **kwargs)[source]¶
Bases:
Exception
Generic exception thrown to surface failure information about external-facing operations.
If the error text is sensitive, raise a generic Exception object instead.
- Parameters:
message (str) – The message or exception describing the error that occurred. This will be included in the exception’s serialized JSON representation.
error_code (int) – An appropriate error code for the error that occurred. It will be included in the exception’s serialized JSON representation.
kwargs (
Any
) – Additional key-value pairs to include in the serialized JSON representation of the PyAuthorizerError.