-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve the key validation in secret identifier. #17351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label. Could you fix it @mashhurs? 🙏
|
This sounds like a breaking change.
|
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
Yeah, didn't think of the case if keystore had invalid keys already included.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mechanically, this works, and safely guards against adding keys that cannot be referenced in the pipelines without breaking users whose keystores include offending keys.
I've left suggestions about DRY-ing it up a bit, and improving the admitedly-difficult description of the effective key pattern requirement.
logstash-core/src/main/java/org/logstash/secret/SecretIdentifier.java
Outdated
Show resolved
Hide resolved
logstash-core/src/main/java/org/logstash/secret/SecretIdentifier.java
Outdated
Show resolved
Hide resolved
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
9139460
to
6ac79ce
Compare
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
…ey names to the keystore through keystore CLI. Keysotre now warns on invalid keys if they were already added.
[doc] better explanation of accepting key format. Co-authored-by: Rye Biesemeyer <[email protected]>
…ription. Co-authored-by: Rye Biesemeyer <[email protected]>
6ac79ce
to
bfea29d
Compare
Rebased against main as we were having CI issues, fixed by #17531 |
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 looking on-track.
I've left a comment about message format, and suggested more useful random key generation for tests.
logstash-core/src/main/java/org/logstash/secret/cli/SecretStoreCli.java
Outdated
Show resolved
Hide resolved
logstash-core/src/test/java/org/logstash/secret/cli/SecretStoreCliTest.java
Outdated
Show resolved
Hide resolved
logstash-core/src/main/java/org/logstash/secret/SecretIdentifier.java
Outdated
Show resolved
Hide resolved
logstash-core/src/main/java/org/logstash/secret/SecretIdentifier.java
Outdated
Show resolved
Hide resolved
Warning and error messages well formatted. Co-authored-by: Rye Biesemeyer <[email protected]>
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
📃 DOCS PREVIEW ✨ https://logstash_bk_17351.docs-preview.app.elstc.co/diff |
|
💚 Build Succeeded
History
cc @mashhurs |
Release notes
[rn:skip]
What does this PR do?
Before this change, key-value can be added to keystore but it might impossible to reference the key because
ConfigVariableExpander
ignores if key name doesn't align withSUBSTITUTION_PLACEHOLDER_REGEX
Improves user experience with the secret store CLI that when providing key name, LS validates to accept a value which can be used in pipeline (aligns with
ConfigVariableExpander#SUBSTITUTION_PLACEHOLDER_REGEX
).If already invalid key(s) were added, it warns to remove/replace the keys.
Why is it important/What is the impact to the user?
No user impact. Keystore CLI restricts adding meaningless keys to keystore.
Checklist
[] I have made corresponding changes to the documentation[] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs