Socket
Socket
Sign inDemoInstall

s3-post-policy

Package Overview
Dependencies
8
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.3.0

16

lib/index.js

@@ -73,6 +73,16 @@ var aws4_sign = require("aws4-signature");

if (Array.isArray(p)) {
if (p[0] === "starts-with") {
output.starts_with.push(p[1].substr(1));
if (p[0] === "content-length-range") {
output.content_length_range = [p[1], p[2]];
} else {
var k = p[1].substr(1);
var v = p[2];
if (p[0] === "starts-with") {
var o = {};
o[k] = v;
output.starts_with.push(o);
}
output.fields[k] = v;
}
output.fields[p[1].substr(1)] = p[2];
} else {

@@ -79,0 +89,0 @@ var key = Object.keys(p)[0];

2

package.json
{
"name": "s3-post-policy",
"version": "2.2.0",
"version": "2.3.0",
"description": "A POST policy generator for S3 using AWS Signature Version 4",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -13,5 +13,6 @@ var policy_gen = require("..");

{"acl": "public-read"},
["starts-with", "$Content-Type", "image/"],
["eq", "$Content-Type", "image/png"],
["starts-with", "$key", "user/user1/"],
["starts-with", "$x-amz-meta-tag", ""],
["content-length-range", 1, 1000000],
{"x-amz-meta-uuid": "14365123651274"}

@@ -22,2 +23,2 @@ ]

console.log(output);
console.log(JSON.stringify(output, null, 4));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc