dakrone / dakrone/clj-http

Provide a way to redact headers in ExceptionInfo

Open
#290 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

adopt me feature
Dominant language
Clojure
Stars
1.8k
Forks
410
PR merge metrics
No merged PRs in 30d

Description

Some headers should not be written into logs. However, these headers will appear in the exception info thrown by a bad request. Manually redacting them at the site of logging is error-prone (at best, you lose the stack trace by re-constructing ex-info; at worst, you miss a place).

A better solution is to provide a binding that identifies redacted headers:

(binding [*redact-headers* ["X-MyCleartextPassword"]]
  (client/get ...))

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named in the issue. Start by tracing how bad-request exceptions assemble ExceptionInfo and where response headers enter it, then inspect existing tests for exception details. Done means a dynamic binding can identify headers for redaction without reconstructing or losing the original exception information.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.