Files
apartment-dashboard-api/__tests__
Stephen Minakian d14bd724ed
All checks were successful
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 14s
CI/CD Pipeline - Apartment API / Run Tests (pull_request) Successful in 9m45s
CI/CD Pipeline - Apartment API / Build & Push Image (pull_request) Has been skipped
CI/CD Pipeline - Apartment API / Deploy to Production (pull_request) Has been skipped
Add scraperLogger.js with credential redaction
Implement structured JSON logging module for the scraper service:
- createLogger(jobId) factory function for job-scoped logging
- info(), warn(), error() methods with consistent JSON output
- Automatic redaction of MongoDB connection string credentials
- Redaction of sensitive keys (password, secret, token, apikey, authorization)
- Message truncation to prevent log bloat (1000 char limit)
- Circular reference handling
- Buffer object representation as [Buffer: N bytes]

Includes comprehensive test suite with 35 test cases covering:
- Log entry format validation (timestamp, level, message, jobId, context)
- MongoDB URI redaction for both mongodb:// and mongodb+srv://
- Sensitive key redaction
- Edge cases (null, undefined, nested objects, arrays)
- Buffer and circular reference handling
2026-01-28 00:29:14 -07:00
..