Skip to content

Commit

Permalink
v2.1.0 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinstewart authored Feb 7, 2023
1 parent 83e8337 commit ca67f24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit ca67f24

Please sign in to comment.