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

Fix redact for environment ( or perhaps other provider ) variables that expand to empty string #217

Closed
darach opened this issue Jan 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@darach
Copy link

darach commented Jan 22, 2024

Expected Behavior

Given a configuration that users the .env provider with a configuration containing any
variable that mapss to the empty string

FOO=""

Redaction should ignore the variable.

Current Behavior

$ cat test.txt
This is a test
$ cat test.txt| teller redact
**REDACTED**T**REDACTED**h**REDACTED**i**REDACTED**s**REDACTED** **REDACTED**i**REDACTED**s**REDACTED** **REDACTED**a**REDACTED** **REDACTED**t**REDACTED**e**REDACTED**s**REDACTED**t**REDACTED**

Possible Solution

Preprocess and remove variables that expand to the empty string.

Steps to Reproduce

  1. Create a .teller.yml with an env provider as above
  2. Create a non empty test.txt file as above
  3. Redact the file with teller
  4. Every character will contain an unwanted **REDACTED**

Context

Ideally, environment variables should not expand to the empty string - but this will not always be practicable or possible

Specifications

  • Version: $ teller version
Teller 1.5.6
Revision 7b714bc2f1d5e14920f2add828fdf7425148ff6b, date: 2022-10-13T08:02:44Z
  • Platform:
 uname -a | teller redact
Darwin **REDACTED** 22.6.0 Darwin Kernel Version 22.6.0: Wed Oct  4 21:25:26 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_X86_64 x86_64
@darach darach added the bug Something isn't working label Jan 22, 2024
jondot added a commit that referenced this issue May 15, 2024
@jondot
Copy link
Contributor

jondot commented May 15, 2024

Thanks, should be fixed with Teller 2.0 now.

@jondot jondot closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants