Search 1.9 billion lines of Odoo code on GitHub

openapi

Author: IT-Projects LLC, Ivan Yelizariev
License: LGPL-3
Branch: 16.0
Repository: brain-tec/sync-addons
Dependencies: base, base_api, and mail
Languages: PO File (225, 8.8%), Python (1701, 66.8%), XML (405, 15.9%), and reStructuredText (217, 8.5%)
Other branches: 10.0, 10.0-exodus-12, 10.0-exodus-13, 10.0-exodus-15, 10.0-exodus-17, 10.0-exodus-18, 10.0-exodus-19, 11.0, 11.0-exodus-17, 11.0-exodus-19, 12.0, 12.0-exodus-17, 12.0-exodus-19, 13.0, 13.0-base_api-search_or_create, 13.0-exodus-17, 13.0-exodus-19, 13.0-fix-log-error, 14.0, 14.0-exodus-17, 14.0-exodus-19, 14.0-openapi, 14.0-sync-doc-external-proxy-service, 14.0-sync-type-mismatch-workaround, 14.0-sync_telegram-fix-project-active, 15.0, 15.0-sync_odoo2odoo, 15.0-sync_telegram, 15.0-sync_viber, 16.0-base_automation_webhook, 16.0-openapi, 8.0, 8.0-exodus-15, 8.0-exodus-16, 8.0-exodus-17, 8.0-exodus-19, and yelizariev-patch-1
Other repositories: DITIntl/sync-addons, ERPymes/ERPymes, Jeisonpernia/sync-addons, Kiplangatdan/sync-addons, NigmatullinAN/sync-addons, OpenAT/online, Posland/sync-addons, Raniani-lab/sync-addons, SeuMarco/sync-addons, TestMergeBot/sync-addons, WithPrice/sync-addons, ajinvn2019/sync-addons, akshaynesm/sync-addons, aschenkels-ictstudio/sync-addons, brain-tec/mail-addons, code-pack/sync-addons, dingguijin/sync-addons, elblasy33/sync-addons, em230418/sync-addons, flectra-hq/flectra, hinfo506/sync-addons, huntergps/sync-addons, itpp-labs/sync-addons, kevinpthorne/flectra, malakhA/sync-addons, marcelsavegnago/sync-addons, mausvt/flectra, molandtoxx/sync-addons, sinandurgut07/sync-addons, sisboca/sync-addons, trojikman/sync-addons, vidtsin/sync-addons, ychirino/openapi, and yelizariev/sync-addons

<a class="reference external image-reference" href="https://itpp.dev"><img alt="Tested and maintained by IT Projects Labs" src="https://itpp.dev/images/infinity-readme.png" /></a> <a class="reference external image-reference" href="https://www.gnu.org/licenses/lgpl"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a name="rest-api-openapi-swagger"></a> <h2>REST API/OpenAPI/Swagger</h2> <p>Set up REST API and export OpenAPI (Swagger) specification file for integration with whatever system you need. All can be configured in Odoo UI, no extra module is needed.</p> <p>This module implements a <code>/api/v1/</code> route tree.</p> <a name="authentication"></a> <h3>Authentication</h3> <ul class="simple"> <li>Database inference: Database name encoded and appended to the token</li> <li>User authentication through the actual token</li> </ul> <p>As a workaround for multi-db Odoo instances, system uses <a class="reference external" href="https://swagger.io/docs/specification/2-0/authentication/basic-authentication/">Basic Authentication</a> with <code>db_name:token</code> credentials, where <code>token</code> is a new field in <code>res.users</code> model. That is, whenever you see Username / Password to setup OpenAPI connection, use Database Name / OpenAPI toekn accordingly.</p> <a name="roadmap"></a> <h3>Roadmap</h3> <ul> <li><p class="first">TODO: Rewrite tests to replace dependency <code>mail</code> to <code>web</code> module.</p> </li> <li><p class="first">TODO: Add a button to developer menu to grant access to current model</p> <blockquote> <ul class="simple"> <li><a class="reference external" href="https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html">Activate Developer Mode</a></li> <li>Open the developer tools drop down</li> <li>Click menu <code>Configure REST API</code> located within the dropdown</li> <li>On the form that opens, activate and configure this module for REST API accessability.</li> <li>Click <code>[Apply]</code></li> </ul> </blockquote> </li> <li><p class="first">TODO: when user is not authenticated api returns 200 with the message below, instead of designed 401</p> <pre> <code>File &quot;/opt/odoo/vendor/it-projects-llc/sync-addons/openapi/controllers/pinguin.py&quot;, line 152, in authenticate_token_for_user raise werkzeug.exceptions.HTTPException(response=error_response(*CODE__no_user_auth)) HTTPException: ??? Unknown Error: None</code> </pre> </li> <li><p class="first">TODO: <code>wrap__resource__create_one</code> method makes <code>cr.commit()</code>. We need to avoid that.</p> </li> <li><p class="first">TODO: add code examples for other programming languages in index.html. The examples can be based on generated swagger clients. The idea of the scripts must be the same as for python (search for partner, create if it doesn't exist, send message)</p> </li> <li><p class="first">TODO: use sudo for log creating and disable write access rights</p> </li> <li><p class="first">TODO: finish unitttests (see <code>test_api.py</code>)</p> </li> <li><p class="first">TODO: <code>.../swagger.json</code> url doesn't work in multi-db mode in odoo 12.0 at least: it make strange redirection to from <code>/api/v1/demo/swagger.json?token=demo_token&amp;db=source</code> to <code>/api/v1/demo/swagger.json?token%3Ddemo_token%26db%3Dsource</code></p> </li> <li><p class="first">TODO: remove access to create logs and use sudo (SUPERUSER_ID) instead. It prevents making fake logs by malicous user</p> </li> <li><p class="first">TODO: Check that swagger specification and module documentaiton covers how to pass context to method calls</p> </li> </ul> <a name="questions"></a> <h3>Questions?</h3> <p>To get an assistance on this module contact us by email :arrow_right: <a class="reference external" href="mailto:help&#64;itpp.dev">help&#64;itpp.dev</a></p> <a name="contributors"></a> <h3>Contributors</h3> <ul class="simple"> <li><a class="reference external" href="mailto:dar&#64;xoe.solutions">David Arnold</a></li> <li><a class="reference external" href="https://it-projects.info/team/yelizariev">Ivan Yelizariev</a></li> <li><a class="reference external" href="https://it-projects.info/team/RafiZz">Rafis Bikbov</a></li> <li><a class="reference external" href="https://it-projects.info/team/ufaks">Stanislav Krotov</a></li> <li><a class="reference external" href="https://xoe.solutions">XOE Solutions</a></li> </ul> <hr class="docutils" /> <p>Odoo Apps Store: <a class="reference external" href="https://apps.odoo.com/apps/modules/15.0/openapi/">https://apps.odoo.com/apps/modules/15.0/openapi/</a></p> <p>Notifications on updates: <a class="reference external" href="https://github.com/itpp-labs/sync-addons/commits/15.0/openapi.atom">via Atom</a>, <a class="reference external" href="https://blogtrottr.com/?subscribe=https://github.com/itpp-labs/sync-addons/commits/15.0/openapi.atom">by Email</a></p> <p>Tested on <a class="reference external" href="https://github.com/odoo/odoo/commit/39c1288575a49a41cc7a1c65af153894fb503e62">Odoo 15.0</a></p>