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

@contentful/node-apps-toolkit

Package Overview
Dependencies
Maintainers
92
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/node-apps-toolkit - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

lib/index.d.ts
export { getManagementToken } from './keys';
export { signRequest, verifyRequest, ContentfulHeader } from './requests';
export { signRequest, verifyRequest, ContentfulHeader, CanonicalRequest, SignedRequestHeaders, } from './requests';
export { signRequest } from './sign-request';
export { verifyRequest } from './verify-request';
export { ContentfulHeader } from './typings';
export type { CanonicalRequest, Secret, Timestamp } from './typings';
export type { CanonicalRequest, SignedRequestHeaders } from './typings';

@@ -8,3 +8,3 @@ import { CanonicalRequest, Secret, SignedRequestHeaders, Timestamp } from './typings';

* ~~~
* const {signRequest, ContentfulHeader} = require('contentful-node-apps-toolkit')
* const {signRequest, ContentfulHeader} = require('@contentful/node-apps-toolkit')
* const {pick} = require('lodash')

@@ -17,3 +17,3 @@ * const {server} = require('./imaginary-server')

* const incomingSignature = req.headers['x-contentful-signature']
* const incomingTimestamp = req.headers['x-contentful-timestamp']
* const incomingTimestamp = Number.parseInt(req.headers['x-contentful-timestamp'])
* const incomingSignedHeaders = req.headers['x-contentful-signed-headers']

@@ -20,0 +20,0 @@ * const now = Date.now()

@@ -30,8 +30,7 @@ "use strict";

}
const signedHeaders = rawSignedHeaders.sort(utils_1.sortHeaderKeys);
const signedHeadersString = signedHeaders.join(',');
const signedHeaders = rawSignedHeaders.sort(utils_1.sortHeaderKeys).join(',');
headers[typings_1.ContentfulHeader.Timestamp] = timestamp.toString();
headers[typings_1.ContentfulHeader.SignedHeaders] = signedHeadersString;
headers[typings_1.ContentfulHeader.SignedHeaders] = signedHeaders;
const sortedHeaders = Object.entries(headers).sort(([keyA], [keyB]) => utils_1.sortHeaderKeys(keyA, keyB));
return { sortedHeaders, signedHeaders: signedHeadersString };
return { sortedHeaders, signedHeaders };
};

@@ -44,3 +43,3 @@ /**

* ~~~
* const {signRequest, ContentfulHeader} = require('contentful-node-apps-toolkit')
* const {signRequest, ContentfulHeader} = require('@contentful/node-apps-toolkit')
* const {pick} = require('lodash')

@@ -53,3 +52,3 @@ * const {server} = require('./imaginary-server')

* const incomingSignature = req.headers['x-contentful-signature']
* const incomingTimestamp = req.headers['x-contentful-timestamp']
* const incomingTimestamp = Number.parseInt(req.headers['x-contentful-timestamp'])
* const incomingSignedHeaders = req.headers['x-contentful-signed-headers']

@@ -56,0 +55,0 @@ * const now = Date.now()

@@ -7,5 +7,5 @@ import { CanonicalRequest, Secret, TimeToLive } from './typings';

* ~~~
* const {isVerifiedRequest} = require('contentful-node-apps-toolkit')
* const {server} = require('./imaginary-server')
* const {makeCanonicalRequestFromImaginaryServerRequest} = require('./imaginary-utils')
* const { verifyRequest } = require('@contentful/node-apps-toolkit')
* const { server } = require('./imaginary-server')
* const { makeCanonicalRequestFromImaginaryServerRequest } = require('./imaginary-utils')
*

@@ -12,0 +12,0 @@ * const SECRET = process.env.SECRET

@@ -23,5 +23,5 @@ "use strict";

* ~~~
* const {isVerifiedRequest} = require('contentful-node-apps-toolkit')
* const {server} = require('./imaginary-server')
* const {makeCanonicalRequestFromImaginaryServerRequest} = require('./imaginary-utils')
* const { verifyRequest } = require('@contentful/node-apps-toolkit')
* const { server } = require('./imaginary-server')
* const { makeCanonicalRequestFromImaginaryServerRequest } = require('./imaginary-utils')
*

@@ -28,0 +28,0 @@ * const SECRET = process.env.SECRET

{
"name": "@contentful/node-apps-toolkit",
"version": "1.3.0",
"version": "1.3.1",
"description": "A collection of helpers and utilities for creating NodeJS Contentful Apps",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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