New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-api-gateway-caching

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-api-gateway-caching - npm Package Compare versions

Comparing version 1.3.8 to 1.4.0

2

package.json
{
"name": "serverless-api-gateway-caching",
"version": "1.3.8",
"version": "1.4.0",
"description": "A plugin for the serverless framework which helps with configuring caching for API Gateway endpoints.",

@@ -5,0 +5,0 @@ "main": "src/apiGatewayCachingPlugin.js",

@@ -130,1 +130,24 @@ # serverless-api-gateway-caching

```
### Configuring a shared api gateway
No modifications will be applied to the root caching configuration of the api gateway,
Cache time to live, invalidation settings and data encryption are applied to all functions, unless specifically overridden.
```yml
plugins:
- serverless-api-gateway-caching
custom:
# Enable or disable caching globally
apiGatewayCaching:
enabled: true
apiGatewayIsShared: true
clusterSize: '0.5' # defaults to '0.5'
ttlInSeconds: 300 # defaults to the maximum allowed: 3600
dataEncrypted: true # defaults to false
perKeyInvalidation:
requireAuthorization: true # default is true
handleUnauthorizedRequests: Ignore # default is "IgnoreWithWarning"
```

@@ -81,2 +81,3 @@ const get = require('lodash.get');

this.cachingEnabled = serverless.service.custom.apiGatewayCaching.enabled;
this.apiGatewayIsShared = serverless.service.custom.apiGatewayCaching.apiGatewayIsShared;

@@ -83,0 +84,0 @@ if (options) {

@@ -22,2 +22,7 @@ const isEmpty = require('lodash.isempty');

const createPatchForStage = (settings) => {
if (settings.apiGatewayIsShared) {
return [];
}
let patch = [{

@@ -27,3 +32,4 @@ op: 'replace',

value: `${settings.cachingEnabled}`
}]
}];
if (settings.cachingEnabled) {

@@ -35,8 +41,16 @@ patch.push({

});
patch.push({
op: 'replace',
path: '/*/*/caching/dataEncrypted',
value: `${settings.dataEncrypted}`
value: `${settings.dataEncrypted}`
});
patch.push({
op: 'replace',
path: '/*/*/caching/ttlInSeconds',
value: `${settings.cacheTtlInSeconds}`
});
}
return patch;

@@ -43,0 +57,0 @@ }

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