fix: strip whitespace from workflow secret names (fixes #5326)#6179
Closed
DragonBot00 wants to merge 2 commits intokeephq:mainfrom
Closed
fix: strip whitespace from workflow secret names (fixes #5326)#6179DragonBot00 wants to merge 2 commits intokeephq:mainfrom
DragonBot00 wants to merge 2 commits intokeephq:mainfrom
Conversation
…space bugs Fixes keephq#5326 - Secrets with trailing/leading spaces caused bugs where they appeared in the UI but could not be deleted, updated, or accessed. The stored key included the space while the lookup did not match. Changes: - In write_workflow_secret: strip whitespace from all incoming secret keys before storing - In delete_workflow_secret: strip whitespace from secret_name path param before lookup
Part of fix for keephq#5326 - also trim the secret name in the UI before calling the API so trailing/leading spaces are prevented at the source.
|
@DragonBot00 is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
|
Closing — no maintainer engagement after 5 days. Shifting focus to quality over quantity. |
1 similar comment
Contributor
Author
|
Closing — no maintainer engagement after 5 days. Shifting focus to quality over quantity. |
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
Fixes #5326 — Secrets named with trailing/leading whitespace (e.g.
"MY_SECRET ") appeared in the UI but could not be deleted, updated, or accessed.Root Cause
When a secret was saved with a trailing space in the key (e.g.
"MY_SECRET "), it was stored verbatim. Subsequent lookups or deletions using the trimmed name ("MY_SECRET") did not match the stored key, causing 404 errors or silent misses.Changes
Backend:
keep/api/routes/workflows.pywrite_workflow_secret: Strip whitespace from all incoming secret keys before storing —{k.strip(): v for k, v in secret_data.items()}delete_workflow_secret: Strip whitespace from thesecret_namepath parameter before lookupFrontend:
keep-ui/app/(keep)/workflows/[workflow_id]/workflow-secrets.tsxhandleAddSecret: Trim the secret name before passing to the API so trailing spaces are caught at the UI level tooTesting
Fixes: #5326