feat(boxsdk): shared network client and token storage#1299
feat(boxsdk): shared network client and token storage#1299congminh1254 wants to merge 15 commits intocombined-sdkfrom
Conversation
lukaszsocha2
left a comment
There was a problem hiding this comment.
Please move the method implementation to separate file. client.py is already huge. And split implementation into smaller methods. Avoid inner funtions
There was a problem hiding this comment.
Pull request overview
This PR adds configuration sharing functionality between the legacy boxsdk package and the new auto-generated box_sdk_gen package. The implementation allows developers to seamlessly migrate from the legacy SDK to the generated SDK by automatically extracting and converting authentication and network configuration.
Changes:
- Adds token storage adapter to bridge legacy OAuth2 token storage to generated SDK TokenStorage interface
- Implements three new methods in the Client class:
get_authentication(),get_network_session(), andget_sdk_gen_client() - Provides comprehensive unit and integration tests for the new functionality
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| boxsdk/util/token_storage_adapter.py | Implements LegacyTokenStorageAdapter to bridge legacy and generated SDK token storage |
| boxsdk/client/config_adapter.py | Contains helper functions for converting authentication and network configuration |
| boxsdk/client/client.py | Adds three new public methods for configuration sharing |
| test/boxsdk/unit/util/test_token_storage_adapter.py | Unit tests for token storage adapter |
| test/boxsdk/unit/client/test_config_sharing.py | Unit tests for configuration sharing methods |
| test/boxsdk/integration/test_config_sharing.py | Integration tests for end-to-end configuration sharing |
| docs/config-sharing-implementation.md | Documentation describing the implementation and usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from boxsdk.auth.jwt_auth import JWTAuth | ||
| from boxsdk.auth.ccg_auth import CCGAuth | ||
| from boxsdk.config import API, Proxy | ||
| from boxsdk.session.session import Session, AuthorizedSession |
There was a problem hiding this comment.
Import of 'Session' is not used.
Import of 'AuthorizedSession' is not used.
| from boxsdk.session.session import Session, AuthorizedSession |
| """ | ||
|
|
||
| from unittest.mock import Mock, MagicMock | ||
| import pytest |
There was a problem hiding this comment.
Import of 'pytest' is not used.
| import pytest |
No description provided.