Skip to content

[18.0][ADD] webservice_client_certificate_auth: new module - #123

Open
vvrossem wants to merge 3 commits into
OCA:18.0from
camptocamp:18.0-add-webservice_client_certificate_auth
Open

vvrossem wants to merge 3 commits into
OCA:18.0from
camptocamp:18.0-add-webservice_client_certificate_auth

Conversation

@vvrossem

@vvrossem vvrossem commented Feb 3, 2026

Copy link
Copy Markdown

No description provided.

@vvrossem
vvrossem force-pushed the 18.0-add-webservice_client_certificate_auth branch from 9a9c865 to 2afcbb3 Compare February 3, 2026 12:57
@vvrossem
vvrossem marked this pull request as draft February 4, 2026 08:11
@vvrossem
vvrossem marked this pull request as ready for review February 4, 2026 10:09
res = super()._setup_records()
cls.url = "https://localhost.demo.odoo/"
# Certificate and private key configuration
os.environ["SERVER_ENV_CONFIG"] = "\n".join(

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

self.assertEqual(kwargs["cert"], ("/path/client.cert", "/path/client.key"))

def test_request_adapter_certificate_only(self):
with mock.patch("requests.request") as mock_request:

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

IIRC, I couldn't retrieve the request's kwargs using responses

@vvrossem
vvrossem force-pushed the 18.0-add-webservice_client_certificate_auth branch 2 times, most recently from 0ab4d43 to 42cc48d Compare February 9, 2026 09:48
@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 14, 2026
@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 21, 2026

@SilvioC2C SilvioC2C 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.

LGTM

for auth_type, oauth2_flow in [
(tp, fl)
for tp in ws._fields["auth_type"].get_values(ws.env)
for tp in ["none", "user_pwd", "api_key", "oauth2"]

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.

Can you add a small comment to explain why these values are hardcoded?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thankfully I wrote it in the commit message, because I didn't remember why I hardcoded the values 😅

The test `test_oauth2_flow_compute_with_ui` iterates over all available `auth_type` values.

When a module extends `webservice` with an additional `auth_type` (e.g., `client_certificate`),
this test fails because it does not know how to populate the new required fields for that type.

This commit restricts the test loop to the authentication types defined in `webservice` module.

Comment is added

@OCA-git-bot OCA-git-bot added mod:webservice Module webservice series:18.0 mod:webservice_client_certificate_auth Module webservice_client_certificate_auth labels Sep 23, 2026
The test `test_oauth2_flow_compute_with_ui` iterates over all available `auth_type` values.

When a module extends `webservice` with an additional `auth_type` (e.g., `client_certificate`),
this test fails because it does not know how to populate the new required fields for that type.

This commit restricts the test loop to the authentication types defined in `webservice` module.
Server environment support is optional in webservice since
webservice_server_env was split out. Keep the client certificate
server env fields in a glue module so that
webservice_client_certificate_auth does not force server_environment.
@vvrossem
vvrossem force-pushed the 18.0-add-webservice_client_certificate_auth branch from 6a55b11 to 4591dea Compare September 23, 2026 13:02
@OCA-git-bot OCA-git-bot added the mod:webservice_client_certificate_auth_server_env Module webservice_client_certificate_auth_server_env label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved mod:webservice_client_certificate_auth_server_env Module webservice_client_certificate_auth_server_env mod:webservice_client_certificate_auth Module webservice_client_certificate_auth mod:webservice Module webservice ready to merge series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants