diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df23c75f9..6f2f3b5cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,6 @@ exclude: | (?x) # NOT INSTALLABLE ADDONS - ^auth_jwt/| - ^auth_jwt_demo/| # END NOT INSTALLABLE ADDONS # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| diff --git a/auth_jwt/README.rst b/auth_jwt/README.rst index 002a5092b..c68c2e015 100644 --- a/auth_jwt/README.rst +++ b/auth_jwt/README.rst @@ -2,10 +2,13 @@ Auth JWT ======== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:59acb0b9fa19ae7e8558377699e70c316d9d3a533902fb6561ba23eef1d8bbe7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -14,16 +17,16 @@ Auth JWT :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/14.0/auth_jwt + :target: https://github.com/OCA/server-auth/tree/15.0/auth_jwt :alt: OCA/server-auth .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-auth-14-0/server-auth-14-0-auth_jwt + :target: https://translation.odoo-community.org/projects/server-auth-15-0/server-auth-15-0-auth_jwt :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/251/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=15.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| JWT bearer token authentication. @@ -101,8 +104,8 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -140,6 +143,6 @@ Current `maintainer `__: |maintainer-sbidoul| -This module is part of the `OCA/server-auth `_ project on GitHub. +This module is part of the `OCA/server-auth `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_jwt/__manifest__.py b/auth_jwt/__manifest__.py index c97318651..cf1728c39 100644 --- a/auth_jwt/__manifest__.py +++ b/auth_jwt/__manifest__.py @@ -5,7 +5,7 @@ "name": "Auth JWT", "summary": """ JWT bearer token authentication.""", - "version": "14.0.1.2.0", + "version": "15.0.1.0.0", "license": "LGPL-3", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "maintainers": ["sbidoul"], @@ -14,5 +14,5 @@ "external_dependencies": {"python": ["pyjwt", "cryptography"]}, "data": ["security/ir.model.access.csv", "views/auth_jwt_validator_views.xml"], "demo": [], - "installable": False, + "installable": True, } diff --git a/auth_jwt/i18n/auth_jwt.pot b/auth_jwt/i18n/auth_jwt.pot index 5d22a8cac..ad04f9a66 100644 --- a/auth_jwt/i18n/auth_jwt.pot +++ b/auth_jwt/i18n/auth_jwt.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/auth_jwt/models/auth_jwt_validator.py b/auth_jwt/models/auth_jwt_validator.py index 5d841888b..41451abee 100644 --- a/auth_jwt/models/auth_jwt_validator.py +++ b/auth_jwt/models/auth_jwt_validator.py @@ -114,7 +114,7 @@ def _decode(self, token): header = jwt.get_unverified_header(token) except Exception as e: _logger.info("Invalid token: %s", e) - raise UnauthorizedInvalidToken() + raise UnauthorizedInvalidToken() from e key = self._get_key(header.get("kid")) algorithm = self.public_key_algorithm try: @@ -133,7 +133,7 @@ def _decode(self, token): ) except Exception as e: _logger.info("Invalid token: %s", e) - raise UnauthorizedInvalidToken() + raise UnauthorizedInvalidToken() from e return payload def _get_uid(self, payload): @@ -194,8 +194,8 @@ def _unregister_auth_method(self): try: delattr(IrHttp.__class__, f"_auth_method_jwt_{rec.name}") delattr(IrHttp.__class__, f"_auth_method_public_or_jwt_{rec.name}") - except AttributeError: - pass + except AttributeError as e: + _logger.info("AttributeError: %s", e) @api.model_create_multi def create(self, vals): diff --git a/auth_jwt/static/description/index.html b/auth_jwt/static/description/index.html index bd621ae44..71dc742d2 100644 --- a/auth_jwt/static/description/index.html +++ b/auth_jwt/static/description/index.html @@ -1,20 +1,20 @@ - + - + Auth JWT