fix: Support for Non-json secret fetched from Delinea SecretServer#4743
Merged
gusfcarvalho merged 23 commits intoexternal-secrets:mainfrom May 20, 2025
DelineaSahilWankhede:main
Merged
fix: Support for Non-json secret fetched from Delinea SecretServer#4743gusfcarvalho merged 23 commits intoexternal-secrets:mainfrom DelineaSahilWankhede:main
gusfcarvalho merged 23 commits intoexternal-secrets:mainfrom
DelineaSahilWankhede:main
Conversation
This commit enhances the Delinea Secret Server provider to support secrets created using custom templates that contain only a single non-JSON field. Previously, the provider assumed that `Items[0].ItemValue` always contained a JSON object. This caused failures when the value was plain text (as is common in single-field custom templates). The updated logic introduces a hybrid strategy: - If `Items[0].ItemValue` exists and is a valid JSON string, it uses GJSON to extract the desired property. - If not, it falls back to a flattened map lookup using `fieldName` and `slug` to locate the value directly in the Fields array. This ensures compatibility with both: - Legacy structured secrets (nested JSON within `ItemValue`) - Simpler templates where `ItemValue` is plain text (e.g. `"value": "abc123"`) This fix improves interoperability with a wider range of Delinea secret templates without breaking compatibility with existing ones. Tested with: - Single-field plaintext custom templates - Multi-field secrets with JSON-encoded values - Empty or missing properties (returns full object) Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
Added test cases for Non-JSON secret and Malformed JSON secret Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
…patch-1 fix: Support for Non-json secret fetched from Delinea SecretServer
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
gusfcarvalho
reviewed
May 8, 2025
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
Member
|
hi @DelineaSahilWankhede . We also need to add a |
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
Signed-off-by: DelineaSahilWankhede <161290557+DelineaSahilWankhede@users.noreply.github.com>
gusfcarvalho
approved these changes
May 20, 2025
|
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.



Problem Statement
External Secrets Operator currently assumes secret template data is always in JSON format. This limitation prevents users from creating secrets with non-JSON templates such as plain text, shell scripts, or configuration formats (e.g., INI, YAML).
What is the problem you're trying to solve?
Proposed Changes
Checklist
git commit --signoffmake testmake reviewable