我已经使用javaScript编写了一个代码来生成一个预签名的URL。但它包含AccessKey和SecretAccess键值。是否有其他方法可以生成不提供凭证值的预签名URL。 这是我的代码
var aws = require('aws-sdk');
var s3 = new aws.S3({
signatureVersion: 'v4',
region: 'us-east-2'
});
s3.config.update({accessKeyId: myAccessKey,
secretAccessKey: mySecretAccessKey,
});
const myBucket = 'bucketName'
const myKey = 'objPath'
//expiry time is set to 7 days
const signedUrlExpireSeconds = 604800
const url = s3.getSignedUrl('getObject', {
Bucket: myBucket,
Key: myKey,
Expires: signedUrlExpireSeconds
})