From ef5483150bf01641f3f12b22692e5c306e1159b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez=20S=C3=A1nchez?= Date: Fri, 2 Dec 2022 22:33:20 -0600 Subject: [PATCH 1/4] Update flask_authgent_jwt.py --- src/flask_authgen_jwt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flask_authgen_jwt.py b/src/flask_authgen_jwt.py index 7e773d9..1558c7f 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 @@ -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 From e77c1dc302159e9bf7004a7130bd4044499d78f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez=20S=C3=A1nchez?= Date: Fri, 2 Dec 2022 22:43:02 -0600 Subject: [PATCH 2/4] Update flask_authgent_jwt.py Update a type hint of dict in the jwt_claims decorator --- src/flask_authgen_jwt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flask_authgen_jwt.py b/src/flask_authgen_jwt.py index 1558c7f..b2837e7 100644 --- a/src/flask_authgen_jwt.py +++ b/src/flask_authgen_jwt.py @@ -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 From 5023db47a00f10ad5f146c31fa0c39da78ea9c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez=20S=C3=A1nchez?= Date: Fri, 2 Dec 2022 22:44:12 -0600 Subject: [PATCH 3/4] Update setup.cfg Update the version of the library, only the revision part of the version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index aa32d3f..a655ad1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [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 From df4bbe26244d89fcbe23e8c5167895934596f0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez=20S=C3=A1nchez?= Date: Fri, 2 Dec 2022 22:46:37 -0600 Subject: [PATCH 4/4] Update setup.cfg Update the license of the library --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index a655ad1..c98ddad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,7 @@ 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