Presigned URLs
Accessing non-public Buckets/Objects on FDS requires authentication information. The signature information is expected to be computed in the URL's query parameter so that no additional authentication information is needed to access the Bucket/Object. For example, if the developer wants to share an object with others, but does not want to set Object to Public, they can use a presigned URL.
The difference between using Presigned URLs and ordinary URLs to access FDS is the location of the signature information. There are no other differences.
Presigned URL parameters:For signatures computed using the FDS signature algorithm, please refer to Requesting Authentication</u> for the signature calculation method.</td> </tr> </tbody> </table>
Note
- The presigned URL used for downloading needs to be generated using the GET method. The presigned URL for uploading needs to be generated using the PUT/POST method.
- The presigned URL can be generated using the generatePresignedUrl in the SDK.
Presigned URL Multipart Upload Sample
There are three stages (Init, Upload, Complete) for uploading using presigned URLs. The following is a brief introduction to these three phases.
Init Phase
Generate a presigned URL for SubResource using Uploads, and then use the generated URL to get the uploadId (uploadId in the response). Here is an example of a presigned url generated during this phase:
http://files.fds.api.xiaomi.com/zjbtest/mp-test?uploads&GalaxyAccessKeyId=5631729037601&Expires=61407043200000&Signature=ucr9WLlD9NWedMGj7rK2eSVc+OM=
Upload Phase
Generate presigned URLs for SubResource with uploadId and partNumber, then upload the fragments through the generated URL. partNumber is incremented in order from 1 and the data is placed in the http body. Here is an example of a presigned URL generated during this phase:
http://files.fds.api.xiaomi.com/zjbtest/mp-test?uploadId=c5eaecc9-c8fc-48d9-85b4-6dc8706a1f16&partNumber=1&GalaxyAccessKeyId=5631729037601&Expires=61407043200000&Signature=CJiuC0aR8Lj2Y/itExFBHWjvmUE=
Complete Phase
Generate a presigned URL with uploadId for the SubResource, then end the upload with the generated URL. The Request body is a list of UploadPartResults returned by the Upload Part in json format. For detailed information, please refer to the Fragment Upload Process Explanation. Here is an example of a presigned URL generated during this phase:
http://files.fds.api.xiaomi.com/zjbtest/mp-test?uploadId=c5eaecc9-c8fc-48d9-85b4-6dc8706a1f16&GalaxyAccessKeyId=5631729037601&Expires=61407043200000&Signature=vS+vaEMBSMP4LFQwrsP+BCHMguw=
Note: Some tools will add content-type when sending HTTP requests. If the content-type is not specified when presigned URLs are generated, the content-type needs to be set to null when uploading. For example: curl -H "Content-Type:".