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

@sentry/node

Package Overview
Dependencies
Maintainers
13
Versions
550
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/node - npm Package Compare versions

Comparing version 5.13.2 to 5.14.0

8

dist/handlers.d.ts

@@ -14,2 +14,3 @@ /// <reference types="node" />

interface ParseRequestOptions {
ip?: boolean;
request?: boolean | string[];

@@ -31,2 +32,9 @@ serverName?: boolean;

[key: string]: any;
user?: {
[key: string]: any;
};
ip?: string;
connection?: {
remoteAddress?: string;
};
}, options?: ParseRequestOptions): Event;

@@ -33,0 +41,0 @@ /**

35

dist/handlers.js

@@ -139,18 +139,11 @@ Object.defineProperty(exports, "__esModule", { value: true });

/** JSDoc */
function extractUserData(req, keys) {
var user = {};
function extractUserData(user, keys) {
var extractedUser = {};
var attributes = Array.isArray(keys) ? keys : DEFAULT_USER_KEYS;
attributes.forEach(function (key) {
if (req.user && key in req.user) {
user[key] = req.user[key];
if (user && key in user) {
extractedUser[key] = user[key];
}
});
// client ip:
// node: req.connection.remoteAddress
// express, koa: req.ip
var ip = req.ip || (req.connection && req.connection.remoteAddress);
if (ip) {
user.ip_address = ip;
}
return user;
return extractedUser;
}

@@ -167,3 +160,3 @@ /**

// tslint:disable-next-line:no-parameter-reassignment
options = tslib_1.__assign({ request: true, serverName: true, transaction: true, user: true, version: true }, options);
options = tslib_1.__assign({ ip: false, request: true, serverName: true, transaction: true, user: true, version: true }, options);
if (options.version) {

@@ -178,5 +171,17 @@ event.extra = tslib_1.__assign({}, event.extra, { node: global.process.version });

}
if (options.user && req.user) {
event.user = tslib_1.__assign({}, event.user, extractUserData(req, options.user));
if (options.user) {
var extractedUser = req.user ? extractUserData(req.user, options.user) : {};
if (Object.keys(extractedUser)) {
event.user = tslib_1.__assign({}, event.user, extractedUser);
}
}
// client ip:
// node: req.connection.remoteAddress
// express, koa: req.ip
if (options.ip) {
var ip = req.ip || (req.connection && req.connection.remoteAddress);
if (ip) {
event.user = tslib_1.__assign({}, event.user, { ip_address: ip });
}
}
if (options.transaction && !event.transaction) {

@@ -183,0 +188,0 @@ var transaction = extractTransaction(req, options.transaction);

export declare const SDK_NAME = "sentry.javascript.node";
export declare const SDK_VERSION = "5.13.2";
export declare const SDK_VERSION = "5.14.0";
//# sourceMappingURL=version.d.ts.map
Object.defineProperty(exports, "__esModule", { value: true });
exports.SDK_NAME = 'sentry.javascript.node';
exports.SDK_VERSION = '5.13.2';
exports.SDK_VERSION = '5.14.0';
//# sourceMappingURL=version.js.map

@@ -14,2 +14,3 @@ /// <reference types="node" />

interface ParseRequestOptions {
ip?: boolean;
request?: boolean | string[];

@@ -31,2 +32,9 @@ serverName?: boolean;

[key: string]: any;
user?: {
[key: string]: any;
};
ip?: string;
connection?: {
remoteAddress?: string;
};
}, options?: ParseRequestOptions): Event;

@@ -33,0 +41,0 @@ /**

@@ -137,18 +137,11 @@ import * as tslib_1 from "tslib";

/** JSDoc */
function extractUserData(req, keys) {
var user = {};
function extractUserData(user, keys) {
var extractedUser = {};
var attributes = Array.isArray(keys) ? keys : DEFAULT_USER_KEYS;
attributes.forEach(function (key) {
if (req.user && key in req.user) {
user[key] = req.user[key];
if (user && key in user) {
extractedUser[key] = user[key];
}
});
// client ip:
// node: req.connection.remoteAddress
// express, koa: req.ip
var ip = req.ip || (req.connection && req.connection.remoteAddress);
if (ip) {
user.ip_address = ip;
}
return user;
return extractedUser;
}

@@ -165,3 +158,3 @@ /**

// tslint:disable-next-line:no-parameter-reassignment
options = tslib_1.__assign({ request: true, serverName: true, transaction: true, user: true, version: true }, options);
options = tslib_1.__assign({ ip: false, request: true, serverName: true, transaction: true, user: true, version: true }, options);
if (options.version) {

@@ -176,5 +169,17 @@ event.extra = tslib_1.__assign({}, event.extra, { node: global.process.version });

}
if (options.user && req.user) {
event.user = tslib_1.__assign({}, event.user, extractUserData(req, options.user));
if (options.user) {
var extractedUser = req.user ? extractUserData(req.user, options.user) : {};
if (Object.keys(extractedUser)) {
event.user = tslib_1.__assign({}, event.user, extractedUser);
}
}
// client ip:
// node: req.connection.remoteAddress
// express, koa: req.ip
if (options.ip) {
var ip = req.ip || (req.connection && req.connection.remoteAddress);
if (ip) {
event.user = tslib_1.__assign({}, event.user, { ip_address: ip });
}
}
if (options.transaction && !event.transaction) {

@@ -181,0 +186,0 @@ var transaction = extractTransaction(req, options.transaction);

export declare const SDK_NAME = "sentry.javascript.node";
export declare const SDK_VERSION = "5.13.2";
export declare const SDK_VERSION = "5.14.0";
//# sourceMappingURL=version.d.ts.map
export var SDK_NAME = 'sentry.javascript.node';
export var SDK_VERSION = '5.13.2';
export var SDK_VERSION = '5.14.0';
//# sourceMappingURL=version.js.map
{
"name": "@sentry/node",
"version": "5.13.2",
"version": "5.14.0",
"description": "Offical Sentry SDK for Node.js",

@@ -19,7 +19,7 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/apm": "5.13.2",
"@sentry/core": "5.13.2",
"@sentry/hub": "5.13.2",
"@sentry/types": "5.13.2",
"@sentry/utils": "5.13.2",
"@sentry/apm": "5.14.0",
"@sentry/core": "5.14.0",
"@sentry/hub": "5.14.0",
"@sentry/types": "5.14.0",
"@sentry/utils": "5.14.0",
"cookie": "^0.3.1",

@@ -26,0 +26,0 @@ "https-proxy-agent": "^4.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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