-
Notifications
You must be signed in to change notification settings - Fork 9
feat: replace requests with httpx #456
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
base: main
Are you sure you want to change the base?
Conversation
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/authmethod/enchantedlink.py
descope/authmethod/webauthn.py
descope/descope_client.py
descope/init.py
descope/auth.py
|
Wiz Scan SummaryDisplaying only findings that violated a policy
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Wiz Scan SummaryDisplaying only findings that violated a policy
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Pull Request Summary: Migrate from requests to httpx
Overview
This PR modernizes the Descope Python SDK by migrating from the
requests
library tohttpx
, providing better async support, HTTP/2 capabilities, and improved performance for HTTP operations.Key Changes
🔧 Core Infrastructure
requests
withhttpx ^0.27.2
inpyproject.toml
andrequirements.txt
Auth
class (descope/auth.py
) to usehttpx
methods:httpx.get()
,httpx.post()
,httpx.patch()
,httpx.delete()
allow_redirects
→follow_redirects
_fetch_public_keys()
method to usehttpx.get()
📦 Auth Methods Updated
descope/authmethod/webauthn.py
): Updated import to usehttpx.Response
🧪 Comprehensive Test Updates
Updated all test files to mock
httpx
instead ofrequests
:test_auth.py
,test_descope_client.py
test_otp.py
,test_password.py
,test_saml.py
,test_sso.py
,test_totp.py
,test_webauthn.py
,test_enchantedlink.py
,test_magiclink.py
,test_oauth.py
allow_redirects=False
tofollow_redirects=False
in test assertions🔄 Build & CI
poetry.lock
with new dependency resolution.pre-commit-config.yaml
Benefits
Testing
Breaking Changes
None - this is an internal dependency migration that maintains full backward compatibility.
Files Changed
pyproject.toml
- Updated dependency from requests to httpxrequirements.txt
- Updated with new dependency resolutionpoetry.lock
- Updated lock filedescope/auth.py
- Core HTTP client migrationdescope/authmethod/webauthn.py
- Import updates.pre-commit-config.yaml
- Fixed poetry export