@contentful/node-apps-toolkit
Advanced tools
Comparing version 1.3.0 to 1.3.1
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
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
87854
1116