-
Notifications
You must be signed in to change notification settings - Fork 217
feat(boxsdk): shared network client and token storage #1299
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: combined-sdk
Are you sure you want to change the base?
Conversation
lukaszsocha2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 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 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'pytest' is not used.
| import pytest |
No description provided.