Skip to content

Conversation

LioriE
Copy link
Contributor

@LioriE LioriE commented Oct 5, 2025

Related Issues

https://github.com/descope/etc/issues/5922

Description

This change is made as preparation for async support in the SDK
Replaced the 'requests' library with 'httpx' for all HTTP operations in the codebase, updated SSL context handling, and adjusted method signatures and usage accordingly.
Updated dependencies in pyproject.toml and poetry.lock to include httpx and certifi. Also added missing all to descope/init.py and created tests/testutils.py.

Must

  • Tests
  • Documentation (if applicable)

LioriE added 2 commits October 5, 2025 10:39
Replaced the 'requests' library with 'httpx' for all HTTP operations in the codebase, updated SSL context handling, and adjusted method signatures and usage accordingly. Updated dependencies in pyproject.toml and poetry.lock to include httpx and certifi. Also added missing __all__ to descope/__init__.py and created tests/testutils.py.
@Copilot Copilot AI review requested due to automatic review settings October 5, 2025 08:37
@LioriE LioriE changed the base branch from main to feat/async-support October 5, 2025 08:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the Descope Python SDK from using requests library to httpx for making HTTP requests. This migration modernizes the HTTP client while maintaining the same functionality.

  • Replaces all requests.get, requests.post, requests.patch, and requests.delete calls with their httpx equivalents
  • Updates parameter names from allow_redirects to follow_redirects and ok to is_success
  • Introduces SSLMatcher utility for SSL context verification in tests

Reviewed Changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/testutils.py Adds SSLMatcher helper class for SSL context verification in tests
Multiple test files Updates HTTP library imports and method calls throughout test suite
samples/magiclink_web_sample_app.py Updates Flask imports to use modern patterns
pyproject.toml Replaces requests dependency with httpx in project configuration
descope/descope_client.py Updates type annotations and parameter names for httpx compatibility
descope/authmethod/ files Updates imports and type annotations for httpx compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

github-actions bot commented Oct 5, 2025

Coverage report

The coverage rate went from 97.81% to 97.78% ⬇️

96% of new lines are covered.

Diff Coverage details (click to unfold)

descope/authmethod/enchantedlink.py

100% of new lines are covered (97.82% of the complete file).

descope/authmethod/webauthn.py

100% of new lines are covered (100% of the complete file).

descope/auth.py

94.44% of new lines are covered (95.56% of the complete file).
Missing lines: 125

descope/init.py

100% of new lines are covered (100% of the complete file).

descope/descope_client.py

100% of new lines are covered (97.75% of the complete file).

LioriE and others added 2 commits October 5, 2025 11:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@LioriE LioriE requested review from aviadl, dorsha, guyp-descope and omercnet and removed request for aviadl October 5, 2025 08:57
omercnet
omercnet previously approved these changes Oct 5, 2025
@omercnet omercnet requested review from Copilot and omercnet October 5, 2025 12:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

2 participants