diff --git a/setup.cfg b/setup.cfg index aa32d3f..c98ddad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,13 @@ [metadata] name = Flask-authgen-jwt -version = 3.0.0 +version = 3.0.1 author = Diego Martinez and Guillermo Ortega author_email = gd-code@outlook.com description = JWT authentication and generator for Flask routes long_description = file: README.md long_description_content_type = text/markdown requires-python = ">=3.9" +license_files = LICENSE url = https://github.com/dmtzs/Flask-authgen-jwt project_urls = Bug Tracker = https://github.com/dmtzs/Flask-authgen-jwt/issues diff --git a/src/flask_authgen_jwt.py b/src/flask_authgen_jwt.py index 7e773d9..b2837e7 100644 --- a/src/flask_authgen_jwt.py +++ b/src/flask_authgen_jwt.py @@ -20,7 +20,7 @@ class Core(): basic_auth_callback: Callable[[str, str], bool] = None - enc_dec_jwt_callback: dict[Union[bytes, str]] = None + enc_dec_jwt_callback: dict[str, Union[bytes, str]] = None get_user_roles_callback: list = None personal_credentials: tuple[str, str] = None @@ -104,7 +104,7 @@ def ensure_sync(self, func: Callable) -> Callable: class GenJwt(Core): def __init__(self, rsa_encrypt: bool = False) -> None: - self.jwt_fields_attr: dict = None + self.jwt_fields_attr: dict[str, datetime] = None self.rsa_encrypt: bool = rsa_encrypt def __create_jwt_payload(self, bauth_credentials: dict[str, str]) -> dict[str, Union[str, datetime]]: @@ -179,7 +179,7 @@ def __encode_jwt(self, payload: dict) -> Optional[str]: encoded_token = None return encoded_token - def jwt_claims(self, func: Callable[[None], dict]) -> None: + def jwt_claims(self, func: Callable[[None], dict[str, datetime]]) -> None: """Decorator to add the claims to the JWT payload, default fields are: - username: username of the user - password: password of the user @@ -290,7 +290,7 @@ def __verify_token(self, token: dict) -> None: if key not in token: self.gen_abort_error("Credentials to validate for authentication inside token are not correct", 401) - def __authenticate_credentials(self, token: dict) -> bool: + def __authenticate_credentials(self, token: dict[str, str]) -> bool: """ Verify the credentials of the user, if the credentials are not correct then the user will be unauthorized :param token: token to verify the credentials