- Notifications
You must be signed in to change notification settings - Fork329
High-level diagram visualization of the dropbox-sdk-python codebase#515
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
ivanmilevtues wants to merge1 commit intodropbox:mainChoose a base branch fromCodeBoarding:main
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
293 changes: 293 additions & 0 deletions.codeboarding/ApiClientCore.md
Large diffs are not rendered by default.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
109 changes: 109 additions & 0 deletions.codeboarding/AuthenticationService.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| ```mermaid | ||
| graph LR | ||
| AuthenticationService["AuthenticationService"] | ||
| OAuth2FlowBase["OAuth2FlowBase"] | ||
| OAuth2FlowNoRedirect["OAuth2FlowNoRedirect"] | ||
| OAuth2FlowRedirect["OAuth2FlowRedirect"] | ||
| OAuth2FlowResults["OAuth2FlowResults"] | ||
| OAuth2FlowExceptions["OAuth2FlowExceptions"] | ||
| AuthErrors["AuthErrors"] | ||
| AuthenticationService -- "orchestrates" --> OAuth2FlowNoRedirect | ||
| AuthenticationService -- "orchestrates" --> OAuth2FlowRedirect | ||
| AuthenticationService -- "handles" --> AuthErrors | ||
| AuthenticationService -- "handles" --> OAuth2FlowExceptions | ||
| OAuth2FlowNoRedirect -- "inherits from" --> OAuth2FlowBase | ||
| OAuth2FlowRedirect -- "inherits from" --> OAuth2FlowBase | ||
| OAuth2FlowNoRedirect -- "produces" --> OAuth2FlowResults | ||
| OAuth2FlowRedirect -- "produces" --> OAuth2FlowResults | ||
| OAuth2FlowBase -- "raises" --> OAuth2FlowExceptions | ||
| OAuth2FlowRedirect -- "validates with" --> OAuth2FlowExceptions | ||
| AuthErrors -- "groups" --> AccessError | ||
| AuthErrors -- "groups" --> AuthError | ||
| ``` | ||
| [](https://github.com/CodeBoarding/GeneratedOnBoardings)[](https://www.codeboarding.org/demo)[](mailto:contact@codeboarding.org) | ||
| ## Component Details | ||
| The AuthenticationService subsystem in Dropbox manages secure user authentication and authorization using OAuth2, including PKCE. It provides distinct flows for redirect-based (web) and no-redirect (command-line) applications, ensuring proper handling of authorization codes, access tokens, and refresh tokens. The subsystem also defines a comprehensive set of exceptions to manage various authentication and access-related errors, providing clear error handling for different failure scenarios. | ||
| ### AuthenticationService | ||
| Manages user authentication and authorization flows, including OAuth2 and PKCE, and defines various authentication-related errors. It ensures secure access to Dropbox resources. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L119-L263" target="_blank" rel="noopener noreferrer">`dropbox.oauth.DropboxOAuth2FlowBase` (119:263)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L266-L350" target="_blank" rel="noopener noreferrer">`dropbox.oauth.DropboxOAuth2FlowNoRedirect` (266:350)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L353-L536" target="_blank" rel="noopener noreferrer">`dropbox.oauth.DropboxOAuth2Flow` (353:536)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/auth.py#L10-L100" target="_blank" rel="noopener noreferrer">`dropbox.auth.AccessError` (10:100)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/auth.py#L104-L229" target="_blank" rel="noopener noreferrer">`dropbox.auth.AuthError` (104:229)</a> | ||
| ### OAuth2FlowBase | ||
| This component provides the foundational logic for all OAuth2 authorization flows, handling common tasks like URL construction, parameter encoding, and PKCE (Proof Key for Code Exchange) operations. It serves as the base class for specific flow implementations. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L119-L263" target="_blank" rel="noopener noreferrer">`dropbox.oauth.DropboxOAuth2FlowBase` (119:263)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L604-L622" target="_blank" rel="noopener noreferrer">`dropbox.oauth._params_to_urlencoded` (604:622)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L624-L629" target="_blank" rel="noopener noreferrer">`dropbox.oauth._generate_pkce_code_verifier` (624:629)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L631-L635" target="_blank" rel="noopener noreferrer">`dropbox.oauth._generate_pkce_code_challenge` (631:635)</a> | ||
| ### OAuth2FlowNoRedirect | ||
| This component specializes in OAuth2 authorization for applications that do not use a redirect URI, such as command-line tools. It extends the base OAuth2 flow functionality to support this specific use case. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L266-L350" target="_blank" rel="noopener noreferrer">`dropbox.oauth.DropboxOAuth2FlowNoRedirect` (266:350)</a> | ||
| ### OAuth2FlowRedirect | ||
| This component handles OAuth2 authorization for web applications that rely on a redirect URI. It includes mechanisms for CSRF protection and manages the state throughout the authorization process. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L353-L536" target="_blank" rel="noopener noreferrer">`dropbox.oauth.DropboxOAuth2Flow` (353:536)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L595-L601" target="_blank" rel="noopener noreferrer">`dropbox.oauth._safe_equals` (595:601)</a> | ||
| ### OAuth2FlowResults | ||
| This component defines the data structures used to encapsulate the results of successful OAuth2 authorization flows. OAuth2FlowNoRedirectResult is a general result type, and OAuth2FlowResult is a specific result that inherits from it, providing access tokens, account information, and other relevant details. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L80-L116" target="_blank" rel="noopener noreferrer">`dropbox.oauth.OAuth2FlowResult` (80:116)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L40-L77" target="_blank" rel="noopener noreferrer">`dropbox.oauth.OAuth2FlowNoRedirectResult` (40:77)</a> | ||
| ### OAuth2FlowExceptions | ||
| This component groups all exceptions specific to the OAuth2 authorization process, providing distinct error types for various failure scenarios like bad input, invalid requests, state mismatches, or user denial. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L585-L592" target="_blank" rel="noopener noreferrer">`dropbox.oauth.BadInputException` (585:592)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L539-L545" target="_blank" rel="noopener noreferrer">`dropbox.oauth.BadRequestException` (539:545)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L548-L555" target="_blank" rel="noopener noreferrer">`dropbox.oauth.BadStateException` (548:555)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L558-L565" target="_blank" rel="noopener noreferrer">`dropbox.oauth.CsrfException` (558:565)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L568-L572" target="_blank" rel="noopener noreferrer">`dropbox.oauth.NotApprovedException` (568:572)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/oauth.py#L575-L582" target="_blank" rel="noopener noreferrer">`dropbox.oauth.ProviderException` (575:582)</a> | ||
| ### AuthErrors | ||
| This component defines exceptions related to general authentication and access control, distinct from the OAuth2 flow-specific errors. | ||
| **Related Classes/Methods**: | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/auth.py#L10-L100" target="_blank" rel="noopener noreferrer">`dropbox.auth.AccessError` (10:100)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/auth.py#L104-L229" target="_blank" rel="noopener noreferrer">`dropbox.auth.AuthError` (104:229)</a> | ||
| ### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) |
142 changes: 142 additions & 0 deletions.codeboarding/CoreDataModels.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| ```mermaid | ||
| graph LR | ||
| Core_Data_Models["Core Data Models"] | ||
| User_Account_Models["User Account Models"] | ||
| Team_and_Group_Models["Team and Group Models"] | ||
| User_Feature_Models["User Feature Models"] | ||
| Space_Allocation_Models["Space Allocation Models"] | ||
| User_Account_Models -- "uses" --> Core_Data_Models | ||
| Team_and_Group_Models -- "uses" --> Core_Data_Models | ||
| User_Feature_Models -- "uses" --> Core_Data_Models | ||
| Space_Allocation_Models -- "uses" --> Core_Data_Models | ||
| ``` | ||
| [](https://github.com/CodeBoarding/GeneratedOnBoardings)[](https://www.codeboarding.org/demo)[](mailto:contact@codeboarding.org) | ||
| ## Component Details | ||
| This graph illustrates the core data models and their relationships within the Dropbox SDK. The central component, 'Core Data Models', provides foundational data structures and utility classes that are widely reused. Other components, such as 'User Account Models', 'Team and Group Models', 'User Feature Models', and 'Space Allocation Models', depend on and utilize these core data models to define their specific domain-related structures, ensuring consistency and reusability across the SDK. | ||
| ### Core Data Models | ||
| Contains shared data models and utility classes used across different parts of the Dropbox SDK, promoting consistency and reusability. This includes foundational data structures for path roots, root information (user and team specific), and common data type validators, as well as shared models specific to teams and users. | ||
| **Related Classes/Methods**: | ||
| - `dropbox.common` (full file reference) | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L10-L116" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot` (10:116)</a> | ||
| - `dropbox.common.PathRoot:home` (full file reference) | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L34-L42" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot:root` (34:42)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L45-L53" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot:namespace_id` (45:53)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L87-L99" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot:get_root` (87:99)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L101-L113" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot:get_namespace_id` (101:113)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L55-L61" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot.is_home` (55:61)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L63-L69" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot.is_root` (63:69)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L71-L77" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRoot.is_namespace_id` (71:77)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L120-L188" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRootError` (120:188)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L140-L148" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRootError:invalid_root` (140:148)</a> | ||
| - `dropbox.common.PathRootError:no_permission` (full file reference) | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L174-L185" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRootError:get_invalid_root` (174:185)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L150-L156" target="_blank" rel="noopener noreferrer">`dropbox.common.PathRootError.is_invalid_root` (150:156)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L192-L228" target="_blank" rel="noopener noreferrer">`dropbox.common.RootInfo` (192:228)</a> | ||
| - `dropbox.common.RootInfo:root_namespace_id` (full file reference) | ||
| - `dropbox.common.RootInfo:home_namespace_id` (full file reference) | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L232-L260" target="_blank" rel="noopener noreferrer">`dropbox.common.TeamRootInfo` (232:260)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L246-L254" target="_blank" rel="noopener noreferrer">`dropbox.common.TeamRootInfo:__init__` (246:254)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L259-L260" target="_blank" rel="noopener noreferrer">`dropbox.common.TeamRootInfo:_process_custom_annotations` (259:260)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L264-L282" target="_blank" rel="noopener noreferrer">`dropbox.common.UserRootInfo` (264:282)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L275-L279" target="_blank" rel="noopener noreferrer">`dropbox.common.UserRootInfo:__init__` (275:279)</a> | ||
| - <a href="https://github.com/dropbox/dropbox-sdk-python/blob/master/dropbox/common.py#L281-L282" target="_blank" rel="noopener noreferrer">`dropbox.common.UserRootInfo:_process_custom_annotations` (281:282)</a> | ||
| - `dropbox.team_common` (full file reference) | ||
| - `dropbox.users_common` (full file reference) | ||
| ### User Account Models | ||
| This component defines the data structures for various types of user accounts, including basic and full account details, and related information like names and account retrieval arguments/errors. | ||
| **Related Classes/Methods**: | ||
| - `dropbox.users.Account` (full file reference) | ||
| - `dropbox.users.Account:__init__` (full file reference) | ||
| - `dropbox.users.Account:_process_custom_annotations` (full file reference) | ||
| - `dropbox.users.BasicAccount` (full file reference) | ||
| - `dropbox.users.BasicAccount:__init__` (full file reference) | ||
| - `dropbox.users.BasicAccount:_process_custom_annotations` (full file reference) | ||
| - `dropbox.users.FullAccount` (full file reference) | ||
| - `dropbox.users.FullAccount:__init__` (full file reference) | ||
| - `dropbox.users.FullAccount:_process_custom_annotations` (full file reference) | ||
| - `dropbox.users.Name` (full file reference) | ||
| - `dropbox.users.GetAccountArg` (full file reference) | ||
| - `dropbox.users.GetAccountBatchArg` (full file reference) | ||
| - `dropbox.users.GetAccountBatchError` (full file reference) | ||
| - `dropbox.users.GetAccountBatchError:no_account` (full file reference) | ||
| - `dropbox.users.GetAccountBatchError:get_no_account` (full file reference) | ||
| - `dropbox.users.GetAccountBatchError.is_no_account` (full file reference) | ||
| - `dropbox.users.GetAccountError` (full file reference) | ||
| ### Team and Group Models | ||
| This component defines data structures for team and group information, including basic team details and full group information. It interacts with an external common group summary for shared processing. | ||
| **Related Classes/Methods**: | ||
| - `dropbox.users.Team` (full file reference) | ||
| - `dropbox.users.Team:__init__` (full file reference) | ||
| - `dropbox.users.Team:_process_custom_annotations` (full file reference) | ||
| - `dropbox.users.FullTeam` (full file reference) | ||
| - `dropbox.users.FullTeam:__init__` (full file reference) | ||
| - `dropbox.users.FullTeam:_process_custom_annotations` (full file reference) | ||
| - `dropbox.sharing.GroupInfo` (full file reference) | ||
| - `dropbox.sharing.GroupInfo:__init__` (full file reference) | ||
| - `dropbox.sharing.GroupInfo:_process_custom_annotations` (full file reference) | ||
| - `dropbox.team.GroupFullInfo` (full file reference) | ||
| - `dropbox.team.GroupFullInfo:__init__` (full file reference) | ||
| - `dropbox.team.GroupFullInfo:_process_custom_annotations` (full file reference) | ||
| ### User Feature Models | ||
| This component encapsulates various user-specific features, such as file locking and Paper document handling, defining their possible values and states. | ||
| **Related Classes/Methods**: | ||
| - `dropbox.users.FileLockingValue` (full file reference) | ||
| - `dropbox.users.FileLockingValue:enabled` (full file reference) | ||
| - `dropbox.users.FileLockingValue:get_enabled` (full file reference) | ||
| - `dropbox.users.FileLockingValue.is_enabled` (full file reference) | ||
| - `dropbox.users.PaperAsFilesValue` (full file reference) | ||
| - `dropbox.users.PaperAsFilesValue:enabled` (full file reference) | ||
| - `dropbox.users.PaperAsFilesValue:get_enabled` (full file reference) | ||
| - `dropbox.users.PaperAsFilesValue.is_enabled` (full file reference) | ||
| - `dropbox.users.UserFeature` (full file reference) | ||
| - `dropbox.users.UserFeatureValue` (full file reference) | ||
| - `dropbox.users.UserFeatureValue:paper_as_files` (full file reference) | ||
| - `dropbox.users.UserFeatureValue:file_locking` (full file reference) | ||
| - `dropbox.users.UserFeatureValue:get_paper_as_files` (full file reference) | ||
| - `dropbox.users.UserFeatureValue:get_file_locking` (full file reference) | ||
| - `dropbox.users.UserFeatureValue.is_paper_as_files` (full file reference) | ||
| - `dropbox.users.UserFeatureValue.is_file_locking` (full file reference) | ||
| ### Space Allocation Models | ||
| This component describes how storage space is allocated and used, differentiating between individual and team-based allocations. | ||
| **Related Classes/Methods**: | ||
| - `dropbox.users.SpaceAllocation` (full file reference) | ||
| - `dropbox.users.SpaceAllocation:individual` (full file reference) | ||
| - `dropbox.users.SpaceAllocation:team` (full file reference) | ||
| - `dropbox.users.SpaceAllocation:get_individual` (full file reference) | ||
| - `dropbox.users.SpaceAllocation:get_team` (full file reference) | ||
| - `dropbox.users.SpaceAllocation.is_individual` (full file reference) | ||
| - `dropbox.users.SpaceAllocation.is_team` (full file reference) | ||
| - `dropbox.users.IndividualSpaceAllocation` (full file reference) | ||
| - `dropbox.users.TeamSpaceAllocation` (full file reference) | ||
| - `dropbox.users.SpaceUsage` (full file reference) | ||
| ### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.