|
1 | | -<?xml version="1.0" encoding="utf-8"?> |
2 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
3 | 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4 | 3 | <head> |
5 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
6 | 5 | <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" /> |
7 | | -<title>FastAPI Auth JWT Test</title> |
| 6 | +<title>FastAPI Auth JWT Model</title> |
8 | 7 | <style type="text/css"> |
9 | 8 |
|
10 | 9 | /* |
11 | 10 | :Author: David Goodger (goodger@python.org) |
12 | | -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ |
| 11 | +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ |
13 | 12 | :Copyright: This stylesheet has been placed in the public domain. |
14 | 13 |
|
15 | 14 | Default cascading style sheet for the HTML output of Docutils. |
| 15 | +Despite the name, some widely supported CSS2 features are used. |
16 | 16 |
|
17 | 17 | See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to |
18 | 18 | customize this style sheet. |
|
275 | 275 | margin-left: 2em ; |
276 | 276 | margin-right: 2em } |
277 | 277 |
|
278 | | -pre.code .ln { color: grey; } /* line numbers */ |
| 278 | +pre.code .ln { color: gray; } /* line numbers */ |
279 | 279 | pre.code, code { background-color: #eeeeee } |
280 | 280 | pre.code .comment, code .comment { color: #5C6576 } |
281 | 281 | pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } |
|
301 | 301 | span.pre { |
302 | 302 | white-space: pre } |
303 | 303 |
|
304 | | -span.problematic { |
| 304 | +span.problematic, pre.problematic { |
305 | 305 | color: red } |
306 | 306 |
|
307 | 307 | span.section-subtitle { |
|
360 | 360 | </style> |
361 | 361 | </head> |
362 | 362 | <body> |
363 | | -<div class="document" id="fastapi-auth-jwt-test"> |
364 | | -<h1 class="title">FastAPI Auth JWT Test</h1> |
| 363 | +<div class="document" id="fastapi-auth-jwt-model"> |
| 364 | +<h1 class="title">FastAPI Auth JWT Model</h1> |
365 | 365 |
|
366 | 366 | <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
367 | 367 | !! This file is generated by oca-gen-addon-readme !! |
368 | 368 | !! changes will be overwritten. !! |
369 | 369 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
370 | | -!! source digest: sha256:0808c6ada00df4f17e6f45cad7b22796dec0e945b1dddf2814d39a484e976b78 |
| 370 | +!! source digest: sha256:7e014d71c6caa0eee959cdf9b1153e4ef259b88623dbdac5ff634a95ccfd0695 |
371 | 371 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> |
372 | | -<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/rest-framework/tree/16.0/fastapi_auth_jwt_demo"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-fastapi_auth_jwt_demo"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> |
373 | | -<p>Tests and demo routes for <tt class="docutils literal">fastapi_auth_jwt</tt>.</p> |
374 | | -<p>The tests and routes are almost identical to those in <tt class="docutils literal">auth_jwt_demo</tt>, and |
375 | | -the JWT validators used are those from <tt class="docutils literal">auth_jwt_demo</tt>.</p> |
| 372 | +<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/rest-framework/tree/18.0/fastapi_auth_jwt_model"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-fastapi_auth_jwt_model"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> |
| 373 | +<p>A prototype routes for <tt class="docutils literal">fastapi_auth_jwt</tt>.</p> |
376 | 374 | <p><strong>Table of contents</strong></p> |
377 | 375 | <div class="contents local topic" id="contents"> |
378 | 376 | <ul class="simple"> |
379 | | -<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li> |
380 | | -<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul> |
381 | | -<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li> |
382 | | -<li><a class="reference internal" href="#maintainers" id="toc-entry-4">Maintainers</a></li> |
| 377 | +<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a><ul> |
| 378 | +<li><a class="reference internal" href="#example-on-using-the-api-as-a-url-having-arguments" id="toc-entry-2">Example on using the API as a URL having arguments</a></li> |
383 | 379 | </ul> |
384 | 380 | </li> |
| 381 | +<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li> |
| 382 | +<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul> |
| 383 | +<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li> |
| 384 | +<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li> |
| 385 | +<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li> |
385 | 386 | </ul> |
| 387 | +</li> |
| 388 | +</ul> |
| 389 | +</div> |
| 390 | +<div class="section" id="usage"> |
| 391 | +<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1> |
| 392 | +<div class="section" id="example-on-using-the-api-as-a-url-having-arguments"> |
| 393 | +<h2><a class="toc-backref" href="#toc-entry-2">Example on using the API as a URL having arguments</a></h2> |
| 394 | +<pre class="code Bash literal-block"> |
| 395 | +curl<span class="w"> </span>-X<span class="w"> </span><span class="s1">'GET'</span><span class="w"> </span><span class="se">\ |
| 396 | +</span><span class="w"> </span><span class="s1">'http://localhost:8069/fastapi_auth_http_model/whoami'</span><span class="w"> </span><span class="se">\ |
| 397 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'accept: application/json'</span><span class="w"> </span><span class="se">\ |
| 398 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'Authorization: Basic ZGVtbzpkZW1v'</span> |
| 399 | +</pre> |
| 400 | +<p>To get Access Key via headers API</p> |
| 401 | +<pre class="code Bash literal-block"> |
| 402 | +curl<span class="w"> </span>-X<span class="w"> </span><span class="s1">'POST'</span><span class="w"> </span><span class="se">\ |
| 403 | +</span><span class="w"> </span><span class="s1">'http://localhost:8069/fastapi_auth_http_model/get_access_token'</span><span class="w"> </span><span class="se">\ |
| 404 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'accept: application/json'</span><span class="w"> </span><span class="se">\ |
| 405 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'Content-Type: application/json'</span><span class="w"> </span><span class="se">\ |
| 406 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'Authorization: Basic ZGVtbzpkZW1v'</span><span class="w"> </span><span class="se">\ |
| 407 | +</span><span class="w"> </span>-d<span class="w"> </span><span class="s1">'{ |
| 408 | + "aud": "auth_jwt_test_api", |
| 409 | + "iss": "theissuer", |
| 410 | + "exp": 1734650709.8363235, |
| 411 | + "email": "string", |
| 412 | + "key": "thesecret", |
| 413 | + "algorithm": "HS256", |
| 414 | + "access_key": "string" |
| 415 | +}'</span> |
| 416 | +</pre> |
| 417 | +<p>To get Access Key via agumental API</p> |
| 418 | +<pre class="code Bash literal-block"> |
| 419 | +curl<span class="w"> </span>-X<span class="w"> </span><span class="s1">'GET'</span><span class="w"> </span><span class="se">\ |
| 420 | +</span><span class="w"> </span><span class="s1">'http://localhost:8069/fastapi_auth_http_model/get_access_token/args?aud=auth_jwt_test_api&iss=theissuer&exp=1734651126.588449&email=mark.brown23%40example.com&key=thesecret&algorithm=HS256'</span><span class="w"> </span><span class="se">\ |
| 421 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'accept: application/json'</span><span class="w"> </span><span class="se">\ |
| 422 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'Authorization: Basic ZGVtbzpkZW1v'</span><span class="w"> </span><span class="se">\</span> |
| 423 | +</pre> |
| 424 | +<pre class="code Bash literal-block"> |
| 425 | +curl<span class="w"> </span>-X<span class="w"> </span><span class="s1">'GET'</span><span class="w"> </span><span class="se">\ |
| 426 | +</span><span class="w"> </span><span class="s1">'http://localhost:8069/fastapi_auth_http_model/customer'</span><span class="w"> </span><span class="se">\ |
| 427 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'accept: application/json'</span><span class="w"> </span><span class="se">\ |
| 428 | +</span><span class="w"> </span>-H<span class="w"> </span><span class="s1">'Authorization: Basic ZGVtbzpkZW1v'</span><span class="w"> </span><span class="se">\</span> |
| 429 | +</pre> |
| 430 | +<p>The encryption is from <tt class="docutils literal">demo:demo</tt>, to test:</p> |
| 431 | +<p>encode</p> |
| 432 | +<pre class="code Bash literal-block"> |
| 433 | +<span class="nb">echo</span><span class="w"> </span>-n<span class="w"> </span><span class="s1">'demo:demo'</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>base64 |
| 434 | +</pre> |
| 435 | +<p>decode</p> |
| 436 | +<pre class="code Bash literal-block"> |
| 437 | +<span class="nb">echo</span><span class="w"> </span>-n<span class="w"> </span><span class="s1">'demo:demo'</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>base64<span class="w"> </span>-d |
| 438 | +</pre> |
| 439 | +</div> |
386 | 440 | </div> |
387 | 441 | <div class="section" id="bug-tracker"> |
388 | | -<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1> |
| 442 | +<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1> |
389 | 443 | <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>. |
390 | 444 | In case of trouble, please check there if your issue has already been reported. |
391 | 445 | If you spotted it first, help us to smash it by providing a detailed and welcomed |
392 | | -<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_auth_jwt_demo%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
| 446 | +<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20fastapi_auth_jwt_model%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
393 | 447 | <p>Do not contact contributors directly about support or help with technical issues.</p> |
394 | 448 | </div> |
395 | 449 | <div class="section" id="credits"> |
396 | | -<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1> |
| 450 | +<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1> |
397 | 451 | <div class="section" id="authors"> |
398 | | -<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2> |
| 452 | +<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2> |
399 | 453 | <ul class="simple"> |
400 | | -<li>ACSONE SA/NV</li> |
| 454 | +<li>kobros-tech</li> |
401 | 455 | </ul> |
402 | 456 | </div> |
| 457 | +<div class="section" id="contributors"> |
| 458 | +<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2> |
| 459 | +<p>Mohamed Alkobrosli <<a class="reference external" href="mailto:alkobroslymohamed@gmail.com">alkobroslymohamed@gmail.com</a>></p> |
| 460 | +</div> |
403 | 461 | <div class="section" id="maintainers"> |
404 | | -<h2><a class="toc-backref" href="#toc-entry-4">Maintainers</a></h2> |
| 462 | +<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2> |
405 | 463 | <p>This module is maintained by the OCA.</p> |
406 | | -<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> |
| 464 | +<a class="reference external image-reference" href="https://odoo-community.org"> |
| 465 | +<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> |
| 466 | +</a> |
407 | 467 | <p>OCA, or the Odoo Community Association, is a nonprofit organization whose |
408 | 468 | mission is to support the collaborative development of Odoo features and |
409 | 469 | promote its widespread use.</p> |
410 | 470 | <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> |
411 | | -<p><a class="reference external image-reference" href="https://github.com/sbidoul"><img alt="sbidoul" src="https://github.com/sbidoul.png?size=40px" /></a></p> |
412 | | -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/16.0/fastapi_auth_jwt_demo">OCA/rest-framework</a> project on GitHub.</p> |
| 471 | +<p><a class="reference external image-reference" href="https://github.com/kobros-tech"><img alt="kobros-tech" src="https://github.com/kobros-tech.png?size=40px" /></a></p> |
| 472 | +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/18.0/fastapi_auth_jwt_model">OCA/rest-framework</a> project on GitHub.</p> |
413 | 473 | <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> |
414 | 474 | </div> |
415 | 475 | </div> |
|
0 commit comments