You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 32362e2
Browse filesBrowse the repository at this point in the historyBrowse files
This document describes the implementation of configuration sharing between the legacy `boxsdk` package and the new auto-generated `box_sdk_gen` package.
4
4
5
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
6
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
28
+
29
+
5
30
## Overview
6
31
7
32
The configuration sharing feature allows developers to seamlessly migrate from the legacy SDK to the generated SDK by automatically extracting and converting authentication and network configuration from a legacy client to a generated client.
The `LegacyTokenStorageAdapter` class bridges the gap between legacy OAuth2 token storage mechanisms (callbacks) and the generated SDK's `TokenStorage` interface.
14
39
@@ -17,10 +42,81 @@ The `LegacyTokenStorageAdapter` class bridges the gap between legacy OAuth2 toke
17
42
- Supports both read and write operations
18
43
- Handles token storage callbacks from legacy OAuth2 implementations
19
44
20
-
### 2. Client Methods
45
+
**Example:**
46
+
```python
47
+
from boxsdk.auth.oauth2 import OAuth2
48
+
from boxsdk.util.token_storage_adapter import LegacyTokenStorageAdapter
49
+
50
+
from box_sdk_gen.box.oauth import BoxOAuth, OAuthConfig
Creates a fully configured generated SDK client from the legacy client. This is the main convenience method that combines `get_sdk_gen_authentication()` and `get_sdk_gen_network_session()`.
87
+
88
+
**Parameters:**
89
+
-`auth_options` (optional): Dictionary with authentication options
90
+
-`token_storage`: Custom `TokenStorage` instance
91
+
-`network_options` (optional): Dictionary with network options
Creates a fully configured generated SDK client from the legacy client. This is the main convenience method that combines `get_sdk_gen_authentication()` and `get_sdk_gen_network_session()`.
82
-
83
-
**Parameters:**
84
-
-`auth_options` (optional): Dictionary with authentication options
85
-
-`token_storage`: Custom `TokenStorage` instance
86
-
-`network_options` (optional): Dictionary with network options
0 commit comments