UNPKG

@crowdin/app-project-module

Version:

Module that generates for you all common endpoints for serving standalone Crowdin App

19 lines (18 loc) 1.07 kB
/** * Masks JWTs, bearer tokens, passwords, API keys, and other secrets in log records * before they leave the process (stdout / Sentry). Registered with @crowdin/logs-formatter * at SDK bootstrap so every Crowdin app built on this SDK benefits without per-app changes. * * NOTE: a separate field-value masker lives at src/util/credentials-masker.ts (maskKey) — * it masks ALL but last 3 chars with '*', operates on form-data fields, and is wired into * request/response middleware. The two are intentionally distinct: this sanitizer uses * "first 4 chars + ***" on log records, and the field masker uses "***...XYZ" on form * payloads. Do not mix them. */ import type { LogRecord, Sanitizer } from '@crowdin/logs-formatter'; export type { LogRecord, Sanitizer }; export declare const MASK_PLACEHOLDER = "***"; export declare function maskString(input: string): string; export declare function maskUrl(url: string): string; export declare function sanitizeValue(value: unknown): unknown; export declare function crowdinLogSanitizer(record: LogRecord): LogRecord;