-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anthony Green
committed
Nov 27, 2023
1 parent
55f1e06
commit a82cd62
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# privacy-output-stream | ||
A Common Lisp output stream that masks secret strings | ||
|
||
`privacy-output-stream` is a character output stream that wraps other | ||
streams, like `*standard-output*` and masks secrets from the output by | ||
replacing them with a series of `*`. | ||
|
||
For example, the following code: | ||
``` | ||
(let ((*standard-output* (make-instance 'privacy-output-stream | ||
:stream *standard-output* | ||
:secrets '("passw0rd" "sekret")))) | ||
(format t "Hello, my password is passw0rd~%")) | ||
``` | ||
|
||
...prints: | ||
``` | ||
Hello, my password is ******** | ||
``` | ||
|
||
```secrets``` is a list of secret values you want to mask in the final | ||
output. They are processed in order, so I recommend that you sort | ||
your secrets by length in case one is a substring of another. | ||
|
||
Note also, that `privacy-output-stream` only masks secrets that are | ||
presented in full as part of a string or sequence being written to the | ||
stream. Secrets written in fragments (by character or substring) will | ||
not be masked. | ||
|
||
Author and License | ||
------------------- | ||
|
||
``privacy-output-stream`` was written by [Anthony Green](https://github.com/atgreen), | ||
and is distributed under the terms of the MIT license. |