Skip to content

[19.0][MIG] webservice_core - #172

Open
MiquelRForgeFlow wants to merge 41 commits into
OCA:19.0from
ForgeFlow:19.0-mig-webservice_core
Open

MiquelRForgeFlow wants to merge 41 commits into
OCA:19.0from
ForgeFlow:19.0-mig-webservice_core

Conversation

@MiquelRForgeFlow

Copy link
Copy Markdown

.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:webservice Module webservice mod:webservice_server_env Module webservice_server_env series:19.0 mod:webservice_core Module webservice_core labels Sep 30, 2026
@MiquelRForgeFlow

Copy link
Copy Markdown
Author

@simahawk

@Ricardoalso Ricardoalso left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you FWP this one too #146 ? 🙏

@MiquelRForgeFlow

Copy link
Copy Markdown
Author

webservice_server_env is not in my priority right now, but maybe in the future I'll do if nobody else migrated it.

@Ricardoalso

Copy link
Copy Markdown
Contributor

webservice_server_env is not in my priority right now, but maybe in the future I'll do if nobody else migrated it.

My bad, I didn't read the module properly as I was FWP a bunch of commits.

I'll do it

@simahawk

Copy link
Copy Markdown
Contributor

I would include this #175

@MiquelRForgeFlow
MiquelRForgeFlow force-pushed the 19.0-mig-webservice_core branch from ce98456 to e6ac02d Compare October 29, 2026 10:32
simahawk and others added 7 commits October 29, 2026 11:37
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
MiquelRForgeFlow force-pushed the 19.0-mig-webservice_core branch from e6ac02d to 4e938b3 Compare October 29, 2026 10:38
ivantodorovich and others added 9 commits November 2, 2026 14:08
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/
simahawk and others added 11 commits November 2, 2026 14:08
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
MiquelRForgeFlow force-pushed the 19.0-mig-webservice_core branch from 4e938b3 to 3165203 Compare November 2, 2026 13:09
mymage and others added 14 commits November 10, 2026 12:03
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:webservice_core Module webservice_core mod:webservice_server_env Module webservice_server_env mod:webservice Module webservice series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants