@groundbrick/logger 0.5.0 → 0.5.1
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/README.md +22 -0
- package/dist/privacy.d.ts +61 -0
- package/dist/privacy.d.ts.map +1 -0
- package/dist/privacy.js +131 -0
- package/dist/privacy.js.map +1 -0
- package/package.json +17 -3
package/README.md
CHANGED
|
@@ -222,6 +222,28 @@ export class BaseService {
|
|
|
222
222
|
}
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
+
## Privacy (`@groundbrick/logger/privacy`)
|
|
226
|
+
|
|
227
|
+
Dependency-free helpers (safe in the browser) that keep personal data and
|
|
228
|
+
secrets out of error/trace reports. Used by the Sentry integrations of
|
|
229
|
+
`@groundbrick/express-adapter` and `@groundbrick/sveltekit-adapter`.
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
import { redactPersonalData, redactValue, scrubTelemetryEvent } from '@groundbrick/logger/privacy';
|
|
233
|
+
|
|
234
|
+
redactPersonalData('Recipient maria@example.com rejected (+351 912 345 678)');
|
|
235
|
+
// 'Recipient [email] rejected ([phone])'
|
|
236
|
+
|
|
237
|
+
redactValue({ taskId: 5, payload: { to: 'maria@example.com', body: 'OTP 123456' } });
|
|
238
|
+
// { taskId: 5, payload: { to: '[filtered]', body: '[filtered]' } }
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
- `redactPersonalData(text)` masks e-mails, phone numbers, bot tokens and URL query strings.
|
|
242
|
+
- `redactValue(value)` filters secret/personal keys at any depth and masks every string.
|
|
243
|
+
- `scrubTelemetryEvent`, `scrubTelemetryBreadcrumb`, `scrubTelemetryLog` apply both to a
|
|
244
|
+
Sentry-shaped event (`beforeSend`, `beforeBreadcrumb`, `beforeSendLog`): request bodies,
|
|
245
|
+
cookies and query strings are removed, auth headers masked, console breadcrumbs dropped.
|
|
246
|
+
|
|
225
247
|
## API Reference
|
|
226
248
|
|
|
227
249
|
### Logger Interface
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Personal data and secrets must not leave the application inside error or
|
|
3
|
+
* trace reports (Sentry and alike). This module is dependency free and safe in
|
|
4
|
+
* the browser: it is exported as `@groundbrick/logger/privacy`, apart from the
|
|
5
|
+
* logger itself, so client bundles do not pull the Node-only outputs.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Masks e-mail addresses, phone numbers, bot tokens and URL query strings in
|
|
9
|
+
* free text (error messages, log lines, URLs).
|
|
10
|
+
*/
|
|
11
|
+
export declare function redactPersonalData(text: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Copy of a value with sensitive keys replaced and personal data masked in
|
|
14
|
+
* every string, at any depth.
|
|
15
|
+
*/
|
|
16
|
+
export declare function redactValue(value: unknown, depth?: number): unknown;
|
|
17
|
+
/** Minimal shape of an error/transaction event (Sentry's `@sentry/core` Event). */
|
|
18
|
+
export interface TelemetryEvent {
|
|
19
|
+
message?: string;
|
|
20
|
+
transaction?: string;
|
|
21
|
+
request?: {
|
|
22
|
+
url?: string;
|
|
23
|
+
data?: unknown;
|
|
24
|
+
cookies?: unknown;
|
|
25
|
+
query_string?: unknown;
|
|
26
|
+
headers?: Record<string, string>;
|
|
27
|
+
};
|
|
28
|
+
exception?: {
|
|
29
|
+
values?: Array<{
|
|
30
|
+
value?: string;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
extra?: Record<string, unknown>;
|
|
34
|
+
contexts?: Record<string, unknown>;
|
|
35
|
+
breadcrumbs?: TelemetryBreadcrumb[];
|
|
36
|
+
spans?: Array<{
|
|
37
|
+
description?: string;
|
|
38
|
+
data?: Record<string, unknown>;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export interface TelemetryBreadcrumb {
|
|
42
|
+
category?: string;
|
|
43
|
+
message?: string;
|
|
44
|
+
data?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Removes request bodies, cookies and query strings, masks auth headers and
|
|
48
|
+
* personal data. Mutates and returns the event (Sentry `beforeSend` style).
|
|
49
|
+
*/
|
|
50
|
+
export declare function scrubTelemetryEvent<T extends TelemetryEvent>(event: T): T;
|
|
51
|
+
/**
|
|
52
|
+
* Console breadcrumbs are raw log lines (subjects, codes, recipients): they are
|
|
53
|
+
* dropped (null) instead of partially masked. Others are masked.
|
|
54
|
+
*/
|
|
55
|
+
export declare function scrubTelemetryBreadcrumb<T extends TelemetryBreadcrumb>(crumb: T): T | null;
|
|
56
|
+
/** Structured log record (Sentry `beforeSendLog`). */
|
|
57
|
+
export declare function scrubTelemetryLog<T extends {
|
|
58
|
+
message?: unknown;
|
|
59
|
+
attributes?: Record<string, unknown>;
|
|
60
|
+
}>(log: T): T;
|
|
61
|
+
//# sourceMappingURL=privacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../src/privacy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,OAAO,CAc9D;AAED,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACpC,CAAC;IACF,SAAS,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,KAAK,CAAC;YAAE,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC3E;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAiCzE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,mBAAmB,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAiB1F;AAED,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EACnG,GAAG,EAAE,CAAC,GACP,CAAC,CAIH"}
|
package/dist/privacy.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Personal data and secrets must not leave the application inside error or
|
|
3
|
+
* trace reports (Sentry and alike). This module is dependency free and safe in
|
|
4
|
+
* the browser: it is exported as `@groundbrick/logger/privacy`, apart from the
|
|
5
|
+
* logger itself, so client bundles do not pull the Node-only outputs.
|
|
6
|
+
*/
|
|
7
|
+
const EMAIL_PATTERN = /[\w.+-]+@[\w-]+(\.[\w-]+)+/g;
|
|
8
|
+
const PHONE_PATTERN = /\+?\d[\d\s().-]{7,}\d/g;
|
|
9
|
+
const DATE_PREFIX = /^\d{4}-\d{2}-\d{2}/;
|
|
10
|
+
// Bot API style tokens travel in the path (e.g. api.telegram.org/bot<token>/...).
|
|
11
|
+
const BOT_TOKEN_PATTERN = /\/bot[^/\s]+/g;
|
|
12
|
+
// Query strings often carry tokens (password reset, callbacks, OAuth codes).
|
|
13
|
+
const URL_QUERY_PATTERN = /(https?:\/\/[^\s?#]+)\?[^\s#]*/g;
|
|
14
|
+
const PATH_QUERY_PATTERN = /^(\/[^\s?#]*)\?[^\s#]*/;
|
|
15
|
+
// Keys whose values are secrets or personal data, at any depth.
|
|
16
|
+
const SENSITIVE_KEY_PATTERN = /pass|senha|secret|token|authorization|cookie|api[-_]?key|^(email|e-mail|phone|telefone|telemovel|mobile|to|cc|bcc|recipients?|destination|body|html)$/i;
|
|
17
|
+
const SENSITIVE_HEADERS = /^(authorization|cookie|set-cookie|x-api-key|proxy-authorization)$/i;
|
|
18
|
+
const FILTERED = '[filtered]';
|
|
19
|
+
const MAX_DEPTH = 8;
|
|
20
|
+
/**
|
|
21
|
+
* Masks e-mail addresses, phone numbers, bot tokens and URL query strings in
|
|
22
|
+
* free text (error messages, log lines, URLs).
|
|
23
|
+
*/
|
|
24
|
+
export function redactPersonalData(text) {
|
|
25
|
+
return text
|
|
26
|
+
.replace(BOT_TOKEN_PATTERN, '/bot[token]')
|
|
27
|
+
.replace(URL_QUERY_PATTERN, `$1?${FILTERED}`)
|
|
28
|
+
.replace(PATH_QUERY_PATTERN, `$1?${FILTERED}`)
|
|
29
|
+
.replace(EMAIL_PATTERN, '[email]')
|
|
30
|
+
.replace(PHONE_PATTERN, (match) => {
|
|
31
|
+
const digits = match.replace(/\D/g, '');
|
|
32
|
+
// Short numbers (ids, ports) and dates are kept.
|
|
33
|
+
return digits.length >= 9 && !DATE_PREFIX.test(match) ? '[phone]' : match;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Copy of a value with sensitive keys replaced and personal data masked in
|
|
38
|
+
* every string, at any depth.
|
|
39
|
+
*/
|
|
40
|
+
export function redactValue(value, depth = 0) {
|
|
41
|
+
if (depth > MAX_DEPTH)
|
|
42
|
+
return FILTERED;
|
|
43
|
+
if (typeof value === 'string')
|
|
44
|
+
return redactPersonalData(value);
|
|
45
|
+
if (Array.isArray(value))
|
|
46
|
+
return value.map((item) => redactValue(item, depth + 1));
|
|
47
|
+
const proto = value && typeof value === 'object' ? Object.getPrototypeOf(value) : undefined;
|
|
48
|
+
if (proto === Object.prototype || proto === null) {
|
|
49
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [
|
|
50
|
+
key,
|
|
51
|
+
SENSITIVE_KEY_PATTERN.test(key) ? FILTERED : redactValue(item, depth + 1),
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Removes request bodies, cookies and query strings, masks auth headers and
|
|
58
|
+
* personal data. Mutates and returns the event (Sentry `beforeSend` style).
|
|
59
|
+
*/
|
|
60
|
+
export function scrubTelemetryEvent(event) {
|
|
61
|
+
if (event.request) {
|
|
62
|
+
delete event.request.data;
|
|
63
|
+
delete event.request.cookies;
|
|
64
|
+
delete event.request.query_string;
|
|
65
|
+
if (event.request.url)
|
|
66
|
+
event.request.url = redactPersonalData(event.request.url);
|
|
67
|
+
if (event.request.headers) {
|
|
68
|
+
for (const header of Object.keys(event.request.headers)) {
|
|
69
|
+
if (SENSITIVE_HEADERS.test(header))
|
|
70
|
+
event.request.headers[header] = FILTERED;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (event.message)
|
|
75
|
+
event.message = redactPersonalData(event.message);
|
|
76
|
+
if (event.transaction)
|
|
77
|
+
event.transaction = redactPersonalData(event.transaction);
|
|
78
|
+
for (const exception of event.exception?.values ?? []) {
|
|
79
|
+
if (exception.value)
|
|
80
|
+
exception.value = redactPersonalData(exception.value);
|
|
81
|
+
}
|
|
82
|
+
if (event.extra)
|
|
83
|
+
event.extra = redactValue(event.extra);
|
|
84
|
+
if (event.contexts)
|
|
85
|
+
event.contexts = redactValue(event.contexts);
|
|
86
|
+
if (event.breadcrumbs) {
|
|
87
|
+
event.breadcrumbs = event.breadcrumbs
|
|
88
|
+
.map((crumb) => scrubTelemetryBreadcrumb(crumb))
|
|
89
|
+
.filter((crumb) => crumb !== null);
|
|
90
|
+
}
|
|
91
|
+
if (event.spans) {
|
|
92
|
+
for (const span of event.spans) {
|
|
93
|
+
if (span.description)
|
|
94
|
+
span.description = redactPersonalData(span.description);
|
|
95
|
+
if (span.data)
|
|
96
|
+
span.data = redactValue(span.data);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return event;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Console breadcrumbs are raw log lines (subjects, codes, recipients): they are
|
|
103
|
+
* dropped (null) instead of partially masked. Others are masked.
|
|
104
|
+
*/
|
|
105
|
+
export function scrubTelemetryBreadcrumb(crumb) {
|
|
106
|
+
if (crumb.category === 'console')
|
|
107
|
+
return null;
|
|
108
|
+
if (crumb.message)
|
|
109
|
+
crumb.message = redactPersonalData(crumb.message);
|
|
110
|
+
if (crumb.data) {
|
|
111
|
+
// Navigation breadcrumbs keep their from/to paths (only masked): the
|
|
112
|
+
// key filter would drop `to`, which is the useful part.
|
|
113
|
+
crumb.data =
|
|
114
|
+
crumb.category === 'navigation'
|
|
115
|
+
? Object.fromEntries(Object.entries(crumb.data).map(([key, value]) => [
|
|
116
|
+
key,
|
|
117
|
+
typeof value === 'string' ? redactPersonalData(value) : value,
|
|
118
|
+
]))
|
|
119
|
+
: redactValue(crumb.data);
|
|
120
|
+
}
|
|
121
|
+
return crumb;
|
|
122
|
+
}
|
|
123
|
+
/** Structured log record (Sentry `beforeSendLog`). */
|
|
124
|
+
export function scrubTelemetryLog(log) {
|
|
125
|
+
if (typeof log.message === 'string')
|
|
126
|
+
log.message = redactPersonalData(log.message);
|
|
127
|
+
if (log.attributes)
|
|
128
|
+
log.attributes = redactValue(log.attributes);
|
|
129
|
+
return log;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=privacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy.js","sourceRoot":"","sources":["../src/privacy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,aAAa,GAAG,6BAA6B,CAAC;AACpD,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,WAAW,GAAG,oBAAoB,CAAC;AACzC,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC1C,6EAA6E;AAC7E,MAAM,iBAAiB,GAAG,iCAAiC,CAAC;AAC5D,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAEpD,gEAAgE;AAChE,MAAM,qBAAqB,GACvB,wJAAwJ,CAAC;AAC7J,MAAM,iBAAiB,GAAG,oEAAoE,CAAC;AAE/F,MAAM,QAAQ,GAAG,YAAY,CAAC;AAC9B,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC3C,OAAO,IAAI;SACN,OAAO,CAAC,iBAAiB,EAAE,aAAa,CAAC;SACzC,OAAO,CAAC,iBAAiB,EAAE,MAAM,QAAQ,EAAE,CAAC;SAC5C,OAAO,CAAC,kBAAkB,EAAE,MAAM,QAAQ,EAAE,CAAC;SAC7C,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;SACjC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;QAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxC,i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AAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;iBAChE,CAAC,CACuB;gBAC/B,CAAC,CAAE,WAAW,CAAC,KAAK,CAAC,IAAI,CAA6B,CAAC;IACnE,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,iBAAiB,CAC7B,GAAM;IAEN,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;QAAE,GAAG,CAAC,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACnF,IAAI,GAAG,CAAC,UAAU;QAAE,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAA4B,CAAC;IAC5F,OAAO,GAAG,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groundbrick/logger",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Structured logging with multiple outputs and performance timing for TypeScript applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"require": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./privacy": {
|
|
16
|
+
"import": "./dist/privacy.js",
|
|
17
|
+
"require": "./dist/privacy.js",
|
|
18
|
+
"types": "./dist/privacy.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"privacy": [
|
|
24
|
+
"./dist/privacy.d.ts"
|
|
25
|
+
]
|
|
14
26
|
}
|
|
15
27
|
},
|
|
16
28
|
"files": [
|
|
@@ -40,7 +52,8 @@
|
|
|
40
52
|
"homepage": "https://github.com/200Systems/bitbrick-microframework/tree/main/packages/logger#readme",
|
|
41
53
|
"devDependencies": {
|
|
42
54
|
"@types/node": "^20.19.8",
|
|
43
|
-
"typescript": "^5.8.3"
|
|
55
|
+
"typescript": "^5.8.3",
|
|
56
|
+
"vitest": "^2.0.0"
|
|
44
57
|
},
|
|
45
58
|
"engines": {
|
|
46
59
|
"node": ">=18.0.0"
|
|
@@ -51,6 +64,7 @@
|
|
|
51
64
|
"scripts": {
|
|
52
65
|
"build": "tsc",
|
|
53
66
|
"dev": "tsc --watch",
|
|
54
|
-
"clean": "rm -rf dist *.tsbuildinfo"
|
|
67
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
68
|
+
"test": "vitest run"
|
|
55
69
|
}
|
|
56
70
|
}
|