Skip to content

Identify OAuth token requests with Mollie client headers - #396

Open
Shubham-Padkonde wants to merge 1 commit into
mollie:mainfrom
Shubham-Padkonde:fix/oauth-client-identification
Open

Shubham-Padkonde wants to merge 1 commit into
mollie:mainfrom
Shubham-Padkonde:fix/oauth-client-identification

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Fixes #296.

OAuth token exchange, refresh, and revocation currently use requests-oauthlib's default identification headers, unlike the normal API requests. Set User-Agent and X-Mollie-Client-Info on the OAuth session so token requests carry the same SDK information. Keep the session user-agent updated when an application changes a component after setup.

The parametrized regression covers authorization-code exchange, explicit refresh, automatic refresh, and revocation, both before and after updating an application component. It checks the actual outgoing headers and preserves OAuth's form content type.

Validation on Windows:

  • All eight new cases fail before the fix and pass afterward.
  • Full suite: 289 passed on Python 3.10.20 and 3.13.0; coverage 97.96% on both.
  • Full flake8 passes; mypy --config mypy.ini mollie/ passes (57 source files).
  • git diff --check passes.

No live OAuth credentials/payment requests were used. Linux, Python 3.11/3.12, and Safety scanning were not run locally.

Prepared with Codex assistance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add User-Agent header to OAuth requests

1 participant