Skip to content

Conversation

itaihanski
Copy link
Member

Related Issues

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

Description

Introduce HTTPClient to encapsulate the different mgmt keys needs, and use it to perform requests instead of having the HTTP methods implemented directly under the Auth class.

Must

  • Tests
  • Documentation (if applicable)

@itaihanski itaihanski self-assigned this Aug 17, 2025
@itaihanski itaihanski force-pushed the separate-clients branch 2 times, most recently from 6c2be90 to 38d913e Compare August 17, 2025 11:56
Copy link

github-actions bot commented Aug 17, 2025

Coverage report

The coverage rate went from 97.79% to 98.18% ⬆️

100% 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/management/authz.py

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

descope/management/fga.py

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

descope/jwt_common.py

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

descope/management/sso_application.py

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

descope/authmethod/saml.py

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

descope/management/sso_settings.py

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

descope/management/flow.py

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

descope/http_client.py

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

descope/authmethod/magiclink.py

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

descope/management/permission.py

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

descope/management/tenant.py

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

descope/descope_client.py

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

descope/authmethod/webauthn.py

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

descope/management/jwt.py

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

descope/authmethod/password.py

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

descope/management/audit.py

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

descope/authmethod/totp.py

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

descope/_auth_base.py

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

descope/authmethod/oauth.py

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

descope/authmethod/sso.py

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

descope/management/group.py

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

descope/management/outbound_application.py

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

descope/auth.py

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

descope/management/project.py

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

descope/management/role.py

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

descope/common.py

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

descope/mgmt.py

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

descope/authmethod/otp.py

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

descope/management/access_key.py

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

descope/_http_base.py

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

descope/management/user.py

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

@itaihanski itaihanski marked this pull request as draft August 17, 2025 13:26
@itaihanski itaihanski force-pushed the separate-clients branch 2 times, most recently from 80518c2 to 9681348 Compare August 17, 2025 15:43
@itaihanski itaihanski marked this pull request as ready for review August 17, 2025 15:58
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 07:33
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 introduces an HTTPClient to encapsulate the different management keys needs by separating HTTP functionality from authentication logic. The change refactors the management API to use a dedicated HTTP client instead of having HTTP methods implemented directly under the Auth class.

  • Introduces HTTPClient class to handle all HTTP operations with proper management key support
  • Refactors management classes to use HTTPBase instead of AuthBase
  • Updates all authentication methods to use the new HTTP client structure

Reviewed Changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
descope/http_client.py New HTTPClient class encapsulating HTTP operations and management key handling
descope/_http_base.py New base class for HTTP-only operations
descope/mgmt.py Refactored to use HTTPClient instead of Auth instance
descope/management/*.py Updated all management classes to inherit from HTTPBase
descope/descope_client.py Updated to use separate HTTP clients for auth and management
descope/auth.py Streamlined Auth class to focus on authentication logic
tests/*.py Updated test files to use new HTTP client pattern

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

@itaihanski
Copy link
Member Author

@guyp-descope would appreciate a review here

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.

1 participant