Skip to content
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

Merged
merged 10 commits into from
Jun 3, 2024
Merged

Add symbols support for secret gen function #971

merged 10 commits into from
Jun 3, 2024

Conversation

BulldromeQ
Copy link
Contributor

This is a pull request template. Please provide the following information to
help us review your pull request.

Please remove placeholder text (including this text)and replace it with your
own content.

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:

  • Change 1
  • Change 2
  • Change 3

Test Policy Compliance

  • I have added or updated unit tests for my changes.
  • I have included integration tests where applicable.
  • All new and existing tests pass successfully.

Code Quality

  • I have followed the coding standards for this project.
  • I have performed a self-review of my code.
  • My code is well-commented, particularly in areas that may be difficult
    to understand.

Documentation

  • I have made corresponding changes to the documentation (if applicable).
  • I have updated any relevant READMEs or wiki pages.

Additional Comments

Include any additional comments or context about the PR here.

Checklist

Before you submit this PR, please make sure:

  • You have read the contributing guidelines and
    especially the test policy.
  • You have thoroughly tested your changes.
  • You have followed all the contributing guidelines for this project.
  • You understand and agree that your contributions will be publicly available
    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
🐢⚡️!

core/crypto/parser.go Outdated Show resolved Hide resolved
@@ -86,6 +87,8 @@ func replaceWithGenerated(s *string, expression string, ranges [][]byte,
alphabet += everything
case `\d`:
alphabet += numbers
case `\s`:
Copy link
Contributor

@v0lkan v0lkan May 31, 2024

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.

Copy link
Contributor Author

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
@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Change the gen rule to use random symbol
@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Volkan Ozcelik <[email protected]>
@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Volkan Ozcelik <[email protected]>
@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Volkan Ozcelik <[email protected]>
@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Volkan Ozcelik <[email protected]>
@vmwclabot
Copy link

@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: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@v0lkan
Copy link
Contributor

v0lkan commented Jun 3, 2024

@BulldromeQ, I updated the escape sequence to \x instead of \symbol as it might get mixed up in (unlikely) cases of \s (a whitespace) followed by a literal “ymbol”.

\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.

@v0lkan v0lkan merged commit a5602df into main Jun 3, 2024
@v0lkan v0lkan deleted the qi/symbol branch June 3, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants