小编Vin*_*ent的帖子

使用 aws-sdk 的 AWS S3 签名 URL 失败并显示“AuthorizationQueryParametersError”

我正在尝试为 S3 上的私有文件 test.png 创建一个预先签名的 URL。我的代码:

var AWS = require('aws-sdk'); 

AWS.config.region = 'eu-central-1';

const s3 = new AWS.S3();

const key = 'folder/test.png';
const bucket = 'mybucket';
const expiresIn = 2000; 

const params = {
    Bucket: bucket,
    Key: key,
    Expires: expiresIn,
};
console.log('params: ', params);
console.log('region: ', AWS.config.region);

var url = s3.getSignedUrl('getObject', params);
console.log('url sync: ', url);

s3.getSignedUrl('getObject', params, function (err, urlX) {
    console.log("url async: ", urlX);
});
Run Code Online (Sandbox Code Playgroud)

它在控制台中返回一个 URL。当我尝试访问它时,它显示

<Error>
<Code>AuthorizationQueryParametersError</Code>
<Message>
Query-string authentication version 4 requires the X-Amz-Algorithm, X-Amz-Credential, …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 node.js pre-signed-url aws-sdk

3
推荐指数
1
解决办法
4697
查看次数

工作区插件中的应用程序脚本运行时错误“超出最大执行时间”

问题:

大约 45 秒后,我收到错误“超出最大执行时间” 。

预期行为:

该函数应运行 6 分钟。在那段时间之后,我预计会出现错误。我在这里检查了当前的配额限制:https ://developers.google.com/apps-script/guides/services/quotas#current_limitations

我的测试设置:

我尝试删除所有代码,只使用一个函数“runFor6Min()”,它只执行:

Utilities.sleep(6000 * 10)
Run Code Online (Sandbox Code Playgroud)

我假设该函数应被视为脚本运行时(6 分钟),而不是自定义函数运行时(30 秒),例如 Google 表格中的自定义函数。

还有什么想法我还可以尝试吗?

附加 appsscript.json 在此输入图像描述

quota google-apps-script google-workspace-add-ons

1
推荐指数
1
解决办法
654
查看次数