Skip to content

v1.4.2 — narrower reveal window for short secrets

Choose a tag to compare

@bakhod1r bakhod1r released this 06 Aug 14:34
· 22 commits to main since this release

WithSecretReveal(n) used to fall back to a full mask whenever a value was too short to give both ends n characters, so an 8-character password showed as **** under WithSecretReveal(4) — indistinguishable from every other secret in the table.

It now shows at most half the value, split evenly between the two ends:

KEY                  VALUE         SOURCE
CSRF_SECRET          0123****cdef  .env    # 32 chars -> 4 + 4
DB_PASSWORD          su****pp      .env    #  8 chars -> 2 + 2
REDIS_PASSWORD       ****          .env    #  empty / too short

WithRedacted() still masks everything in full, whatever the option order.

Also in this line: WithWriteExample() (v1.4.1) takes no argument and writes the example file next to the .env it documents.