--- id: mastercard-oauth1-signer version: "1.9.2" license: MIT license_treatment: permissive maintenance: active --- # mastercard-oauth1-signer — Mastercard OAuth1 Signer. License: permissive · Maintenance: active · Downloads: 230.5K/mo ## What it is and what it does This library implements OAuth 1.0a signature generation specifically for Mastercard API authentication. It handles the cryptographic signing of HTTP requests using either RSA-SHA256 (default) or RSA-PSS-SHA256 algorithms, producing properly formatted Authorization headers that comply with Mastercard's API requirements. The package provides multiple integration patterns: direct header generation via `OAuth.get_authorization_header()`, signing of request objects through the `OAuthSigner` class, and seamless integration with the requests library via the `OAuth1RSA` authentication handler. It manages key loading, payload hashing (including body hash for non-form-encoded content), and OAuth parameter construction, abstracting away the complexity of manual signature computation. Use it for: - Authenticate requests to Mastercard sandbox or production APIs when building payment or financial applications. - Sign HTTP requests in backend services that need to call Mastercard endpoints with OAuth 1.0a credentials. - Integrate OAuth signing into OpenAPI-generated client libraries targeting Mastercard services. - Implement custom request signing logic for Mastercard API calls within larger Python applications. - Switch between RSA-SHA256 and RSA-PSS-SHA256 signature methods based on Mastercard API endpoint requirements. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates OAuth 1.0a-compliant signatures for Mastercard API requests using RSA-SHA256 or RSA-PSS-SHA256 cryptographic methods. Yes. Install this if you are building a Python application that needs to authenticate with Mastercard APIs. The library is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively. The only caveat is that Python 3.8/3.9 support will be dropped in v2.0.0, so plan upgrades accordingly if you depend on those versions. ## Install pip install mastercard-oauth1-signer uv add mastercard-oauth1-signer poetry add mastercard-oauth1-signer ## Installing mastercard-oauth1-signer Before you install: Low friction: pure Python wheel with four stable runtime dependencies (cryptography, urllib3, requests, Deprecated). Active maintenance with recent commits; current version targets Python 3.8–3.12 with deprecation warnings on 3.8/3.9 ahead of v2.0.0. License in practice: MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements. Quickstart: pip install mastercard-oauth1-signer import oauth1.authenticationutils as authenticationutils from oauth1.oauth import OAuth, SignatureMethod signing_key = authenticationutils.load_signing_key('path/to/key', '') authHeader = OAuth.get_authorization_header( 'https://sandbox.api.mastercard.com/service', 'POST', 'Hello world!', consumer_key, signing_key ) Requires a valid Mastercard Developer Portal account with consumer key and private signing key credentials. Verify before relying: - Whether the library supports custom HTTP clients beyond requests and the OAuthSigner class. - Performance characteristics when signing high-volume requests or with large payloads. - Specific error handling and exception types raised by the library. ## Package facts - License: MIT (permissive) - Python support: capped_below_current - Install friction: low - Maintenance: active - Downloads: 230.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags oauth 1.0a signature generation, mastercard api authentication, rsa signing for http requests, oauth authorization header, api request signing library, mastercard developer oauth, http request authentication, oauth-1.0a, mastercard-api, request-signing [View on SkillFed](https://skillfed.io/packages/mastercard-oauth1-signer) · [View on PyPI](https://pypi.org/project/mastercard-oauth1-signer/)