Repository navigation
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 155c8aa | Docs | View more details | Give us feedback! |
nlchung
marked this pull request as ready for review
November 13, 2026 15:10
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
gabedos
reviewed
Nov 13, 2026
|
|
||
| // parseEnc returns the handle of an ENC[<handle>] reference, ignoring | ||
| // leading/trailing spaces and tabs (matches the Agent's behavior) | ||
| func parseEnc(str string) (string, bool) { |
Collaborator
There was a problem hiding this comment.
nit: could it be worth leaving an explicit comment in the code about how this is meant to mirror the way the Agent parses ENC (and maybe which package in the agent code it's reflecting?)
This branch has not been deployed
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.
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:ENC[...]references inDD_API_KEY/DD_APP_KEY(e.g." ENC[api_key]\t") resolve, and metadata requests use the decrypted key.ENC[...]reference in a DatadogAgent'sspec.global.credentials.apiKeyresolves for the metrics forwarder (validate, events, series).ENC[...]references in both places still resolve.ENC[...]string.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel