Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] [IMP] webservice: add support for oauth2 #35

Merged
merged 3 commits into from May 14, 2024

Conversation

gurneyalex
Copy link
Member

No description provided.

@OCA-git-bot
Copy link
Contributor

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

@gurneyalex gurneyalex force-pushed the 16.0-webservice-oauth2 branch 3 times, most recently from 618b2c3 to 6061dea Compare March 4, 2024 18:03
@gurneyalex gurneyalex marked this pull request as ready for review March 4, 2024 18:21
Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

We need tests

webservice/components/request_adapter.py Outdated Show resolved Hide resolved
@gurneyalex gurneyalex marked this pull request as draft March 7, 2024 08:18
@gurneyalex
Copy link
Member Author

changing to draft: this implementation requests a new token for each api call, and some OAuth2 provider have an invoicing per token -> not acceptable.

@gurneyalex gurneyalex marked this pull request as ready for review March 12, 2024 11:04
webservice/README.rst Outdated Show resolved Hide resolved
webservice/components/request_adapter.py Outdated Show resolved Hide resolved
webservice/components/request_adapter.py Outdated Show resolved Hide resolved
webservice/components/request_adapter.py Outdated Show resolved Hide resolved
webservice/components/request_adapter.py Outdated Show resolved Hide resolved
webservice/models/webservice_backend.py Outdated Show resolved Hide resolved
@gurneyalex gurneyalex force-pushed the 16.0-webservice-oauth2 branch 4 times, most recently from ae82a36 to fc2accf Compare March 18, 2024 13:06
Copy link

@SilvioC2C SilvioC2C left a comment

Choose a reason for hiding this comment

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

LGTM overall

responses.add(responses.GET, f"{self.url}endpoint", body="OK")

with mock_cursor(self.env.cr):
result = self.webservice.call("get", url=f"{self.url}endpoint")
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to test that commit has been called? Or that rollback is handled in case of errors?

Copy link
Member Author

@gurneyalex gurneyalex Apr 8, 2024

Choose a reason for hiding this comment

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

@simahawk tests added in ee889c4

Allow using oauth2 with Backend Application Flow / Client Credentials
Grant.
@gurneyalex gurneyalex added this to the 16.0 milestone Apr 16, 2024
@gurneyalex gurneyalex changed the title [IMP] webservice: add support for oauth2 [16.0] [IMP] webservice: add support for oauth2 Apr 16, 2024
@gurneyalex
Copy link
Member Author

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-35-by-gurneyalex-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 5b5c5e0 into OCA:16.0 May 14, 2024
5 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 0524d1b. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants