You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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):
Find the service related folder. We place those files in core/src/services/s3.
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.
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.
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
Finally, make sure the tests pass. Keep modifying your code until all the tests pass successfully.
The text was updated successfully, but these errors were encountered:
suyanhanx
changed the title
Add supporting presign for other cloud storage services?
Add supporting presign for other cloud storage services
Apr 22, 2023
We have implemented
presign
fors3
. But haven't implemented it for other cloud services yet.azblob
andgcs
are ready for implementingpresign
, just need some work on the opendal side. Other services may need some extra work at thereqsign
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 supportpre-sign
first in order to use it.For a service that supports
presign
, we could do the following steps(We will takes3
as an example here):core/src/services/s3
.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.backend.rs
of the service, we will implement thepresign
method forAccessor
. Within this method, we map the operation type inOpPresign
to an actual request.presign
capability for our service. We are using behavior tests to ensure every service's behavior is the same. To enable testing forpresign
, simply enable thepresign
capability for the service. This capability will be checked during behavioral tests. You can achieve this by modifying theAccessor.info
function implementation and addingpresign: true
to theCapability
construction. So we will get:https://github.com/apache/incubator-opendal/blob/fdc8d8d2aea5d725a677244fae2b1a69075f9b25/core/src/services/s3/backend.rs#L910-L940
Tasks:
presign
for azblob #2118 @silver-ymzWaiting for
reqsign
side tasks finishThe text was updated successfully, but these errors were encountered: