WebService
webservice · OCA/web-api
OCA/web-api 12.0–19.0 · OCA/edi 13.0
Health
92/100
good
-
Security22/251 minor finding
-
Activity25/25Last human commit 2 months ago
-
Required by20/252 modules depend on it
-
Maturity25/25In 8 Odoo series since 12.0
Heuristic over the facts below, not an audit · How it's computed
Required by
2
Modules depending on it
External deps
4 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.15 MB
Module directory on disk
Code analysis
1 migration note
1 model
3 views
1 HTTP endpoint
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. (2 occurrences in this file) migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
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.
Dependencies
- Odoo dependencies
- Python dependencies
- oauthlib, requests-oauthlib, responses, cachetools
- System dependencies
- None
- Required by
- edi_webservice_oca, webservice_server_env
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
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) -
create(self, vals_list)@api.model_create_multi -
write(self, vals)
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…