Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
df6ce2d
Add OAuth 2 client library for Python
ShimonaR-MC Sep 12, 2026
96ad4ef
Drain urllib3 responses before connection reuse
ShimonaR-MC Sep 12, 2026
bc0defa
add Requests integration and fix aiohttp token request settings
ShimonaR-MC Sep 22, 2026
cf9e448
Add Mastercard sandbox tests
ShimonaR-MC Sep 22, 2026
1fdc6e7
Add a temporary push trigger for live tests
ShimonaR-MC Sep 22, 2026
8a31c10
Simplify test organization and client generation
ShimonaR-MC Sep 23, 2026
288307c
Remove temporary live test trigger
ShimonaR-MC Sep 23, 2026
f9c4f5a
Split compatibility workflows and add status badges
ShimonaR-MC Sep 23, 2026
0a70364
Review comments: Add key generators and separate default implementations
ShimonaR-MC Sep 28, 2026
bbac442
Review comments: Document public APIs
ShimonaR-MC Sep 29, 2026
1d18291
Review comments: Use ASCII encoding for DPoP access token hash (ath)
ShimonaR-MC Sep 29, 2026
c753231
Review comments: Document intentional JOSE dependency decision
ShimonaR-MC Sep 29, 2026
0a5d681
Review comments: Document token request middleware behavior
ShimonaR-MC Sep 29, 2026
aa6056a
Review comments: Preserve repeated response headers in HTTP adapters
ShimonaR-MC Sep 29, 2026
e5d1677
Review comments: Add test to verify generated HTTPX timeout propagation
ShimonaR-MC Sep 29, 2026
cbbfb61
Review comments: Modernize license metadata
ShimonaR-MC Oct 7, 2026
f5e3510
Review comments: Update license copyright
ShimonaR-MC Oct 7, 2026
09d81d0
Review comments: Redact sensitive URL components
ShimonaR-MC Oct 7, 2026
f28f1eb
Review comments: Reject non-ASCII access tokens
ShimonaR-MC Oct 7, 2026
f22b11b
Review comments: Validate scope input
ShimonaR-MC Oct 7, 2026
89b4345
Review comments: Centralize scope validation
ShimonaR-MC Oct 7, 2026
679d1c2
Fix flaky EC thumbprint test
ShimonaR-MC Oct 7, 2026
dfa77df
Review comments: Detect unclosed resources
ShimonaR-MC Oct 7, 2026
d7fb8c8
Review comments: Fix README links for PyPI
ShimonaR-MC Oct 7, 2026
6defece
Review comments: Add PyPI package metadata
ShimonaR-MC Oct 7, 2026
5204672
Review comments: Add Python 3.11 support
ShimonaR-MC Oct 7, 2026
0ba2146
Review comments: Move development dependencies to PEP 735 groups
ShimonaR-MC Oct 7, 2026
88a80ae
Review comments: Secure OAuth handling across redirects
ShimonaR-MC Oct 9, 2026
7975974
Fix redirects for older urllib3 versions
ShimonaR-MC Oct 9, 2026
bce267c
Review comments: Isolate generated asyncio client configuration
ShimonaR-MC Oct 11, 2026
e326c3e
Prevent nonce mix-ups in concurrent retries
ShimonaR-MC Oct 11, 2026
bfb894f
Make concurrent nonce tests deterministic
ShimonaR-MC Oct 11, 2026
937274b
Review comments: Use configured User-Agent for resource requests
ShimonaR-MC Oct 11, 2026
1491201
Review comments: Protect live-test secrets with sandbox environment
ShimonaR-MC Oct 12, 2026
cecee4c
Defect G1548-13582 fix: Raise an error when the token endpoint fails
ShimonaR-MC Oct 12, 2026
470c6e1
Review comments: requests: fix redirect nonce retry
ShimonaR-MC Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copy to .env and fill in the required values. Never commit .env or key files.
CLIENT_ID=
KID=
TOKEN_ENDPOINT=https://sandbox.api.mastercard.com/oauth/token
ISSUER=https://sandbox.api.mastercard.com
API_BASE_URL=https://sandbox.api.mastercard.com/oauth2-petstore/petstore
SCOPES=

# GitHub Actions uses PRIVATE_KEY with PEM content. For local runs, prefer
# PRIVATE_KEY_PATH pointing to an existing key file. Do not copy private keys
# into this Git checkout.
PRIVATE_KEY=
PRIVATE_KEY_PATH=
PRIVATE_KEY_PASSWORD=

# Optional network settings.
SSL_CA_CERT=
GATEWAY_HTTPS_PROXY=
47 changes: 47 additions & 0 deletions .github/workflows/ci-aiohttp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: aiohttp

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: aiohttp ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: minimum
aiohttp: 'aiohttp==3.13.0'
- label: latest
aiohttp: aiohttp
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev "${{ matrix.aiohttp }}"
python -m pip check

- name: Run direct aiohttp unit tests
run: python -m pytest -v tests/unit/direct/aiohttp

- name: Run direct aiohttp integration tests
run: python -m pytest -v tests/integration/direct/aiohttp
47 changes: 47 additions & 0 deletions .github/workflows/ci-httpx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: HTTPX

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: HTTPX ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: minimum
httpx: 'httpx==0.28.0'
- label: latest
httpx: httpx
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev "${{ matrix.httpx }}"
python -m pip check

- name: Run direct HTTPX unit tests
run: python -m pytest -v tests/unit/direct/httpx

- name: Run direct HTTPX integration tests
run: python -m pytest -v tests/integration/direct/httpx
50 changes: 50 additions & 0 deletions .github/workflows/ci-openapi-asyncio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: OpenAPI asyncio

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: OpenAPI asyncio ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: minimum
aiohttp: 'aiohttp==3.13.0'
- label: latest
aiohttp: aiohttp
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev --group generator "${{ matrix.aiohttp }}"
python -m pip check

- name: Generate OpenAPI asyncio test client
run: python scripts/generate_test_clients.py --client asyncio

- name: Run OpenAPI asyncio unit tests
run: python -m pytest -v tests/unit/openapi/asyncio

- name: Run OpenAPI asyncio integration tests
run: python -m pytest -v tests/integration/openapi/asyncio
50 changes: 50 additions & 0 deletions .github/workflows/ci-openapi-httpx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: OpenAPI HTTPX

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: OpenAPI HTTPX ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: minimum
httpx: 'httpx==0.28.0'
- label: latest
httpx: httpx
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev --group generator "${{ matrix.httpx }}"
python -m pip check

- name: Generate OpenAPI HTTPX test client
run: python scripts/generate_test_clients.py --client httpx

- name: Run OpenAPI HTTPX unit tests
run: python -m pytest -v tests/unit/openapi/httpx

- name: Run OpenAPI HTTPX integration tests
run: python -m pytest -v tests/integration/openapi/httpx
48 changes: 48 additions & 0 deletions .github/workflows/ci-openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: OpenAPI Generator

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
generated-clients:
name: OpenAPI Generator ${{ matrix['generator-version'] }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
generator-version:
- '7.23.0'
- '7.24.0'
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev "openapi-generator-cli[jdk4py]==${{ matrix['generator-version'] }}"
python -m pip check

- name: Generate all OpenAPI test clients
run: python scripts/generate_test_clients.py

- name: Run OpenAPI unit tests
run: python -m pytest -v tests/unit/openapi

- name: Run OpenAPI integration tests
run: python -m pytest -v tests/integration/openapi
51 changes: 51 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Python

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: Python ${{ matrix['python-version'] }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.11'
cryptography: 'cryptography==45.0.1'
- python-version: '3.12'
cryptography: 'cryptography==45.0.1'
- python-version: '3.13'
cryptography: cryptography
- python-version: '3.14'
cryptography: cryptography
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python ${{ matrix['python-version'] }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix['python-version'] }}
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev "${{ matrix.cryptography }}"
python -m pip check

- name: Run unit tests
run: python -m pytest -v tests/unit/test_*.py tests/unit/direct

- name: Run direct integration tests
run: python -m pytest -v tests/integration/direct
47 changes: 47 additions & 0 deletions .github/workflows/ci-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Requests

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: Requests ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- label: minimum
requests: 'requests==2.33.0'
- label: latest
requests: requests
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . --group dev "${{ matrix.requests }}"
python -m pip check

- name: Run Requests unit tests
run: python -m pytest -v tests/unit/direct/requests

- name: Run Requests integration tests
run: python -m pytest -v tests/integration/direct/requests
Loading
Loading