Skip to content

Improved and reliable secret masking - #569

Merged
Eljo George (eljog) merged 3 commits into
mainfrom
eljog/secrets-replaceall
Jun 29, 2023
Merged

Eljo George (eljog) merged 3 commits into
mainfrom
eljog/secrets-replaceall

Conversation

@eljog

@eljog Eljo George (eljog) commented Jun 29, 2023 •

Copy link
Copy Markdown
Member

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

2 participants