@geekmidas/logger 0.1.0 → 0.3.0
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/dist/console.cjs +51 -19
- package/dist/console.cjs.map +1 -1
- package/dist/console.d.cts +16 -7
- package/dist/console.d.mts +16 -7
- package/dist/console.mjs +52 -19
- package/dist/console.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/pino.cjs +5 -66
- package/dist/pino.cjs.map +1 -1
- package/dist/pino.d.cts +1 -14
- package/dist/pino.d.mts +2 -15
- package/dist/pino.mjs +1 -62
- package/dist/pino.mjs.map +1 -1
- package/dist/redact-paths-Br-tI2GZ.d.cts +18 -0
- package/dist/redact-paths-CIsuxHH7.d.mts +18 -0
- package/dist/redact-paths-D0m0DIuQ.cjs +73 -0
- package/dist/redact-paths-D0m0DIuQ.cjs.map +1 -0
- package/dist/redact-paths-DQoIXhkS.mjs +67 -0
- package/dist/redact-paths-DQoIXhkS.mjs.map +1 -0
- package/dist/redact-paths.cjs +3 -0
- package/dist/redact-paths.d.cts +2 -0
- package/dist/redact-paths.d.mts +2 -0
- package/dist/redact-paths.mjs +3 -0
- package/dist/{types-BFiJzL9N.d.mts → types-Bga8WDuP.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +6 -1
- package/src/__tests__/console.spec.ts +255 -145
- package/src/console.ts +68 -25
- package/src/pino.ts +3 -71
- package/src/redact-paths.ts +71 -0
package/dist/pino.d.mts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import { CreateLoggerOptions } from "./types-
|
|
1
|
+
import { CreateLoggerOptions } from "./types-Bga8WDuP.mjs";
|
|
2
|
+
import { DEFAULT_REDACT_PATHS } from "./redact-paths-CIsuxHH7.mjs";
|
|
2
3
|
import * as pino0 from "pino";
|
|
3
4
|
|
|
4
5
|
//#region src/pino.d.ts
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
-
* Default sensitive field paths for redaction.
|
|
8
|
-
*
|
|
9
|
-
* These paths are automatically used when `redact: true` is set,
|
|
10
|
-
* and merged with custom paths unless `resolution: 'override'` is specified.
|
|
11
|
-
*
|
|
12
|
-
* Includes:
|
|
13
|
-
* - Authentication: password, token, apiKey, authorization, credentials
|
|
14
|
-
* - Headers: authorization, cookie, x-api-key, x-auth-token
|
|
15
|
-
* - Personal data: ssn, creditCard, cvv, pin
|
|
16
|
-
* - Secrets: secret, connectionString, databaseUrl
|
|
17
|
-
* - Wildcards: *.password, *.secret, *.token (catches nested fields)
|
|
18
|
-
*/
|
|
19
|
-
declare const DEFAULT_REDACT_PATHS: string[];
|
|
20
7
|
/**
|
|
21
8
|
* Creates a pino logger instance with optional redaction support.
|
|
22
9
|
*
|
package/dist/pino.mjs
CHANGED
|
@@ -1,69 +1,8 @@
|
|
|
1
|
+
import { DEFAULT_REDACT_PATHS } from "./redact-paths-DQoIXhkS.mjs";
|
|
1
2
|
import { pino } from "pino";
|
|
2
3
|
|
|
3
4
|
//#region src/pino.ts
|
|
4
5
|
/**
|
|
5
|
-
* Default sensitive field paths for redaction.
|
|
6
|
-
*
|
|
7
|
-
* These paths are automatically used when `redact: true` is set,
|
|
8
|
-
* and merged with custom paths unless `resolution: 'override'` is specified.
|
|
9
|
-
*
|
|
10
|
-
* Includes:
|
|
11
|
-
* - Authentication: password, token, apiKey, authorization, credentials
|
|
12
|
-
* - Headers: authorization, cookie, x-api-key, x-auth-token
|
|
13
|
-
* - Personal data: ssn, creditCard, cvv, pin
|
|
14
|
-
* - Secrets: secret, connectionString, databaseUrl
|
|
15
|
-
* - Wildcards: *.password, *.secret, *.token (catches nested fields)
|
|
16
|
-
*/
|
|
17
|
-
const DEFAULT_REDACT_PATHS = [
|
|
18
|
-
"password",
|
|
19
|
-
"pass",
|
|
20
|
-
"passwd",
|
|
21
|
-
"secret",
|
|
22
|
-
"token",
|
|
23
|
-
"accessToken",
|
|
24
|
-
"refreshToken",
|
|
25
|
-
"idToken",
|
|
26
|
-
"apiKey",
|
|
27
|
-
"api_key",
|
|
28
|
-
"apikey",
|
|
29
|
-
"auth",
|
|
30
|
-
"authorization",
|
|
31
|
-
"credential",
|
|
32
|
-
"credentials",
|
|
33
|
-
"*.password",
|
|
34
|
-
"*.secret",
|
|
35
|
-
"*.token",
|
|
36
|
-
"*.apiKey",
|
|
37
|
-
"*.api_key",
|
|
38
|
-
"*.authorization",
|
|
39
|
-
"*.accessToken",
|
|
40
|
-
"*.refreshToken",
|
|
41
|
-
"headers.authorization",
|
|
42
|
-
"headers.Authorization",
|
|
43
|
-
"headers[\"authorization\"]",
|
|
44
|
-
"headers[\"Authorization\"]",
|
|
45
|
-
"headers.cookie",
|
|
46
|
-
"headers.Cookie",
|
|
47
|
-
"headers[\"x-api-key\"]",
|
|
48
|
-
"headers[\"X-Api-Key\"]",
|
|
49
|
-
"headers[\"x-auth-token\"]",
|
|
50
|
-
"headers[\"X-Auth-Token\"]",
|
|
51
|
-
"ssn",
|
|
52
|
-
"socialSecurityNumber",
|
|
53
|
-
"social_security_number",
|
|
54
|
-
"creditCard",
|
|
55
|
-
"credit_card",
|
|
56
|
-
"cardNumber",
|
|
57
|
-
"card_number",
|
|
58
|
-
"cvv",
|
|
59
|
-
"cvc",
|
|
60
|
-
"pin",
|
|
61
|
-
"connectionString",
|
|
62
|
-
"connection_string",
|
|
63
|
-
"databaseUrl",
|
|
64
|
-
"database_url"
|
|
65
|
-
];
|
|
66
|
-
/**
|
|
67
6
|
* Resolves redaction configuration from options.
|
|
68
7
|
* Returns undefined if redaction is disabled, or a pino-compatible redact config.
|
|
69
8
|
*
|
package/dist/pino.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pino.mjs","names":["
|
|
1
|
+
{"version":3,"file":"pino.mjs","names":["redact: boolean | RedactOptions | undefined","config: PinoRedactConfig","options: CreateLoggerOptions"],"sources":["../src/pino.ts"],"sourcesContent":["/**\n * Pino logger with built-in redaction support for sensitive data.\n *\n * @example\n * ```typescript\n * import { createLogger, DEFAULT_REDACT_PATHS } from '@geekmidas/logger/pino';\n *\n * // Enable redaction with sensible defaults\n * const logger = createLogger({ redact: true });\n *\n * // Sensitive data is automatically masked\n * logger.info({ password: 'secret123', user: 'john' }, 'Login');\n * // Output: { password: '[Redacted]', user: 'john' } Login\n *\n * // Add custom paths (merged with defaults)\n * const logger2 = createLogger({ redact: ['user.ssn'] });\n *\n * // Override defaults for full control\n * const logger3 = createLogger({\n * redact: {\n * paths: ['onlyThis'],\n * resolution: 'override',\n * }\n * });\n * ```\n *\n * @module\n */\nimport { pino } from 'pino';\nimport { DEFAULT_REDACT_PATHS } from './redact-paths';\nimport type { CreateLoggerOptions, RedactOptions } from './types';\n\n// Re-export for backwards compatibility\nexport { DEFAULT_REDACT_PATHS } from './redact-paths';\n\n/**\n * Type for the resolved pino redact config (without our custom resolution field).\n */\ntype PinoRedactConfig =\n | string[]\n | {\n paths: string[];\n censor?: string | ((value: unknown, path: string[]) => unknown);\n remove?: boolean;\n };\n\n/**\n * Resolves redaction configuration from options.\n * Returns undefined if redaction is disabled, or a pino-compatible redact config.\n *\n * By default (resolution: 'merge'), custom paths are merged with DEFAULT_REDACT_PATHS.\n * With resolution: 'override', only the custom paths are used.\n */\nfunction resolveRedactConfig(\n redact: boolean | RedactOptions | undefined,\n): PinoRedactConfig | undefined {\n if (redact === undefined || redact === false) {\n return undefined;\n }\n\n if (redact === true) {\n return DEFAULT_REDACT_PATHS;\n }\n\n // Array syntax - merge with defaults\n if (Array.isArray(redact)) {\n return [...DEFAULT_REDACT_PATHS, ...redact];\n }\n\n // Object syntax - check resolution mode\n const { resolution = 'merge', paths, censor, remove } = redact;\n\n const resolvedPaths =\n resolution === 'override' ? paths : [...DEFAULT_REDACT_PATHS, ...paths];\n\n // Return clean pino config without our resolution field\n const config: PinoRedactConfig = { paths: resolvedPaths };\n if (censor !== undefined) config.censor = censor;\n if (remove !== undefined) config.remove = remove;\n\n return config;\n}\n\n/**\n * Creates a pino logger instance with optional redaction support.\n *\n * @param options - Logger configuration options\n * @returns A configured pino logger instance\n *\n * @example\n * ```typescript\n * // Basic logger\n * const logger = createLogger({ level: 'debug' });\n *\n * // With redaction enabled\n * const secureLogger = createLogger({ redact: true });\n *\n * // Pretty printing in development\n * const devLogger = createLogger({ pretty: true, redact: true });\n * ```\n */\nexport function createLogger(options: CreateLoggerOptions = {}) {\n // @ts-ignore\n const pretty = options?.pretty && process.NODE_ENV !== 'production';\n const baseOptions = pretty\n ? {\n transport: {\n target: 'pino-pretty',\n options: { colorize: true },\n },\n }\n : {};\n\n const redact = resolveRedactConfig(options.redact);\n\n return pino({\n ...baseOptions,\n ...(options.level && { level: options.level }),\n ...(redact && { redact }),\n formatters: {\n bindings() {\n return { nodeVersion: process.version };\n },\n level: (label) => {\n return { level: label.toUpperCase() };\n },\n },\n });\n}\n"],"mappings":";;;;;;;;;;;AAqDA,SAAS,oBACPA,QAC8B;AAC9B,KAAI,qBAAwB,WAAW,MACrC;AAGF,KAAI,WAAW,KACb,QAAO;AAIT,KAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,CAAC,GAAG,sBAAsB,GAAG,MAAO;CAI7C,MAAM,EAAE,aAAa,SAAS,OAAO,QAAQ,QAAQ,GAAG;CAExD,MAAM,gBACJ,eAAe,aAAa,QAAQ,CAAC,GAAG,sBAAsB,GAAG,KAAM;CAGzE,MAAMC,SAA2B,EAAE,OAAO,cAAe;AACzD,KAAI,kBAAsB,QAAO,SAAS;AAC1C,KAAI,kBAAsB,QAAO,SAAS;AAE1C,QAAO;AACR;;;;;;;;;;;;;;;;;;;AAoBD,SAAgB,aAAaC,UAA+B,CAAE,GAAE;CAE9D,MAAM,SAAS,SAAS,UAAU,QAAQ,aAAa;CACvD,MAAM,cAAc,SAChB,EACE,WAAW;EACT,QAAQ;EACR,SAAS,EAAE,UAAU,KAAM;CAC5B,EACF,IACD,CAAE;CAEN,MAAM,SAAS,oBAAoB,QAAQ,OAAO;AAElD,QAAO,KAAK;EACV,GAAG;EACH,GAAI,QAAQ,SAAS,EAAE,OAAO,QAAQ,MAAO;EAC7C,GAAI,UAAU,EAAE,OAAQ;EACxB,YAAY;GACV,WAAW;AACT,WAAO,EAAE,aAAa,QAAQ,QAAS;GACxC;GACD,OAAO,CAAC,UAAU;AAChB,WAAO,EAAE,OAAO,MAAM,aAAa,CAAE;GACtC;EACF;CACF,EAAC;AACH"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/redact-paths.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Default sensitive field paths for redaction.
|
|
4
|
+
*
|
|
5
|
+
* These paths are automatically used when `redact: true` is set,
|
|
6
|
+
* and merged with custom paths unless `resolution: 'override'` is specified.
|
|
7
|
+
*
|
|
8
|
+
* Includes:
|
|
9
|
+
* - Authentication: password, token, apiKey, authorization, credentials
|
|
10
|
+
* - Headers: authorization, cookie, x-api-key, x-auth-token
|
|
11
|
+
* - Personal data: ssn, creditCard, cvv, pin
|
|
12
|
+
* - Secrets: secret, connectionString, databaseUrl
|
|
13
|
+
* - Wildcards: *.password, *.secret, *.token (catches nested fields)
|
|
14
|
+
*/
|
|
15
|
+
declare const DEFAULT_REDACT_PATHS: string[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DEFAULT_REDACT_PATHS };
|
|
18
|
+
//# sourceMappingURL=redact-paths-Br-tI2GZ.d.cts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/redact-paths.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Default sensitive field paths for redaction.
|
|
4
|
+
*
|
|
5
|
+
* These paths are automatically used when `redact: true` is set,
|
|
6
|
+
* and merged with custom paths unless `resolution: 'override'` is specified.
|
|
7
|
+
*
|
|
8
|
+
* Includes:
|
|
9
|
+
* - Authentication: password, token, apiKey, authorization, credentials
|
|
10
|
+
* - Headers: authorization, cookie, x-api-key, x-auth-token
|
|
11
|
+
* - Personal data: ssn, creditCard, cvv, pin
|
|
12
|
+
* - Secrets: secret, connectionString, databaseUrl
|
|
13
|
+
* - Wildcards: *.password, *.secret, *.token (catches nested fields)
|
|
14
|
+
*/
|
|
15
|
+
declare const DEFAULT_REDACT_PATHS: string[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DEFAULT_REDACT_PATHS };
|
|
18
|
+
//# sourceMappingURL=redact-paths-CIsuxHH7.d.mts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/redact-paths.ts
|
|
3
|
+
/**
|
|
4
|
+
* Default sensitive field paths for redaction.
|
|
5
|
+
*
|
|
6
|
+
* These paths are automatically used when `redact: true` is set,
|
|
7
|
+
* and merged with custom paths unless `resolution: 'override'` is specified.
|
|
8
|
+
*
|
|
9
|
+
* Includes:
|
|
10
|
+
* - Authentication: password, token, apiKey, authorization, credentials
|
|
11
|
+
* - Headers: authorization, cookie, x-api-key, x-auth-token
|
|
12
|
+
* - Personal data: ssn, creditCard, cvv, pin
|
|
13
|
+
* - Secrets: secret, connectionString, databaseUrl
|
|
14
|
+
* - Wildcards: *.password, *.secret, *.token (catches nested fields)
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_REDACT_PATHS = [
|
|
17
|
+
"password",
|
|
18
|
+
"pass",
|
|
19
|
+
"passwd",
|
|
20
|
+
"secret",
|
|
21
|
+
"token",
|
|
22
|
+
"accessToken",
|
|
23
|
+
"refreshToken",
|
|
24
|
+
"idToken",
|
|
25
|
+
"apiKey",
|
|
26
|
+
"api_key",
|
|
27
|
+
"apikey",
|
|
28
|
+
"auth",
|
|
29
|
+
"authorization",
|
|
30
|
+
"credential",
|
|
31
|
+
"credentials",
|
|
32
|
+
"*.password",
|
|
33
|
+
"*.secret",
|
|
34
|
+
"*.token",
|
|
35
|
+
"*.apiKey",
|
|
36
|
+
"*.api_key",
|
|
37
|
+
"*.authorization",
|
|
38
|
+
"*.accessToken",
|
|
39
|
+
"*.refreshToken",
|
|
40
|
+
"headers.authorization",
|
|
41
|
+
"headers.Authorization",
|
|
42
|
+
"headers[\"authorization\"]",
|
|
43
|
+
"headers[\"Authorization\"]",
|
|
44
|
+
"headers.cookie",
|
|
45
|
+
"headers.Cookie",
|
|
46
|
+
"headers[\"x-api-key\"]",
|
|
47
|
+
"headers[\"X-Api-Key\"]",
|
|
48
|
+
"headers[\"x-auth-token\"]",
|
|
49
|
+
"headers[\"X-Auth-Token\"]",
|
|
50
|
+
"ssn",
|
|
51
|
+
"socialSecurityNumber",
|
|
52
|
+
"social_security_number",
|
|
53
|
+
"creditCard",
|
|
54
|
+
"credit_card",
|
|
55
|
+
"cardNumber",
|
|
56
|
+
"card_number",
|
|
57
|
+
"cvv",
|
|
58
|
+
"cvc",
|
|
59
|
+
"pin",
|
|
60
|
+
"connectionString",
|
|
61
|
+
"connection_string",
|
|
62
|
+
"databaseUrl",
|
|
63
|
+
"database_url"
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
Object.defineProperty(exports, 'DEFAULT_REDACT_PATHS', {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return DEFAULT_REDACT_PATHS;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=redact-paths-D0m0DIuQ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-paths-D0m0DIuQ.cjs","names":["DEFAULT_REDACT_PATHS: string[]"],"sources":["../src/redact-paths.ts"],"sourcesContent":["/**\n * Default sensitive field paths for redaction.\n *\n * These paths are automatically used when `redact: true` is set,\n * and merged with custom paths unless `resolution: 'override'` is specified.\n *\n * Includes:\n * - Authentication: password, token, apiKey, authorization, credentials\n * - Headers: authorization, cookie, x-api-key, x-auth-token\n * - Personal data: ssn, creditCard, cvv, pin\n * - Secrets: secret, connectionString, databaseUrl\n * - Wildcards: *.password, *.secret, *.token (catches nested fields)\n */\nexport const DEFAULT_REDACT_PATHS: string[] = [\n // Authentication & authorization\n 'password',\n 'pass',\n 'passwd',\n 'secret',\n 'token',\n 'accessToken',\n 'refreshToken',\n 'idToken',\n 'apiKey',\n 'api_key',\n 'apikey',\n 'auth',\n 'authorization',\n 'credential',\n 'credentials',\n\n // Common nested patterns (headers, body, etc.)\n '*.password',\n '*.secret',\n '*.token',\n '*.apiKey',\n '*.api_key',\n '*.authorization',\n '*.accessToken',\n '*.refreshToken',\n\n // HTTP headers (case variations)\n 'headers.authorization',\n 'headers.Authorization',\n 'headers[\"authorization\"]',\n 'headers[\"Authorization\"]',\n 'headers.cookie',\n 'headers.Cookie',\n 'headers[\"x-api-key\"]',\n 'headers[\"X-Api-Key\"]',\n 'headers[\"x-auth-token\"]',\n 'headers[\"X-Auth-Token\"]',\n\n // Common sensitive data fields\n 'ssn',\n 'socialSecurityNumber',\n 'social_security_number',\n 'creditCard',\n 'credit_card',\n 'cardNumber',\n 'card_number',\n 'cvv',\n 'cvc',\n 'pin',\n\n // Database & connection strings\n 'connectionString',\n 'connection_string',\n 'databaseUrl',\n 'database_url',\n];\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAaA,uBAAiC;CAE5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;AACD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region src/redact-paths.ts
|
|
2
|
+
/**
|
|
3
|
+
* Default sensitive field paths for redaction.
|
|
4
|
+
*
|
|
5
|
+
* These paths are automatically used when `redact: true` is set,
|
|
6
|
+
* and merged with custom paths unless `resolution: 'override'` is specified.
|
|
7
|
+
*
|
|
8
|
+
* Includes:
|
|
9
|
+
* - Authentication: password, token, apiKey, authorization, credentials
|
|
10
|
+
* - Headers: authorization, cookie, x-api-key, x-auth-token
|
|
11
|
+
* - Personal data: ssn, creditCard, cvv, pin
|
|
12
|
+
* - Secrets: secret, connectionString, databaseUrl
|
|
13
|
+
* - Wildcards: *.password, *.secret, *.token (catches nested fields)
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_REDACT_PATHS = [
|
|
16
|
+
"password",
|
|
17
|
+
"pass",
|
|
18
|
+
"passwd",
|
|
19
|
+
"secret",
|
|
20
|
+
"token",
|
|
21
|
+
"accessToken",
|
|
22
|
+
"refreshToken",
|
|
23
|
+
"idToken",
|
|
24
|
+
"apiKey",
|
|
25
|
+
"api_key",
|
|
26
|
+
"apikey",
|
|
27
|
+
"auth",
|
|
28
|
+
"authorization",
|
|
29
|
+
"credential",
|
|
30
|
+
"credentials",
|
|
31
|
+
"*.password",
|
|
32
|
+
"*.secret",
|
|
33
|
+
"*.token",
|
|
34
|
+
"*.apiKey",
|
|
35
|
+
"*.api_key",
|
|
36
|
+
"*.authorization",
|
|
37
|
+
"*.accessToken",
|
|
38
|
+
"*.refreshToken",
|
|
39
|
+
"headers.authorization",
|
|
40
|
+
"headers.Authorization",
|
|
41
|
+
"headers[\"authorization\"]",
|
|
42
|
+
"headers[\"Authorization\"]",
|
|
43
|
+
"headers.cookie",
|
|
44
|
+
"headers.Cookie",
|
|
45
|
+
"headers[\"x-api-key\"]",
|
|
46
|
+
"headers[\"X-Api-Key\"]",
|
|
47
|
+
"headers[\"x-auth-token\"]",
|
|
48
|
+
"headers[\"X-Auth-Token\"]",
|
|
49
|
+
"ssn",
|
|
50
|
+
"socialSecurityNumber",
|
|
51
|
+
"social_security_number",
|
|
52
|
+
"creditCard",
|
|
53
|
+
"credit_card",
|
|
54
|
+
"cardNumber",
|
|
55
|
+
"card_number",
|
|
56
|
+
"cvv",
|
|
57
|
+
"cvc",
|
|
58
|
+
"pin",
|
|
59
|
+
"connectionString",
|
|
60
|
+
"connection_string",
|
|
61
|
+
"databaseUrl",
|
|
62
|
+
"database_url"
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { DEFAULT_REDACT_PATHS };
|
|
67
|
+
//# sourceMappingURL=redact-paths-DQoIXhkS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-paths-DQoIXhkS.mjs","names":["DEFAULT_REDACT_PATHS: string[]"],"sources":["../src/redact-paths.ts"],"sourcesContent":["/**\n * Default sensitive field paths for redaction.\n *\n * These paths are automatically used when `redact: true` is set,\n * and merged with custom paths unless `resolution: 'override'` is specified.\n *\n * Includes:\n * - Authentication: password, token, apiKey, authorization, credentials\n * - Headers: authorization, cookie, x-api-key, x-auth-token\n * - Personal data: ssn, creditCard, cvv, pin\n * - Secrets: secret, connectionString, databaseUrl\n * - Wildcards: *.password, *.secret, *.token (catches nested fields)\n */\nexport const DEFAULT_REDACT_PATHS: string[] = [\n // Authentication & authorization\n 'password',\n 'pass',\n 'passwd',\n 'secret',\n 'token',\n 'accessToken',\n 'refreshToken',\n 'idToken',\n 'apiKey',\n 'api_key',\n 'apikey',\n 'auth',\n 'authorization',\n 'credential',\n 'credentials',\n\n // Common nested patterns (headers, body, etc.)\n '*.password',\n '*.secret',\n '*.token',\n '*.apiKey',\n '*.api_key',\n '*.authorization',\n '*.accessToken',\n '*.refreshToken',\n\n // HTTP headers (case variations)\n 'headers.authorization',\n 'headers.Authorization',\n 'headers[\"authorization\"]',\n 'headers[\"Authorization\"]',\n 'headers.cookie',\n 'headers.Cookie',\n 'headers[\"x-api-key\"]',\n 'headers[\"X-Api-Key\"]',\n 'headers[\"x-auth-token\"]',\n 'headers[\"X-Auth-Token\"]',\n\n // Common sensitive data fields\n 'ssn',\n 'socialSecurityNumber',\n 'social_security_number',\n 'creditCard',\n 'credit_card',\n 'cardNumber',\n 'card_number',\n 'cvv',\n 'cvc',\n 'pin',\n\n // Database & connection strings\n 'connectionString',\n 'connection_string',\n 'databaseUrl',\n 'database_url',\n];\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAaA,uBAAiC;CAE5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;AACD"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types-
|
|
1
|
+
import { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions } from "./types-Bga8WDuP.mjs";
|
|
2
2
|
export { CreateLoggerOptions, LogFn, LogLevel, Logger, RedactOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/logger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A simple and flexible logging library for Node.js and the browser",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"types": "./dist/console.d.ts",
|
|
20
20
|
"import": "./dist/console.mjs",
|
|
21
21
|
"require": "./dist/console.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./redact": {
|
|
24
|
+
"types": "./dist/redact-paths.d.ts",
|
|
25
|
+
"import": "./dist/redact-paths.mjs",
|
|
26
|
+
"require": "./dist/redact-paths.cjs"
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
"repository": {
|