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

sls-helper-plugin-janis

Package Overview
Dependencies
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sls-helper-plugin-janis - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

8

CHANGELOG.md

@@ -9,2 +9,10 @@ # Changelog

## [2.2.0] - 2020-02-18
### Added
- Custom authorizer support added in event listeners
- Custom authorizers can now be defined in `custom.authorizers` object in initial config and they will be remain untouched
### Fixed
- Authorizers now use the correct ARN
## [2.1.0] - 2020-02-14

@@ -11,0 +19,0 @@ ### Added

7

lib/event-listener/index.js

@@ -15,3 +15,4 @@ 'use strict';

mustHaveClient,
listenersDirName
listenersDirName,
authorizer
}) => {

@@ -28,3 +29,3 @@

const authorizer = mustHaveClient ? 'ServiceAuthorizer' : 'ServiceNoClientAuthorizer';
const authorizerName = authorizer || (mustHaveClient ? 'ServiceAuthorizer' : 'ServiceNoClientAuthorizer');

@@ -43,3 +44,3 @@ const listenerName = `${serviceNameAsTitle}${entityNameAsTitle}${eventNameAsTitle}Listener`.replace(/ /g, '');

method: 'post',
authorizer: `\${self:custom.authorizers.${authorizer}}`,
authorizer: `\${self:custom.authorizers.${authorizerName}}`,
request: {

@@ -46,0 +47,0 @@ template: '${self:custom.apiRequestTemplate}'

@@ -51,3 +51,3 @@ 'use strict';

name,
arn: `arn:aws:lambda:us-east-1:${accountId}:function:JanisIdService-\${self:custom.stage}-${authorizersNameToFunctionMapping[name] || name}`,
arn: `arn:aws:lambda:us-east-1:${accountId}:function:JanisAuthorizerService-\${self:custom.stage}-${authorizersNameToFunctionMapping[name] || name}`,
resultTtlInSeconds: 300,

@@ -72,2 +72,4 @@ identitySource: headers.map(header => `method.request.header.${header}`).join(','),

const authorizers = (custom && custom.authorizers) || {};
return {

@@ -77,5 +79,8 @@ ...serviceConfig,

...(custom || {}),
authorizers: buildAuthorizers(accountId)
authorizers: {
...authorizers,
...buildAuthorizers(accountId)
}
}
};
};
{
"name": "sls-helper-plugin-janis",
"version": "2.1.0",
"version": "2.2.0",
"description": "A Serverless Helper plugin to add custom helpers for JANIS Commerce",

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

@@ -84,3 +84,3 @@ # Serverless Helper Plugin JANIS

| requestHeaders | object | A key value to map headers to a boolean indicating if it's required or not | | |
| authorizer | string | The name of the authorizer | Valid authorizers: FullAuthorizer, NoClientAuthorizer, LoggedAuthorizer, ApiKeyAuthorizer, UserAuthorizer, DevUserAuthorizer, ServiceAuthorizer, ServiceNoClientAuthorizer, ClientAuthorizer | |
| authorizer | string | The name of the authorizer | | |

@@ -100,3 +100,3 @@ ### apiList, apiGet, apiPost and apiPut

| requestHeaders | object | A key value to map headers to a boolean indicating if it's required or not | | |
| authorizer | string | The name of the authorizer | Valid authorizers: FullAuthorizer, NoClientAuthorizer, LoggedAuthorizer, ApiKeyAuthorizer, UserAuthorizer, DevUserAuthorizer, ServiceAuthorizer, ServiceNoClientAuthorizer, ClientAuthorizer | |
| authorizer | string | The name of the authorizer | | |

@@ -114,2 +114,3 @@ ### eventListener

| listenersDirName | string | Indicates the path where the event listener files are placed | | `'event-listeners'` |
| authorizer | string | The name of the authorizer | | If not set, it defaults to `ServiceAuthorizer` or `ServiceNoClientAuthorizer` based on the value of `mustHaveClient` |

@@ -116,0 +117,0 @@ ## Examples

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