This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Fix issues with commenting out redacted site config fields.#53152
Merged
Conversation
indradhanush
approved these changes
Jun 8, 2023
indradhanush
left a comment
Contributor
There was a problem hiding this comment.
Took a cursory look at this, not finding anything unusual. Is it possible to add a test for this?
sashaostrikov
approved these changes
Jun 8, 2023
sashaostrikov
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix!
eseliger
approved these changes
Jun 8, 2023
eseliger
left a comment
Member
There was a problem hiding this comment.
Could we add a test for that?
indradhanush
reviewed
Jun 8, 2023
| }` | ||
|
|
||
| want := `{ | ||
| // "executors.accessToken": "supersecret", |
Contributor
There was a problem hiding this comment.
Now that I see the test it makes me think that isn't this a security risk? Don't we want to be able to redact them as well? I'm thinking from a user's perspective that is used to secrets being redacted on Sourcegraph, it could come up as a surprise if they saw a token in the open when they commented it out. 🤔
ErikaRS
pushed a commit
that referenced
this pull request
Jun 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Site config reads used to be done with the
gjsonlibrary, but thegjsonlibrary does not understand thejsoncformat. So it returns fields even if they are commented out.This PR changes the RedactSecrets and UnredactSecrets functions to use the
jsonclibrary to do reads instead, which understands fields that are commented out.Test plan
Manual verification and tests should still be passing.