如何复制带有预签名URL的对象? [英] How do I copy an object with presigned URL?

查看:269
本文介绍了如何复制带有预签名URL的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一项服务,该服务将我需要的数据放在S3上,并提供了要下载的预签名URL列表(http://.s3.amazonaws.com/?AWSAccessKeyID = ...& Signature = ...& Expires = ...).
我想将这些文件复制到我的S3存储桶中,而不必下载并重新上传.

I'm using a service that puts the data I need on S3 and gives me a list of presigned URLs to download (http://.s3.amazonaws.com/?AWSAccessKeyID=...&Signature=...&Expires=...).
I want to copy those files into my S3 bucket without having to download them and upload again.

我正在使用Ruby SDK(但愿意的话尝试其他方法.)并且无法编写类似的内容.

I'm using the Ruby SDK (but willing to try something else if it works..) and couldn't write anything like this.

我能够使用我的凭据(access_key和secret)初始化S3对象,从而授予我对 my 存储桶的访问权限,但是如何传递源端" access_key_idsignatureexpires参数?

I was able to initialize the S3 object with my credentials (access_key and secret) that grants me access to my bucket, but how do I pass the "source-side" access_key_id, signature and expires parameters?

为了使问题更简单-我什至无法使用预签名参数对对象进行GET请求. (不适用于常规HTTP,我想通过SDK API进行操作.)

To make the problem a bit simpler - I can't even do a GET request to the object using the presigned parameters. (not with regular HTTP, I want to do it through the SDK API).

我发现了很多有关如何创建预签名URL的示例,但没有关于如何使用已经给定的参数进行身份验证的示例(我显然没有数据提供者的secret_key).

I found a lot of examples of how to create a presigned URL but nothing about how to authenticate using an already given parameters (I obviously don't have the secret_key of my data provider).

谢谢!

推荐答案

您无法使用已签名的url进行此操作,但是如上所述,如果您在EC2内针对相关存储分区的适当区域中获取并上传文件,基本上没有额外的费用.

You can't do this with a signed url, but as has been mentioned, if you fetch and upload within EC2 in an appropriate region for the buckets in question, there's essentially no additional cost.

同样值得注意的是,两个存储桶不必位于同一帐户中,但是用于发出请求的aws密钥必须具有放置目标对象和获取源对象的权限.可以在多个帐户之间授予权限...尽管在许多情况下,不太可能授予该权限.

Also worth noting, both buckets do not have to be in the same account, but the aws key that you use to make the request have to have permission to put the target object and get the source object. Permissions can be granted across accounts... though in many cases, that's unlikely to be granted.

http://docs.aws.amazon.com/AmazonS3/Latest/API/RESTObjectCOPY.html

这篇关于如何复制带有预签名URL的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆