Skip to content
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

Add supporting presign for other cloud storage services #2070

Closed
2 of 4 tasks
suyanhanx opened this issue Apr 22, 2023 · 7 comments · Fixed by #2253
Closed
2 of 4 tasks

Add supporting presign for other cloud storage services #2070

suyanhanx opened this issue Apr 22, 2023 · 7 comments · Fixed by #2253
Assignees
Labels
core help wanted Extra attention is needed

Comments

@suyanhanx
Copy link
Member

suyanhanx commented Apr 22, 2023

We have implemented presign for s3. But haven't implemented it for other cloud services yet.

azblob and gcs are ready for implementing presign, just need some work on the opendal side. Other services may need some extra work at the reqsign side.

Originally posted by @Xuanwo in #2067 (comment)

What is presign?

presign, which allows users to pre-sign S3 or other cloud storage services' requests, with operations, expiration time, and HTTP headers. This enables users to execute the request elsewhere, providing greater flexibility and control.

How to implement presign operation for a service?

To implement presign for a service, the service needs to support pre-sign first in order to use it.

For a service that supports presign, we could do the following steps(We will take s3 as an example here):

  1. Find the service related folder. We place those files in core/src/services/s3.
  2. Implement request builder. We always place the actual request generation function in the core.rs. Currently, we offer three operations for ·presign· - stat, read, and write. You will need to implement those request builders according to the actual capabilities of the corresponding service.
    1. https://github.com/apache/incubator-opendal/blob/fdc8d8d2aea5d725a677244fae2b1a69075f9b25/core/src/services/s3/core.rs#L206
    2. https://github.com/apache/incubator-opendal/blob/fdc8d8d2aea5d725a677244fae2b1a69075f9b25/core/src/services/s3/core.rs#L235
    3. https://github.com/apache/incubator-opendal/blob/fdc8d8d2aea5d725a677244fae2b1a69075f9b25/core/src/services/s3/core.rs#L315
  3. Map the operation to the request builder. In the backend.rs of the service, we will implement the presign method for Accessor. Within this method, we map the operation type in OpPresign to an actual request.
    1. https://github.com/apache/incubator-opendal/blob/fdc8d8d2aea5d725a677244fae2b1a69075f9b25/core/src/services/s3/backend.rs#L1056
  4. Enable presign capability for our service. We are using behavior tests to ensure every service's behavior is the same. To enable testing for presign, simply enable the presign capability for the service. This capability will be checked during behavioral tests. You can achieve this by modifying the Accessor.info function implementation and adding presign: true to the Capability construction. So we will get:
    https://github.com/apache/incubator-opendal/blob/fdc8d8d2aea5d725a677244fae2b1a69075f9b25/core/src/services/s3/backend.rs#L910-L940
  5. Finally, make sure the tests pass. Keep modifying your code until all the tests pass successfully.

Tasks:

Waiting for reqsign side tasks finish

  • obs
  • oss
@suyanhanx suyanhanx changed the title Add supporting presign for other cloud storage services? Add supporting presign for other cloud storage services Apr 22, 2023
@suyanhanx suyanhanx added help wanted Extra attention is needed core labels Apr 24, 2023
@silver-ymz

This comment was marked as resolved.

@Xuanwo

This comment was marked as resolved.

@silver-ymz

This comment was marked as resolved.

@silver-ymz

This comment was marked as resolved.

@Xuanwo

This comment was marked as resolved.

@cuichenli
Copy link
Contributor

looks like reqsign supports both obs and oss now, may i pick this up?

@Xuanwo
Copy link
Member

Xuanwo commented May 8, 2023

looks like reqsign supports both obs and oss now, may i pick this up?

Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants