@gasket/plugin-elastic-apm 7.2.1 → 7.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cookies.js +6 -6
- package/lib/index.d.ts +3 -3
- package/package.json +19 -6
package/lib/cookies.js
CHANGED
|
@@ -17,7 +17,7 @@ const sensitiveCookies = (config) => {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Redacts the contents of user-specified sensitive cookies
|
|
20
|
-
* @type {import('
|
|
20
|
+
* @type {import('@gasket/plugin-elastic-apm').filterSensitiveCookies}
|
|
21
21
|
*/
|
|
22
22
|
const filterSensitiveCookies = function (config) {
|
|
23
23
|
return function (payload) {
|
|
@@ -25,9 +25,9 @@ const filterSensitiveCookies = function (config) {
|
|
|
25
25
|
|
|
26
26
|
if (
|
|
27
27
|
payload.context &&
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
payload.context.request &&
|
|
29
|
+
payload.context.request.headers &&
|
|
30
|
+
payload.context.request.headers.cookie
|
|
31
31
|
) {
|
|
32
32
|
let cookie = payload.context.request.headers.cookie;
|
|
33
33
|
cookiesToRedact.forEach((sc) => {
|
|
@@ -41,8 +41,8 @@ const filterSensitiveCookies = function (config) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (payload.context &&
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
payload.context.request &&
|
|
45
|
+
payload.context.request.cookies
|
|
46
46
|
) {
|
|
47
47
|
cookiesToRedact.forEach((sc) => {
|
|
48
48
|
if (sc in payload.context.request.cookies) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { AgentConfigOptions, Transaction, Payload, Agent } from 'elastic-apm-node';
|
|
2
|
-
import type { GasketConfig, Plugin } from '@gasket/core';
|
|
2
|
+
import type { GasketConfig, Plugin, MaybeAsync } from '@gasket/core';
|
|
3
3
|
|
|
4
|
-
export function filterSensitiveCookies(config: GasketConfig):
|
|
4
|
+
export function filterSensitiveCookies(config: GasketConfig): (Payload) => Payload;
|
|
5
5
|
|
|
6
6
|
export interface ExtendedAgentConfigOptions extends AgentConfigOptions {
|
|
7
7
|
sensitiveCookies?: Array<string>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
declare module '@gasket/core' {
|
|
11
|
-
import { RequestLike, GasketRequest } from '@gasket/request';
|
|
11
|
+
import type { RequestLike, GasketRequest } from '@gasket/request';
|
|
12
12
|
|
|
13
13
|
export interface GasketConfig {
|
|
14
14
|
elasticAPM?: ExtendedAgentConfigOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/plugin-elastic-apm",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"description": "Adds Elastic APM instrumentation to your application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-elastic-apm",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@gasket/request": "^7.2.
|
|
40
|
+
"@gasket/request": "^7.2.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@gasket/core": "^7.2.
|
|
43
|
+
"@gasket/core": "^7.2.3",
|
|
44
44
|
"cross-env": "^7.0.3",
|
|
45
45
|
"dotenv": "^16.4.5",
|
|
46
46
|
"elastic-apm-node": "^4.4.1",
|
|
47
47
|
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-config-godaddy": "^7.1.1",
|
|
49
|
+
"eslint-config-godaddy-typescript": "^4.0.3",
|
|
49
50
|
"eslint-plugin-jest": "^28.6.0",
|
|
50
|
-
"eslint-plugin-json": "^3.1.0",
|
|
51
51
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
52
52
|
"jest": "^29.7.0",
|
|
53
53
|
"nyc": "^15.1.0",
|
|
@@ -65,10 +65,23 @@
|
|
|
65
65
|
],
|
|
66
66
|
"rules": {
|
|
67
67
|
"unicorn/filename-case": "error"
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"overrides": [
|
|
70
|
+
{
|
|
71
|
+
"files": [
|
|
72
|
+
"lib/*.ts"
|
|
73
|
+
],
|
|
74
|
+
"extends": [
|
|
75
|
+
"godaddy-typescript"
|
|
76
|
+
],
|
|
77
|
+
"rules": {
|
|
78
|
+
"jsdoc/*": "off"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
]
|
|
69
82
|
},
|
|
70
83
|
"jest": {
|
|
71
84
|
"testEnvironment": "node"
|
|
72
85
|
},
|
|
73
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "3fb21dbc6f75b8b9619a1e70073a504f84a29943"
|
|
74
87
|
}
|