fix: redact provider-prefixed secret fields in API responses - #66
Merged
Siumauricio merged 2 commits intoAug 7, 2026
Merged
Conversation
Adds a test suite for redactSensitive covering the provider-prefixed fields from Dokploy#65 (githubPrivateKey, githubClientSecret, githubWebhookSecret), nesting, arrays, case-insensitivity, null passthrough, circular structures, and prototype-pollution keys. Also hoists the lowered suffix list out of the per-key loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Pushed a maintainer commit on top, @codebeetl — the fix itself is unchanged: it adds a test suite for Complementary: #69 flips |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compose.one(and likely other read endpoints) return env vars in plaintext, leaking secrets into LLM context #41.redactSensitive()matched field names by exact equality only. Dokploy's actual API responses prefix git-provider credential fields with the provider name (githubClientSecret,githubPrivateKey,githubWebhookSecret, and thegitlab/bitbucket/giteaequivalents), so none of them match the bare names inDEFAULT_REDACTED_FIELDS(clientSecret,privateKey,secret).DOKPLOY_REDACT_ENV=true,compose.one(and any other endpoint returning a connected git provider) still returns the provider's client secret, private key, and webhook secret in plaintext.DOKPLOY_REDACT_ENV's default is untouched (still opt-in, off by default) to avoid changing behavior for existing deployments.Test plan
pnpm type-checkpnpm test(25/25 passing)compose.oneresponse containing a real GitHub AppgithubPrivateKey/githubClientSecret/githubWebhookSecret— confirmed unredacted before this change, redacted after