Trim whitespace for ENC[...] references to match Agent #3786
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 342 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.349
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3786"
general
weight: 0.35
gabedos
What does this PR do?
Trims leading/trailing spaces and tabs before matching
ENC[...]secret references inpkg/secrets, matching the Agent'scomp/core/secrets/utils.IsEnc.parseEnctrims once and returns the handle;IsEncandextractHandleuse it.fetchSecretkeys results by the original input instead of rebuildingENC[<handle>], so callers can look up padded references without changes. For unpadded inputs the keys are identical to before.encFormatis removed as unused.Motivation
CONTP-2323. Per the brief, credentials and DDGR secret references (CONTP-2284) should share the Agent's matching behavior.
Additional Notes
" ENC[handle]\t"is now resolved through the secret backend instead of being used as a literal key. With no backend configured, it now fails at credential loading with a secret-backend error.Minimum Agent Versions
N/A
Describe your test plan
pkg/secretsandpkg/configcover padded references and trimming boundaries (newlines, padded literals).--secretBackendCommand=/readsecret.shreading a mounted Secret, and API endpoints pointed at an in-cluster echo server to capture theDd-Api-Keyheader:- Padded
ENC[...]references inDD_API_KEY/DD_APP_KEY(e.g." ENC[api_key]\t") resolve, and metadata requests use the decrypted key.- A padded
ENC[...]reference in a DatadogAgent'sspec.global.credentials.apiKeyresolves for the metrics forwarder (validate, events, series).- Unpadded
ENC[...]references in both places still resolve.- Control: the previous image sends padded references as the raw
ENC[...]string.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
[CONTP-2323]: https://datadoghq.atlassian.net/browse/CONTP-2323?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[CONTP-2284]: https://datadoghq.atlassian.net/browse/CONTP-2284?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ