Skip to content

[15.0][MIG] base_rest_auth_jwt: Migration to 15.0 #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^base_rest_auth_jwt/|
^base_rest_auth_user_service/|
^graphql_base/|
^graphql_demo/|
10 changes: 5 additions & 5 deletions base_rest_auth_jwt/README.rst
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@ Base Rest 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%2Frest--framework-lightgray.png?logo=github
:target: https://github.com/OCA/rest-framework/tree/14.0/base_rest_auth_jwt
:target: https://github.com/OCA/rest-framework/tree/15.0/base_rest_auth_jwt
:alt: OCA/rest-framework
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rest-framework-14-0/rest-framework-14-0-base_rest_auth_jwt
:target: https://translation.odoo-community.org/projects/rest-framework-15-0/rest-framework-15-0-base_rest_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/271/14.0
:target: https://runbot.odoo-community.org/runbot/271/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -40,7 +40,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/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 <https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_auth_jwt%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_auth_jwt%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

@@ -78,6 +78,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-lmignon|

This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/14.0/base_rest_auth_jwt>`_ project on GitHub.
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/15.0/base_rest_auth_jwt>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions base_rest_auth_jwt/__manifest__.py
Original file line number Diff line number Diff line change
@@ -6,13 +6,13 @@
"summary": """
Base Rest: Add support for the auth_jwt security policy into the
openapi documentation""",
"version": "14.0.1.1.0",
"version": "15.0.1.0.0",
"license": "LGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/rest-framework",
"depends": ["base_rest", "auth_jwt"],
"maintainers": ["lmignon"],
"installable": False,
"installable": True,
"auto_install": True,
"external_dependencies": {
"python": [
9 changes: 4 additions & 5 deletions base_rest_auth_jwt/apispec/rest_method_security_plugin.py
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@

class RestMethodSecurityPlugin(BasePlugin):
def __init__(self, service):
super(RestMethodSecurityPlugin, self).__init__()
super().__init__()
self._service = service

def init_spec(self, spec):
super(RestMethodSecurityPlugin, self).init_spec(spec)
super().init_spec(spec)
self.spec = spec
self.openapi_version = spec.openapi_version
jwt_scheme = {
@@ -21,13 +21,12 @@ def init_spec(self, spec):
"description": "Enter JWT Bearer Token ** only **",
}
spec.components.security_scheme("jwt", jwt_scheme)
return

def operation_helper(self, path=None, operations=None, **kwargs):
routing = kwargs.get("routing")
if not routing:
super(RestMethodSecurityPlugin, self).operation_helper(
path, operations, **kwargs
)
super().operation_helper(path, operations, **kwargs)
if not operations:
return
auth = routing.get("auth", self.spec._params.get("default_auth"))
2 changes: 1 addition & 1 deletion base_rest_auth_jwt/components/service.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ class BaseRestService(AbstractComponent):
_inherit = "base.rest.service"

def _get_api_spec(self, **params):
spec = super(BaseRestService, self)._get_api_spec(**params)
spec = super()._get_api_spec(**params)
plugin = RestMethodSecurityPlugin(self)
plugin.init_spec(spec)
spec.plugins.append(plugin)
2 changes: 1 addition & 1 deletion base_rest_auth_jwt/i18n/base_rest_auth_jwt.pot
Original file line number Diff line number Diff line change
@@ -3,7 +3,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"
6 changes: 3 additions & 3 deletions base_rest_auth_jwt/static/description/index.html
Original file line number Diff line number Diff line change
@@ -367,7 +367,7 @@ <h1 class="title">Base Rest Auth Jwt</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rest-framework/tree/14.0/base_rest_auth_jwt"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rest-framework-14-0/rest-framework-14-0-base_rest_auth_jwt"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/271/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rest-framework/tree/15.0/base_rest_auth_jwt"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rest-framework-15-0/rest-framework-15-0-base_rest_auth_jwt"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/271/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This technical addon extend <cite>base_rest</cite> to add the support for auth_jwt
authentication mechanism into the generated openapi documentation.</p>
<p><strong>Table of contents</strong></p>
@@ -387,7 +387,7 @@ <h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_auth_jwt%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20base_rest_auth_jwt%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -413,7 +413,7 @@ <h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/lmignon"><img alt="lmignon" src="https://github.com/lmignon.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/14.0/base_rest_auth_jwt">OCA/rest-framework</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/15.0/base_rest_auth_jwt">OCA/rest-framework</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
1 change: 1 addition & 0 deletions setup/base_rest_auth_jwt/odoo/addons/base_rest_auth_jwt
6 changes: 6 additions & 0 deletions setup/base_rest_auth_jwt/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odoo-addon-auth_jwt @ git+https://github.com/OCA/server-auth@refs/pull/316/head#subdirectory=setup/auth_jwt