Replace raw `console.log` and unstructured `Logger.log` string interpolation with structured, redacted logging
@ravimahatonp ci sta già lavorando.
Dal 9/10/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- aws, nodejs, typescript
- Ambito
- observability, security
Direzione di ricerca
Start in src/logging/, which holds the logger the redaction wrapper would sit in, then read the object-payload example in cache-warming.service.ts around lines 59-62 as the style to match. Find the interpolated call in src/blockchain/oracle/services/submitter.service.ts around lines 243-244 and the console.* call in database-index.service.ts near line 117. Done means a test asserting that password, privateKey and token keys are masked, no console.* outside specs, and the policy written in CONTRIBUTING.md. Check with the maintainers first, since the issue asks to coordinate with the logging-facade issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Logging is not consistently structured, and there is no evidence of a redaction policy. Two concrete issues:
- Six raw
console.*calls remain insrc/— one is insrc/common/database/database-index.service.ts:117, which logs index names immediately after building SQL from interpolated identifiers. - Controllers use string interpolation, e.g.
src/blockchain/oracle/services/submitter.service.ts:243-244:
while services use structured object payloads (e.g.this.logger.log( `Submitting payload ${payloadId} with gas limit ${gasLimit} (attempt ${attempt})`, );cache-warming.service.ts:59-62). Interpolated strings cannot be filtered by field in CloudWatch, so an operator cannot querypayloadId=Xwithout a full-text grep.
The risk is what gets interpolated. The codebase handles credentials, tokens, wallet signatures, API keys (.env.secrets.template), and wallet private keys — and the README instructs operators to "store signing keys in a KMS" (line 243). Any of those reaching a log line is a disclosure, and logs are commonly shipped to third parties (CloudWatch is configured in package.json).
Why it matters
This is a real and common source of credential leakage. The relevant question for each log site is what values it interpolates — and today that is not answerable by inspection, because there is no convention and no redaction layer.
Note the related issue on plaintext refresh tokens: an adjacent leak path. Fixing one and not the other leaves the same risk open.
Suggested Direction
- Adopt one structured call style, matching what already exists:
Object payload plus a static message. Never interpolate values into the message string.this.logger.log({ payloadId, gasLimit: gasLimit.toString(), attempt }, 'Submitting payload'); - Add a redaction layer at the logger, not per call site. A wrapper that walks the payload and masks keys matching a denylist —
password,token,secret,privateKey,authorization,signature,mnemonic,seed— is far more reliable than relying on every developer to remember.src/logging/(14 files) is the natural home. - Audit the existing call sites for values that should never be logged, starting with the auth and oracle paths.
- Replace the six
console.*calls with the configured logger. - Document the redaction policy in
CONTRIBUTING.mdso new call sites follow it.
Constraints
- Never log secret values, even temporarily — including in error paths. Check
catchblocks carefully, since they are the most likely place to dump a whole object. - Preserve log levels; do not demote an
errortologto reduce noise. - Redaction must not break structured querying — mask values, keep keys, so an operator can still filter on which key appeared.
- Coordinate with the logging-facade issue so redaction lands in the single chosen implementation.
Acceptance Criteria
- A redaction layer masks configured sensitive keys in all log payloads.
- No log call interpolates a value into the message string.
- No
console.*calls remain outside spec files. - A test asserts that a payload containing
password/privateKey/tokenis masked. - The auth and oracle log sites are audited, with findings recorded.
- The policy is documented in
CONTRIBUTING.md.
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 55
- Merge medio
- 1g 17h
- PR unite (30g)
- 5
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SourceXXL/alian_structure-api
-
Add rate-limit response headers to the CORS `exposedHeaders` so browser clients can read themApertagood first issue help wanted security
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SourceXXL/alian_structure-api#266 ·
-
Parallelize the cache-warming loop in `cache-warming.service.ts` — warmers run strictly sequentiallyForse già presa @syntaxsuuvam-spec l’ha presa 4 giorni fa. Apertagood first issue performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SourceXXL/alian_structure-api#240 ·
-
documentation help wanted intermediate refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SourceXXL/alian_structure-api#215 ·
-
good first issue refactor tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
SourceXXL/alian_structure-api#199 ·
-
help wanted intermediate refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
SourceXXL/alian_structure-api#196 ·
Tutte le issue di SourceXXL/alian_structure-api
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vercel/streamdown#673 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
docs(stream-protocol): document messageMetatadata on start/finish and the message-metadata chunkApertafactory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vercel/ai#23375 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
agilepathway/label-checker#721 ·
I maintainer di solito rispondono entro 1 giorno
-
CLI Empathy needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
chromaui/chromatic-cli#1524 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno