Skip to content

fix: keep credentials out of HTTP errors - #27

Merged
CodingInAVan merged 1 commit into
mainfrom
upload-safety
Jul 28, 2026
Merged

fix: keep credentials out of HTTP errors#27
CodingInAVan merged 1 commit into
mainfrom
upload-safety

Conversation

@CodingInAVan

@CodingInAVan CodingInAVan commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR hardens the agent’s HTTP upload path so authentication credentials cannot appear in exception messages or logs.

What changed

  • Trim transport whitespace from API tokens before creating the authorization header.
  • Handle trailing CR/LF characters commonly introduced by environment variables or copied secrets.
  • Replace raw exception-message logging with a sanitized exception-type description.
  • Preserve useful failure classification without exposing request headers, tokens, or other sensitive values.
  • Add regression tests covering token normalization and secret non-disclosure.

Why

HTTP client exceptions can include request details depending on the failure path and runtime implementation. Logging the raw exception message creates a risk that an API token may be written to local logs or CI output.

The agent now reports the failure category while keeping credential material out of the diagnostic message.

Validation

  • Full Gradle test suite passed.
  • All 17 HttpPublisherTest cases passed.
  • Shadow JAR build completed successfully.
  • Added tests for:
    • CR/LF token trimming.
    • Secrets embedded in exception messages.
    • Failure logging without credential disclosure.

@CodingInAVan
CodingInAVan merged commit ef4ec82 into main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant