PORTAL-4741: test & upgrade python sdk#95
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the Python SDK for the OneLogin API by replacing the outdated @validate_arguments decorator with the new @validate_call decorator in many API modules, and it adds a new app_script.py to interact with the API (for generating tokens, listing apps, retrieving and updating apps).
- Updated validation decorators across multiple API modules to maintain compatibility with the latest Pydantic practices.
- Added a new script (app_script.py) for managing apps via the API.
Reviewed Changes
Copilot reviewed 185 out of 185 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| onelogin/api/smart_hooks_api.py | Replaced @validate_arguments with @validate_call |
| onelogin/api/saml_assertions_api.py | Replaced validation decorator as above |
| onelogin/api/roles_api.py | Replaced validation decorator |
| onelogin/api/privileges_api.py | Replaced validation decorator |
| onelogin/api/o_auth2_api.py | Replaced validation decorator |
| onelogin/api/multi_factor_authentication_v1_api.py | Replaced validation decorator |
| onelogin/api/multi_factor_authentication_api.py | Replaced validation decorator |
| onelogin/api/invite_links_api.py | Replaced validation decorator |
| onelogin/api/groups_api.py | Replaced validation decorator |
| onelogin/api/events_api.py | Replaced validation decorator |
| onelogin/api/branding_service_templates_api.py | Replaced validation decorator |
| onelogin/api/branding_service_smtp_api.py | Replaced validation decorator |
| onelogin/api/branding_service_api.py | Replaced validation decorator |
| onelogin/api/apps_api.py | Replaced validation decorator |
| onelogin/api/api_authorization_server_api.py | Replaced validation decorator |
| onelogin/api/api_auth_scopes_api.py | Replaced validation decorator |
| onelogin/api/api_auth_client_apps_api.py | Replaced validation decorator |
| onelogin/api/api_auth_claims_api.py | Replaced validation decorator |
| app_script.py | Added new script for OneLogin API interaction |
Contributor
|
Example test: #96 |
fix: add example for create_auth_claim & delete_auth_claim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several updates to the OneLogin API client and a new script for interacting with the OneLogin API. The changes include adding a new script for managing apps via the API, and replacing
@validate_argumentswith@validate_callin multiple API methods to align with updated Pydantic validation practices.New Script for OneLogin API Interaction:
app_script.py: Added a new script to interact with the OneLogin API for managing apps. It includes functionality for generating access tokens, listing apps, retrieving app details, updating app visibility, and fetching app users.Validation Update in API Methods:
@validate_argumentswith@validate_callin the following files and methods to use the updated Pydantic validation decorator:onelogin/api/api_auth_claims_api.py: Updated methods likecreate_auth_claim,delete_auth_claim,get_authclaims, andupdate_claim. [1] [2] [3] [4] [5] [6] [7] [8] [9]onelogin/api/api_auth_client_apps_api.py: Updated methods likeadd_client_app,delete_client_app,list_client_apps, andupdate_client_app. [1] [2] [3] [4] [5] [6] [7] [8] [9]onelogin/api/api_auth_scopes_api.py: Updated methods likecreate_scope,delete_scope,get_scopes, andupdate_scope. [1] [2] [3] [4] [5] [6] [7] [8]These updates enhance the usability of the OneLogin API client and ensure compatibility with the latest validation standards.