Skip to content

feat(services/onedrive): Add read and write support for OneDrive#2129

Merged
Xuanwo merged 40 commits intoapache:mainfrom
MikeChongCan:cat-onedrive-initial
Apr 28, 2023
Merged

feat(services/onedrive): Add read and write support for OneDrive#2129
Xuanwo merged 40 commits intoapache:mainfrom
MikeChongCan:cat-onedrive-initial

Conversation

@MikeChongCan
Copy link
Copy Markdown
Contributor

@MikeChongCan MikeChongCan commented Apr 26, 2023

To get a working access_token for OneDrive, we can leverage https://crates.io/crates/graph-rs-sdk, especially its demo: https://github.com/sreeise/graph-rs-sdk/tree/master/examples/oauth

This is the initial PR of R/W support of OneDrive. For uploading (Write), this PR only aims to support files under 4MB via the Simple Upload API.

Tentative plan after this PR:

Comment thread core/Cargo.toml
@MikeChongCan MikeChongCan changed the title Add read and write support for OneDrive feat(services/onedrive): Add read and write support for OneDrive Apr 26, 2023
Comment thread core/src/services/onedrive/backend.rs
Comment thread core/src/services/onedrive/backend.rs Outdated
Comment thread core/src/services/onedrive/builder.rs Outdated
Comment thread core/src/services/onedrive/error.rs
Comment thread core/src/services/onedrive/writer.rs Outdated
Comment thread core/src/services/onedrive/builder.rs
# Conflicts:
#	core/src/services/mod.rs
#	core/src/services/onedrive/backend.rs
#	core/src/services/onedrive/builder.rs
#	core/src/services/onedrive/mod.rs
#	core/src/services/onedrive/writer.rs
@MikeChongCan MikeChongCan marked this pull request as ready for review April 28, 2023 02:01
Comment thread core/src/services/onedrive/builder.rs Outdated
Comment thread core/src/services/onedrive/backend.rs
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@Xuanwo Xuanwo merged commit 69dd454 into apache:main Apr 28, 2023
@MikeChongCan
Copy link
Copy Markdown
Contributor Author

Thanks a lot!

Thank you, @Xuanwo @suyanhanx !

@Xuanwo Xuanwo mentioned this pull request May 6, 2023
@intgr
Copy link
Copy Markdown

intgr commented Jun 9, 2024

To get a working access_token for OneDrive, we can leverage https://crates.io/crates/graph-rs-sdk, especially its demo: https://github.com/sreeise/graph-rs-sdk/tree/master/examples/oauth

Wait, so how does one use that to get a working access token?

Pretty surprising that there is 0 documentation how to actually configure the OneDrive integration.

@MikeChongCan
Copy link
Copy Markdown
Contributor Author

MikeChongCan commented Jun 10, 2024

To get a working access_token for OneDrive, we can leverage https://crates.io/crates/graph-rs-sdk, especially its demo: https://github.com/sreeise/graph-rs-sdk/tree/master/examples/oauth

Wait, so how does one use that to get a working access token?

Pretty surprising that there is 0 documentation how to actually configure the OneDrive integration.

You should NOT be surprised. This is out of the scope of opendal.

If you'd like to check some tutorials, I did find a quick for you: https://www.youtube.com/watch?v=NljQx11YqNY

In general, OAuth flows for these big techs are pretty complex, sometimes replying on their own SDKs by default. I was working in MSFT. So I knew this very well. For example, if you'd like to use Graph API on iOS/macOS, you might want https://github.com/AzureAD/azure-activedirectory-library-for-objc
Why this flow is always complicated? Because they must respect users' privacy and also data compliance, like GDPR.
So it is always required something like "User Consent".

The goal of OpenDAL is just a light-weight wrapper of some data uploading / downloading apis. So this lib is not depending on any of these first-party SDKs provided by the service companies.

In my own company, I write these logic into Rust directly, referring to the sample code link I shared above. You'd better check them out before being surprised here.
This flow would be easier for you if you write them in Rust for all the other big ones, like Google and/or Dropbox.

@Xuanwo
Copy link
Copy Markdown
Member

Xuanwo commented Jun 10, 2024

To get a working access_token for OneDrive, we can leverage https://crates.io/crates/graph-rs-sdk, especially its demo: https://github.com/sreeise/graph-rs-sdk/tree/master/examples/oauth

Wait, so how does one use that to get a working access token?

Pretty surprising that there is 0 documentation how to actually configure the OneDrive integration.

Thanks for pointing out. Would you like to create an issue for this? It's better if we can improve this part.

@MikeChongCan
Copy link
Copy Markdown
Contributor Author

as I said, it is out of the scope of this project. So I don't think it is an issue of opendal

@Xuanwo
Copy link
Copy Markdown
Member

Xuanwo commented Jun 10, 2024

as I said, it is out of the scope of this project. So I don't think it is an issue of opendal

Yes, it's beyond the scope of this project. However, we can still provide some basic guidance or setup for our users.

We shouldn't say that it's none of OpenDAL's business and do nothing about it. It causes pain for our users. The best approach is to open an issue, bring this problem to a wider audience, and see if anyone is interested in contributing to this.

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