feat(services/onedrive): Add read and write support for OneDrive#2129
feat(services/onedrive): Add read and write support for OneDrive#2129Xuanwo merged 40 commits intoapache:mainfrom
Conversation
# Conflicts: # core/src/services/mod.rs # core/src/types/scheme.rs
# Conflicts: # core/src/services/gcs/backend.rs # core/src/services/gcs/core.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
Thank you, @Xuanwo @suyanhanx ! |
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 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. |
Thanks for pointing out. Would you like to create an issue for this? It's better if we can improve this part. |
|
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. |
To get a working
access_tokenfor OneDrive, we can leverage https://crates.io/crates/graph-rs-sdk, especially its demo: https://github.com/sreeise/graph-rs-sdk/tree/master/examples/oauthThis 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: