TIP: You can type at any time to perform a new search.
WebService
webservice · OCA/web-api
🛠 Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `SELECT oauth2_token FROM webservice_backend WHERE id=%s FOR NO KEY UPDATE` - re-check the table/column names still match after upgrading. migration-raw-sql-write
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE webservice_backend SET oauth2_token=%s WHERE id=%s` - re-check the table/column names still match after upgrading. migration-raw-sql-write
Found by automated static analysis: patterns worth a look before/after upgrading this module to a newer Odoo version.
- Repository
- OCA/web-api · module folder · Try on Runboat
- Module version
- 1.2.0
- Category
- Uncategorized
- Folder size
- 0.14 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/web-api
- Last tracking update
- 2026-08-11 17:30:52
- Authors
- Camptocamp, Odoo Community Association (OCA), Creu Blanca
- Maintainers
- Camptocamp, Odoo Community Association (OCA), Creu Blanca
- Committers
- Ricardoalso, Iván Todorovich, Maksym Yankin, Weblate, OCA-git-bot, oca-ci
- Odoo dependencies
- Python dependencies
- oauthlib, requests-oauthlib, responses, cachetools
- System dependencies
- None
- Required by
- edi_webservice_oca, webservice_server_env
- Description
This module creates WebService frameworks to be used globally. The module introduces support for HTTP Request protocol. The webservice HTTP call returns by default the content of the response. A context 'content_only' can be passed to get the full response object.
Code Analysis ⓘ
Views touched (3)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
webservice_backend_form_view |
webservice.backend.form (in webservice) | webservice.backend | form | New |
webservice_backend_search_view |
webservice.backend.search (in webservice) | webservice.backend | search | New |
webservice_backend_tree_view |
webservice.backend.tree (in webservice) | webservice.backend | list | New |
HTTP endpoints (1)
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/webservice/<int:backend_id>/oauth2/redirect |
OAuth2Controller.redirect |
public | http | ALL | csrf off sudo |
Models touched (1)
New fields (25)
-
api_keyCharauth_type='api_key'string='API Key' -
api_key_headerCharauth_type='api_key'string='API Key header' -
auth_typeSelectionrequired=Trueselection=[('none', 'Public'), ('user_pwd', 'Username & password'), ('api_key', 'API Key'), ('oauth2', 'OAuth2')] -
company_idMany2one → res.companystring='Company' args: 'res.company' -
content_typeSelectionargs: [('application/json', 'JSON'), ('application/xml', 'XML'), ('application/x-www-form-urlencoded', 'Form')] -
nameCharrequired=True -
oauth2_audienceCharstring='Audience' -
oauth2_authorization_urlCharstring='Authorization URL' -
oauth2_client_auth_headerChardefault='Authorization'help='Header name used to send the client credentials when the client authentication method is a custom Authorization header.'string='Client Auth Header' -
oauth2_client_auth_methodSelectiondefault='client_secret_basic'help='How the client credentials are presented to the token endpoint.'string='Client Authentication' args: [('client_secret_basic', 'Client ID & Secret (HTTP Basic)'), ('custom_header', 'Custom Authorization header')] -
oauth2_client_auth_valueCharhelp="Full, static header value sent to the token endpoint when the client authentication method is a custom Authorization header (e.g. 'SSWS <token>')."string='Client Auth Header Value' -
oauth2_client_secretCharstring='Client Secret' -
oauth2_clientidCharstring='Client ID' -
oauth2_flowSelectionreadonly=False args: [('backend_application', 'Backend Application (Client Credentials Grant)'), ('web_application', 'Web Application (Authorization Code Grant)')] -
oauth2_scopeCharhelp='scope of the the authorization' -
oauth2_stateCharhelp='random key generated when authorization flow starts to ensure that no CSRF attack happen' -
oauth2_tokenCharhelp='the OAuth2 token (serialized JSON)' -
oauth2_token_methodSelectiondefault='post'help='HTTP method used to request the token from the token endpoint. Most providers use POST; some expose the token endpoint as GET.'string='Token Request Method' args: [('post', 'POST'), ('get', 'GET')] -
oauth2_token_urlCharauth_type='oauth2'string='Token URL' -
passwordCharauth_type='user_pwd' -
protocolSelectionrequired=True args: [('http', 'HTTP Request')] -
redirect_urlCharcompute='_compute_redirect_url'help='The redirect URL to be used as part of the OAuth2 authorisation flow' -
tech_nameCharrequired=True -
urlCharrequired=True -
usernameCharauth_type='user_pwd'
-
button_authorize(self) -
call(self, method, *args, **kwargs)
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…