在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ktonon/koa-s3-sign-upload开源软件地址:https://github.com/ktonon/koa-s3-sign-upload开源编程语言:JavaScript 100.0%开源软件介绍:koa-s3-sign-uploadMiddleware for Koa to sign AWS S3 upload requests. Specifically, this middleware is designed to work with react-s3-uploader. Credit is given to @OKNoah for PR #80 from which this package is derived. Install $ npm install -S koa-s3-sign-upload Usage const signS3 = require('koa-s3-sign-upload');
app.use(signS3({
bucket: 'MyS3Bucket',
// optional. Prepends this values to all upload keys
keyPrefix: '',
// optional. Prepends a random GUID to the `objectName` query parameter
randomizeFilename: true,
// optional
region: 'us-east-1',
// optional (use for some amazon regions: frankfurt and others)
signatureVersion: 'v4',
// optional
headers: { 'Access-Control-Allow-Origin': '*' },
// this is default
ACL: 'private',
// optional
accessKeyId: 'foo',
// optional
secretAccessKey: 'bar',
// optional. useful for s3-compatible APIs
endpoint: 'https://rest.s3alternative.com',
// optional. default is /s3. useful if you version your API endpoints
prefix: '/v1/s3',
// optional. exposes GET /s3/uploads/...
// which redirects to signed S3 urls
enableRedirect: true,
})); With default parameters, this will expose an endpoint
If Access/Secret Keys The aws-sdk must be configured with your account's AWS credentials. There are a number of ways to provide these. The easiest ways are to either provide them in the options or to set up the Note: Best practice in EC2/Lambda is to use an IAM instance/execution role, in which case you must not specify the |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论