Repository navigation
feat(history): an opt-in setting to hide values in new entries - #604
Merged
Merged
Conversation
History is a file on disk for the life of the install, and `SELECT * FROM patients WHERE nhs_number = '...'` sits in it. On a shared machine, or anywhere a regulator would look, that is worth being able to turn off (#330). Off by default, and it should be. A redacted entry cannot be rerun and is much harder to read, which is most of what history is for; DBeaver and DataGrip both store literals as typed. This is for people who have a reason to give that up, not a default anyone should be opted into. The issue asked for default ON — I have gone the other way, because silently making every user's history unrunnable is a bigger change than the risk it addresses, and the people who need it will find the checkbox. Credential redaction stays unconditional. That one is not a preference and must not become one, so it still applies with this setting off. Identifiers are left alone: an entry whose table and column names were also blanked would be unreadable rather than merely unrunnable. LIMIT and OFFSET are left alone too — they say nothing about anyone, and losing them makes the entry harder to read for nothing. Numbers are otherwise blanked, since an account id or a salary identifies a person as readily as an email. The setting is not retroactive and cannot be: the literals in entries already stored exist nowhere else, so blanking them now would destroy history the user chose to keep under the old setting. The checkbox says so. Closes #330 Co-Authored-By: Claude Opus 5 <[email protected]>
Closed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #330. Last of the history area.
History is a file on disk for the life of the install, and
SELECT * FROM patients WHERE nhs_number = '...'sits in it. On a shared machine, or anywhere a regulator would look, that's worth being able to turn off.I went against the issue on the default
The issue asked for default ON. This ships default OFF. A redacted entry can't be rerun and is much harder to read, which is most of what history is for — DBeaver and DataGrip both store literals as typed. Silently making every user's history unrunnable is a bigger change than the risk it addresses, and the people who need it will find the checkbox. Say the word and I'll flip it.
Credential redaction stays unconditional (#587). That one is not a preference and must not become one, so it still applies with this setting off — there's a test.
What it does and doesn't blank
One bug worth flagging
The
\bin the LIMIT/OFFSET guard was silently turned into a literal backspace character by my Python heredoc (Python treats\bas an escape;\wand\dit leaves alone, which is why only one broke). The regex compiled fine and simply never matched, so LIMIT values were being redacted. Caught by the test that asserts they aren't.Verification
8 new redactor tests (36 in the file), 6 store tests, 3 panel tests. Unit 1981, browser 300, 0 lint errors.