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

Improved and reliable secret masking #569

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Improved and reliable secret masking #569

merged 3 commits into from
Jun 29, 2023

Conversation

eljog
Copy link
Member

@eljog eljog commented Jun 29, 2023

Secret masking functionality that was added in #551 used regex for replacing secret values. One edge case is that if there are one or more secret values that are very large (say over 32K) we cannot create a regex for that (due to regex length limit).
Best alternative is to use string.relaceAll function that is available in ES2021 and above. That also bring in additional benefits as documented here.

In this PR

  • Improves the masking logic using string.replaceAll method.
  • Added a test to cover large secrets scenario

Dependency

  • Depends on Upgrade target to ES2021 #568
    I have added the commit from that PR here, to make the checks pass. I will hold this one until that PR is merged.

@eljog eljog requested a review from a team as a code owner June 29, 2023 01:45
@eljog eljog enabled auto-merge (squash) June 29, 2023 16:32
@eljog eljog merged commit 74d9244 into main Jun 29, 2023
@eljog eljog deleted the eljog/secrets-replaceall branch June 29, 2023 16:33
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.

2 participants