Repository navigation
[19.0][MIG] webservice_core - #172
Open
MiquelRForgeFlow wants to merge 41 commits into
Open
MiquelRForgeFlow wants to merge 41 commits into
MiquelRForgeFlow wants to merge 41 commits into
Conversation
Contributor
|
Hi @etobella, |
Author
4 of 8 tasks
Ricardoalso
approved these changes
Oct 28, 2026
Author
|
|
Contributor
My bad, I didn't read the module properly as I was FWP a bunch of commits. I'll do it |
Contributor
|
I would include this #175 |
MiquelRForgeFlow
force-pushed
the
19.0-mig-webservice_core
branch
from
October 29, 2026 10:32
ce98456 to
e6ac02d
Compare
webservice_core: improve tech_name * go to mixin to be reusable * auto-generate it and auto-clean it
`_request()` defaulted `content_only` to `True`, silently returning raw bytes instead of the `requests.Response` object callers expect. The OAuth2 backend adapter ignored the flag entirely, always returning bytes (fixes OCA#142). OCA#144 fixes the OAuth2 inconsistency but keeps `content_only` as a kwarg (default `None`, warns, still defaults to `True`) - perpetuating the actual problem: the return type shouldn't be a per-call switch, especially when raw content is just `.response.content` away. Here, `_request()` always returns the full response; the kwarg is dropped (a stray one is popped and warned about, not left to crash inside `requests.request()`). Backward compat is handled once, at the database level: the `18.0.2.0.1` upgrade script sets a `webservice.request_content_only` system parameter on existing databases only, preserving old behavior for calling code that relied on the implicit default. Delete the parameter to switch to the new behavior. The compat switch lives in `webservice`, not `webservice_core`: the latter is new and unreleased, so its `_request()` stays simple with no compat baggage.
Until now the OAuth2 "Backend Application (Client Credentials)" flow
always requested the token in one fixed way: an HTTP POST where the
client id and secret were turned into an HTTP Basic Authorization header
(this is what oauthlib does by default). Providers that deviate from
that could not be used.
Two configuration options are added to the webservice backend so those
providers can be supported through configuration only:
- Token Request Method: POST (default) or GET, for providers that expose
the token endpoint as a GET.
- Client Authentication: how the client credentials are presented to the
token endpoint:
* Client ID & Secret (HTTP Basic) (default): the previous behavior,
unchanged.
* Custom Authorization header: a static, verbatim header value (for
example "SSWS <token>"). In this case the Client ID / Client Secret
fields are not used; the header name and value are configured
directly instead.
The defaults keep the exact same behavior as before, so existing
backends are not affected. The custom header is injected through a small
requests auth handler so that oauthlib does not overwrite it with its
automatic Basic Authorization header.
Two validation rules make sure the right fields are filled in depending
on the chosen client authentication: the client id and secret for the
HTTP Basic method, or the header name and value for the custom header
method.
MiquelRForgeFlow
force-pushed
the
19.0-mig-webservice_core
branch
from
October 29, 2026 10:38
e6ac02d to
4e938b3
Compare
The webservice module gained new OAuth2 configuration fields (the token request method, the client authentication method, and the custom Authorization header name and value). These are now also manageable through server environment configuration files, like the other webservice fields.
Currently translated at 100.0% (28 of 28 strings) Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/it/
# Conflicts: # webservice_core/README.rst # Conflicts: # webservice_core/static/description/index.html
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/
Currently translated at 100.0% (60 of 60 strings) Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/
Currently translated at 100.0% (62 of 62 strings) Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/it/
List the endpoints of the backend in a tab of the backend form, next to the existing endpoints smart button.
Show the Archived ribbon on the webservice endpoint form when the endpoint is inactive, as the EDI views do.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/
MiquelRForgeFlow
force-pushed
the
19.0-mig-webservice_core
branch
from
November 2, 2026 13:09
4e938b3 to
3165203
Compare
Currently translated at 100.0% (63 of 63 strings) Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/it/
With webservice_server_env installed, the ORM reads the backend URL and credentials from the server environment instead of the columns the neutralization script updates. Seed and check the columns with SQL.
Flag querystring params carrying secrets as secret: the value is hidden in the UI and replaced by the neutralize script.
Same as querystring params: flag headers carrying secrets as secret, the value is hidden in the UI and replaced by the neutralize script.
Mask the value of secret headers and querystring params in the call debug log, including the ones merged from the backend or the endpoint. Share the key blacklist of sanitize_url_for_log, so that sensitive looking names (apikey, password, pwd) get masked as well.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/
Currently translated at 96.9% (63 of 65 strings) Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/it/
Currently translated at 100.0% (65 of 65 strings) Translation: web-api-18.0/web-api-18.0-webservice_core Translate-URL: https://translation.odoo-community.org/projects/web-api-18-0/web-api-18-0-webservice_core/it/
Now that the base auth fields live in webservice_core, move their neutralization there too: webservice_core clears username, password and API key (of both backends and endpoints, which can override the backend's authentication), while webservice keeps clearing the OAuth2 credentials.
MiquelRForgeFlow
force-pushed
the
19.0-mig-webservice_core
branch
from
November 10, 2026 11:10
3165203 to
d55d4a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.