openfaas / nats-queue-worker

Queue-worker for OpenFaaS with NATS Streaming
https://docs.openfaas.com/reference/async/
MIT License
129 stars 59 forks source link

redact request data from routine logging #108

Closed fasilz closed 3 years ago

fasilz commented 3 years ago

This PR redacts logging incoming request data as part of the routine logging.

Description

For cases where DebugPrintBody is not set to true, the request data will be redacted and will be shown as xxxxxx. User can print the request data by setting DebugPrintBody to true via env variable.

Motivation and Context

How Has This Been Tested?

Added unit test. Adopted the approach used in std lib: https://golang.org/src/net/url/url.go?s=25219:25250#L852.

Types of changes

Checklist:

derek[bot] commented 3 years ago

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide. Tip: if you only have one commit so far then run: git commit --amend --signoff and then git push --force.