-
Notifications
You must be signed in to change notification settings - Fork 478
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(services/onedrive): Add read and write support for OneDrive #2129
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
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_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/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: