-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add symbols support for secret gen function #971
Conversation
Signed-off-by: Qi Hu <[email protected]>
core/crypto/parser.go
Outdated
@@ -86,6 +87,8 @@ func replaceWithGenerated(s *string, expression string, ranges [][]byte, | |||
alphabet += everything | |||
case `\d`: | |||
alphabet += numbers | |||
case `\s`: |
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.
\d
is regex for "decimal"
\s
is regex for "whitespace"; so it might be confusing for the end user.
instead of [\s]
it would be better to let users be explicit and use something like [?!;,:.]
.
(as long as symbols
have this; we can use it.
Plus, this solves @yinda’s "no double quotes" comment as if the user does not ask for the double quote, we won’t do the replacement.
That is, we can still have it as an "available symbol" in the constant; but it will be up to the operator to define it.
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.
Agree, something like [?!;,:.]
works fine with limit special characters, I changed \s
to \symbol
to avoid confusing.
Change symbols
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Change the gen rule to use random symbol
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Volkan Ozcelik <[email protected]>
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Volkan Ozcelik <[email protected]>
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Volkan Ozcelik <[email protected]>
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Volkan Ozcelik <[email protected]>
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Volkan Ozcelik <[email protected]>
@BulldromeQ, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
@BulldromeQ, I updated the escape sequence to \x is a less-used flag which modern engines prefer to use ^ and $ instead of \x, so we should be safe in there. I ran the tests and it passes. I’m merging this one. |
Title of the Pull Request
Description
Please provide a summary of your changes here. Include the purpose of the change
and any relevant issues this PR addresses.
Changes
List the major changes you have made in bullet points:
Test Policy Compliance
Code Quality
to understand.
Documentation
Additional Comments
Include any additional comments or context about the PR here.
Checklist
Before you submit this PR, please make sure:
especially the test policy.
under the project's license.
By submitting this pull request, you confirm that my contribution is made under
the terms of the project's license and that you have the authority to grant
these rights.
Thank you for your contribution to VMware Secrets Manager
🐢⚡️!