From ca67f241e58d986a187147bb77c278f509819a88 Mon Sep 17 00:00:00 2001 From: Devin Stewart Date: Mon, 6 Feb 2023 19:51:55 -0600 Subject: [PATCH] v2.1.0 (#50) --- CHANGELOG.md | 3 +++ README.md | 7 ++++++- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3970c21..752d134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +**v2.1.0 Custom Request Agent** +- add support for a custom request agent. + **v2.0.0 Cache** - add lru-cache to cache the certificate keys from AWS. This is breaking change as the `Validator` now has to be instantiated with `new Validator()` - rearange the TypeScript definitions to align with the pattern in the aws-sdk diff --git a/README.md b/README.md index 9ce8511..bcb4a43 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,12 @@ The `Validator` object can be instantiated with the following cache options: const Validator = require('sns-payload-validator'); const validator = new Validator({ useCache: true, maxCerts: 100 }); ``` - +## Custom Request Agent +If a custom request agent is needed, it can be passed to the `Validator` object, which will be used when making requests to download the certificate. This is useful if you are behind a proxy. By default the `Validator` object uses the `https` module. +```javascript +const Validator = require('sns-payload-validator'); +const validator = new Validator({ requestAgent: new ExternalProxyLib({ proxy: 'http://localhost:3000' }) }); +``` ## Examples with Types Not to be confused with TypeScript, AWS SNS Messages start with a `Type` field. The `Type` is one of three values: `Notification`, `SubscriptionConfirmation` or `UnsubscribeConfirmation`. ### Subscribe / Unsubscribe diff --git a/package.json b/package.json index 0912b64..cb11ed4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sns-payload-validator", - "version": "2.0.1", + "version": "2.1.0", "description": "Node.js library that validates an AWS SNS payload of an HTTP/S POST or Lambda.", "main": "lib/index", "types": "lib/index.d.ts",