react-s3-uploader
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "react-s3-uploader", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "React component that renders an <input type=\"file\"/> and automatically uploads to an S3 bucket", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -50,2 +50,4 @@ react-s3-uploader | ||
You must provide environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY` to use the server route. | ||
#### Access/Secret Keys | ||
The `aws-sdk` must be configured with your account's Access Key and Secret Access Key. [There are a number of ways to provide these](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html), but setting up environment variables is the quickest. You just have to configure environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, and AWS automatically picks them up. |
@@ -10,14 +10,9 @@ | ||
var AWS_ACCESS_KEY_ID = options.accessKey || process.env.AWS_ACCESS_KEY_ID, | ||
AWS_SECRET_KEY = options.secretKey || process.env.AWS_SECRET_KEY, | ||
S3_BUCKET = options.bucket, | ||
var S3_BUCKET = options.bucket, | ||
getFileKeyDir = options.getFileKeyDir || function() { return "."; }; | ||
if (!AWS_ACCESS_KEY_ID || !AWS_SECRET_KEY || !S3_BUCKET) { | ||
throw new Error("AWS_ACCESS_KEY_ID, AWS_SECRET_KEY, and S3_BUCKET must be available."); | ||
if (!S3_BUCKET) { | ||
throw new Error("S3_BUCKET is required."); | ||
} | ||
aws.config.update({accessKeyId: AWS_ACCESS_KEY_ID , secretAccessKey: AWS_SECRET_KEY }); | ||
var router = express.Router(); | ||
@@ -24,0 +19,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
53
0
10632
199