使用嵌入式C SDK的S3上传文件的AWS代码

发布于 2025-01-21 19:00:50 字数 588 浏览 1 评论 0 原文

我正在尝试使用,但没有成功。

首先,我尝试使用python和boto3 upload_file 函数上传文件,这是成功的。现在,由于嵌入式C SDK需要预先签名的URL(BOTO3没有),因此我修改了Python脚本不调用 upload_file ,但仅在屏幕上打印AWS凭据和键。

然后,我使用这些凭据,放入〜/.aws/凭据,并使用embedded-c sdk的presigned_urls_gen.py脚本生成预先签名的URL。

当我运行演示时,我总是会遇到错误: 您提供的AWS访问密钥ID在我们的记录中不存在。

当我添加一些调试时,我看到boto3做的事情与嵌入式C SDK中的上传示例完全不同。嵌入式C SDK中的示例甚至都不使用SIGV4签名或在请求中添加安全标头。

在嵌入式C SDK与boto3中,相同的上传过程是如此之不同?

I am trying to upload a file to an AWS S3 private bucket using aws-iot-device-sdk-embedded-c, but without success.

First I tried upload a file using python and boto3 upload_file function, this was successful. Now because the embedded-C sdk requires a pre-signed URL's (boto3 doesn't) I have modified the python script not to call upload_file but only print the aws credentials and key to the screen.

Then I take these credentials, put in ~/.aws/credentials and generate a pre-signed URL using the presigned_urls_gen.py script of embedded-C sdk.

When I run the demo I am always getting the error:
The AWS Access Key Id you provided does not exist in our records.

When I added some debug I saw that boto3 is doing something completly different then the upload example in embedded-C sdk. The example in embedded-C sdk is not even using sigv4 to sign anything or add security headers to the request.

How come the same upload procedure is so different in embedded-C sdk versus the boto3?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文