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

serverless-log-forwarding

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-log-forwarding - npm Package Compare versions

Comparing version 1.1.6 to 1.1.8

CHANGELOG.md

24

index.js

@@ -58,2 +58,3 @@ 'use strict';

const filterPattern = service.custom.logForwarding.filterPattern || '';
const normalizedFilterID = !(service.custom.logForwarding.normalizedFilterID === false);
// Get options and parameters to make resources object

@@ -78,3 +79,7 @@ const arn = service.custom.logForwarding.destinationARN;

/* merge new SubscriptionFilter with current resources object */
const subscriptionFilter = this.makeSubscriptionFilter(arn, functions[i], filterPattern);
const subscriptionFilter = this.makeSubscriptionFilter(functions[i], {
arn,
filterPattern,
normalizedFilterID,
});
_.extend(resourceObj, subscriptionFilter);

@@ -88,11 +93,16 @@ }

* Makes a Subscription Filter object for given function name
* @param {String} arn arn of the lambda to forward to
* @param {String} functionName name of function to make SubscriptionFilter for
* @param {String} filterPattern filter pattern for the Subscription
* @param {Object} options with
* arn: arn of the lambda to forward to
* filterPattern: filter pattern for the Subscription
* normalizedFilterID: whether to use normalized FuncName as filter ID
* @return {Object} SubscriptionFilter
*/
makeSubscriptionFilter(arn, functionName, filterPattern) {
makeSubscriptionFilter(functionName, options) {
const functionObject = this.serverless.service.getFunction(functionName);
const logGroupName = this.provider.naming.getLogGroupName(functionObject.name);
const filterLogicalId = `SubscriptionFilter${this.provider.naming.getNormalizedFunctionName(functionName)}`;
const filterName = options.normalizedFilterID ?
this.provider.naming.getNormalizedFunctionName(functionName)
: functionName;
const filterLogicalId = `SubscriptionFilter${filterName}`;
const functionLogGroupId = this.provider.naming.getLogGroupLogicalId(functionName);

@@ -103,4 +113,4 @@ const filter = {};

Properties: {
DestinationArn: arn,
FilterPattern: filterPattern,
DestinationArn: options.arn,
FilterPattern: options.filterPattern,
LogGroupName: logGroupName,

@@ -107,0 +117,0 @@ },

{
"name": "serverless-log-forwarding",
"version": "1.1.6",
"version": "1.1.8",
"description": "a serverless plugin to forward logs to given lambda function",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -39,2 +39,3 @@ # serverless-log-forwarding

filterPattern: '[filter pattern for logs that are sent to Lambda function]'
normalizedFilterID: true # whether to use normalized function name as filter ID
stages:

@@ -41,0 +42,0 @@ - '[name of the stage to apply log forwarding]'

@@ -15,2 +15,3 @@ const chai = require('chai');

filterPattern: 'Test Pattern',
normalizedFilterID: false,
};

@@ -262,3 +263,3 @@ const correctConfigWithStageFilter = {

},
SubscriptionFilterTestFunctionOne: {
SubscriptionFiltertestFunctionOne: {
Type: 'AWS::Logs::SubscriptionFilter',

@@ -275,3 +276,3 @@ Properties: {

},
SubscriptionFilterTestFunctionTwo: {
SubscriptionFiltertestFunctionTwo: {
Type: 'AWS::Logs::SubscriptionFilter',

@@ -278,0 +279,0 @@ Properties: {

Sorry, the diff of this file is too big to display

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