forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,27 @@ | ||
try: | ||
from fs.onedrivefs import OneDriveFS | ||
from google.oauth2.credentials import Credentials | ||
except ImportError: | ||
OneDriveFS = None | ||
|
||
from typing import Optional | ||
|
||
from . import FilesSourceOptions | ||
from ._pyfilesystem2 import PyFilesystem2FilesSource | ||
|
||
|
||
class OneDriveFilesSource(PyFilesystem2FilesSource): | ||
plugin_type = "onedrive" | ||
required_module = OneDriveFS | ||
required_package = "fs.onedrivefs" | ||
|
||
def _open_fs(self, user_context=None, opts: Optional[FilesSourceOptions] = None): | ||
props = self._serialization_props(user_context) | ||
access_token = props.pop("oauth2_access_token") | ||
if access_token: | ||
props["token"] = access_token | ||
handle = OneDriveFS(**props) | ||
return handle | ||
|
||
|
||
__all__ = ("OneDriveFilesSource",) |
15 changes: 15 additions & 0 deletions
15
lib/galaxy/files/templates/examples/production_onedrive.yml
This file contains 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,15 @@ | ||
- id: onedrive | ||
name: Microsoft OneDrive | ||
description: This file source type allows importing and exporting to your Microsoft OneDrive "personal cloud storage" account. | ||
configuration: | ||
type: onedrive | ||
oauth2_client_id: "{{ environment.oauth2_client_id }}" | ||
oauth2_client_secret: "{{ environment.oauth2_client_secret }}" | ||
writable: true | ||
environment: | ||
oauth2_client_id: | ||
type: variable | ||
variable: GALAXY_ONEDRIVE_APP_CLIENT_ID | ||
oauth2_client_secret: | ||
type: variable | ||
variable: GALAXY_ONEDRIVE_APP_CLIENT_SECRET |
This file contains 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