From a29ffcdd95f7966261adc91bc4c5daf84ebf9b35 Mon Sep 17 00:00:00 2001 From: kobros-tech Date: Wed, 6 Nov 2024 22:33:26 +0300 Subject: [PATCH] [FIX] fastapi_auth_jwt_demo: assign and show Auth Jwt Validator --- fastapi_auth_jwt_demo/README.rst | 5 ++++ fastapi_auth_jwt_demo/__manifest__.py | 6 +++-- .../demo/fastapi_endpoint.xml | 1 + .../models/fastapi_endpoint.py | 1 + fastapi_auth_jwt_demo/readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 21 ++++++++++----- .../views/fastapi_endpoint_demo.xml | 26 +++++++++++++++++++ 7 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 fastapi_auth_jwt_demo/readme/CONTRIBUTORS.rst create mode 100644 fastapi_auth_jwt_demo/views/fastapi_endpoint_demo.xml diff --git a/fastapi_auth_jwt_demo/README.rst b/fastapi_auth_jwt_demo/README.rst index 018a3ea7..d2b99dd9 100644 --- a/fastapi_auth_jwt_demo/README.rst +++ b/fastapi_auth_jwt_demo/README.rst @@ -56,6 +56,11 @@ Authors * ACSONE SA/NV +Contributors +~~~~~~~~~~~~ + +Mohamed Alkobrosli + Maintainers ~~~~~~~~~~~ diff --git a/fastapi_auth_jwt_demo/__manifest__.py b/fastapi_auth_jwt_demo/__manifest__.py index 1583de7c..025397a5 100644 --- a/fastapi_auth_jwt_demo/__manifest__.py +++ b/fastapi_auth_jwt_demo/__manifest__.py @@ -10,7 +10,9 @@ "author": "ACSONE SA/NV,Odoo Community Association (OCA)", "maintainers": ["sbidoul"], "website": "https://github.com/OCA/rest-framework", - "depends": ["fastapi_auth_jwt", "auth_jwt_demo"], - "data": [], + "depends": ["fastapi", "fastapi_auth_jwt", "auth_jwt_demo"], + "data": [ + "views/fastapi_endpoint_demo.xml", + ], "demo": ["demo/fastapi_endpoint.xml"], } diff --git a/fastapi_auth_jwt_demo/demo/fastapi_endpoint.xml b/fastapi_auth_jwt_demo/demo/fastapi_endpoint.xml index 187a2631..2a76f339 100644 --- a/fastapi_auth_jwt_demo/demo/fastapi_endpoint.xml +++ b/fastapi_auth_jwt_demo/demo/fastapi_endpoint.xml @@ -5,5 +5,6 @@ auth_jwt_demo /fastapi_auth_jwt_demo + diff --git a/fastapi_auth_jwt_demo/models/fastapi_endpoint.py b/fastapi_auth_jwt_demo/models/fastapi_endpoint.py index 73b26531..9301004c 100644 --- a/fastapi_auth_jwt_demo/models/fastapi_endpoint.py +++ b/fastapi_auth_jwt_demo/models/fastapi_endpoint.py @@ -16,6 +16,7 @@ class FastapiEndpoint(models.Model): selection_add=[(APP_NAME, "Auth JWT Demo Endpoint")], ondelete={APP_NAME: "cascade"}, ) + auth_jwt_validator_id = fields.Many2one("auth.jwt.validator") @api.model def _get_fastapi_routers(self): diff --git a/fastapi_auth_jwt_demo/readme/CONTRIBUTORS.rst b/fastapi_auth_jwt_demo/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..f78c107c --- /dev/null +++ b/fastapi_auth_jwt_demo/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +Mohamed Alkobrosli diff --git a/fastapi_auth_jwt_demo/static/description/index.html b/fastapi_auth_jwt_demo/static/description/index.html index 459557fc..5334b886 100644 --- a/fastapi_auth_jwt_demo/static/description/index.html +++ b/fastapi_auth_jwt_demo/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -379,7 +379,8 @@

FastAPI Auth JWT Test

  • Bug Tracker
  • Credits
  • @@ -400,10 +401,16 @@

    Authors

  • ACSONE SA/NV
  • +
    +

    Contributors

    +

    Mohamed Alkobrosli <alkobroslymohamed@gmail.com>

    +
    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    diff --git a/fastapi_auth_jwt_demo/views/fastapi_endpoint_demo.xml b/fastapi_auth_jwt_demo/views/fastapi_endpoint_demo.xml new file mode 100644 index 00000000..0c65cf0c --- /dev/null +++ b/fastapi_auth_jwt_demo/views/fastapi_endpoint_demo.xml @@ -0,0 +1,26 @@ + + + + + + fastapi.endpoint.demo.jwt.form + fastapi.endpoint + + + + + + + + + + +