Skip to content

Add 'quote' option to dotenv format#2174

Open
icholy wants to merge 1 commit intogetsops:mainfrom
icholy:dotenv-quote
Open

Add 'quote' option to dotenv format#2174
icholy wants to merge 1 commit intogetsops:mainfrom
icholy:dotenv-quote

Conversation

@icholy
Copy link
Copy Markdown

@icholy icholy commented May 7, 2026

The dotenv store emits key=value unquoted, escaping only newlines (as a literal \n). Values containing whitespace, quotes, or other characters produce output that downstream parsers reject or misinterpret. This PR adds an opt-in alternative:

  • Add a quote boolean to the dotenv store config. When true, the emitter wraps every value with strconv.Quote and the loader requires every value to be parseable by strconv.Unquote.
  • The legacy unquoted dialect remains the default. Existing files are unaffected; opting in via stores.dotenv.quote: true requires a one-time re-encrypt of any pre-existing dotenv files.

Related to: #1435, #1951, #1748, #622, #706

Signed-off-by: Ilia Choly <ilia.choly@gmail.com>
@icholy icholy marked this pull request as ready for review May 7, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant