Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
s3cors
Advanced tools
Readme
##s3cors
###Direct uploads to Amazon S3 via CORS.
First setup a CORS policy on your S3 bucket.
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Create your form fields:
var s3cors = require('s3cors')
var formFields = s3cors.create({
"key": "AWS_KEY",
"secret": "AWS_SECRET",
"bucket": "AWS_BUCKET",
"cal": "public-read",
"region": "eu-west-1"
})
This will return a URL to post to (formFields.url) and a dictionary of values (formFields.data) to append to your upload form. In your html the file input field must be named "file".
<form action="{{ formFields.url }}" method="POST">
<input type="file" name="file"></imput>
{% formFields.data.forEach(function(key){ %}
<input type="hidden" name="{{ key }}" value="{{ formFields[key] }}">
{% }) %}
</form>
Tests: npm test
Install: npm install s3cors
FAQs
Direct CORS uploads to S3.
The npm package s3cors receives a total of 2 weekly downloads. As such, s3cors popularity was classified as not popular.
We found that s3cors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).