Skip to content

Conversation

@congminh1254
Copy link
Member

No description provided.

@congminh1254 congminh1254 requested a review from a team January 19, 2026 20:48
@lukaszsocha2 lukaszsocha2 changed the title feat: shared network client and token storage feat(boxsdk): shared network client and token storage Jan 20, 2026
Copy link
Contributor

@lukaszsocha2 lukaszsocha2 left a 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

Copy link

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 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(), and get_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
Copy link

Copilot AI Jan 28, 2026

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.

Suggested change
from boxsdk.session.session import Session, AuthorizedSession

Copilot uses AI. Check for mistakes.
"""

from unittest.mock import Mock, MagicMock
import pytest
Copy link

Copilot AI Jan 28, 2026

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.

Suggested change
import pytest

Copilot uses AI. Check for mistakes.
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.

4 participants