AWS CDN create signed url for specific S3 object version

守給你的承諾、 提交于 2019-12-11 11:25:34

问题


Is it possible to create a signed URL for S3 object with particular version. The idea is to have the same image name but different signed url for all the versions of the image.


回答1:


Yes.

Here are some sample pre-signed URLs that point to a particular object version, with old and new signature format:

http://mybucket.s3-ap-southeast-2.amazonaws.com/cat.jpg?versionId=XXX&AWSAccessKeyId=YYY&Expires=1458463363&Signature=ZZZ

https://s3-ap-southeast-2.amazonaws.com/mybucket/cat.jpg?versionId=XXX&X-Amz-Date=20160319T084413Z&X-Amz-Expires=300&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=VVV3&X-Amz-Credential=YYY/20160319/ap-southeast-2/s3/aws4_request&X-Amz-SignedHeaders=Host&x-amz-security-token=ZZZ

You can see this in action in the S3 console -- just create a versioned file, then choose Actions/Open. It will generate a signed URL for the given version of the object.

As to how to code this... I'm not sure! However, I did verify that a signature for one version will not work with another version.



来源:https://stackoverflow.com/questions/36098263/aws-cdn-create-signed-url-for-specific-s3-object-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!