Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@danielmyerfenton/react-native-aws3

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@danielmyerfenton/react-native-aws3 - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "@danielmyerfenton/react-native-aws3",
"version": "1.0.0",
"version": "1.0.1",
"description": "Pure JavaScript react native library for uploading to AWS S3",

@@ -5,0 +5,0 @@ "author": {

@@ -65,43 +65,2 @@ /**

const getDate = () => {
let date = new Date();
let yymmdd = date.toISOString().slice(0, 10).replace(/-/g, "");
let amzDate = yymmdd + "T000000Z";
return { yymmdd: yymmdd, amzDate: amzDate }
}
/**
* Expires in 5 minutes. Amazon will reject request
* if it arrives after the expiration date.
*
* returns string in ISO8601 GMT format, i.e.
*
* 2016-03-24T20:43:47.314Z
*/
const getExpirationDate = () => {
return new Date(
(new Date).getTime() + FIVE_MINUTES
).toISOString();
}
const getPolicyParams = (options) => {
let date = getDate();
let expiration = getExpirationDate();
return {
acl: options.acl || AWS_ACL,
algorithm: AWS_ALGORITHM,
bucket: options.bucket,
contentType: options.contentType,
credential: options.accessKey + "/" + date.yymmdd + "/" + options.region + "/" + AWS_SERVICE_NAME + "/" + AWS_REQUEST_POLICY_VERSION,
date: date,
expiration: expiration,
key: options.key,
region: options.region,
secretKey: options.secretKey,
successActionStatus: '' + (options.successActionStatus || DEFAULT_SUCCESS_ACTION_STATUS),
metadata: options.metadata
}
}
const formatPolicyForRequestBody = (base64EncodedPolicy, signature, options) => {

@@ -118,2 +77,3 @@ return {

"X-Amz-Signature": signature,
metadata: options.metadata
}

@@ -124,3 +84,3 @@ }

let policyForEncoding = {
"expiration": policy.expiration,
"expiration": policy.expirationDate,
"conditions": [

@@ -137,4 +97,3 @@ {"bucket": policy.bucket},

}
if (policy.metdata) {
if (policy.metadata) {
Object.keys(policy.metadata).forEach((k) => {

@@ -141,0 +100,0 @@ let metadata = String(policy.metadata[k])

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc