问题描述
是否可以为具有特定版本的S3对象创建签名的URL。
的想法是为所有版本的图像使用相同的图像名称,但签名的URL不同。
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.
推荐答案
是的。
以下是一些指向特定对象版本的示例预签名URL,它们具有新旧的签名格式:
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
您可以在S3控制台中看到它的作用-只是创建一个版本控制的文件,然后选择操作/打开。
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.
这篇关于AWS CDN为特定的S3对象版本创建签名的url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!