Improve .env parser handling for quoted values
- Dominant language
- Svelte
- Stars
- 393
- Forks
- 260
- Avg merge
- 6h 53m
- Merged PRs (30d)
- 24
Description
### 🔖 Enhancement description
The Console's `.env` parser should only remove wrapping single or double quotes from imported environment variable values, while preserving quotes
that are part of the actual value.
Currently, quote characters inside values can be removed unintentionally. For example:
```env
AUTHOR=O'Brien
MESSAGE=Say "hello"
These values should be parsed as:
{
AUTHOR: "O'Brien",
MESSAGE: 'Say "hello"'
}
The parser should still support existing behavior for wrapped values:
NAME='Appwrite'
MESSAGE="Hello world"
```
### 🎤 Pitch
Environment variable imports should preserve the exact value users provide, except for common `.env` wrapping quotes. Quotes can be meaningful in
secrets, connection strings, messages, and other configuration values.
This improves reliability for users importing `.env` files into Console and prevents accidental value changes during parsing.
The related PR adds coverage for `.env` parser behavior, including:
- `=` and `:` separators
- whitespace trimming
- wrapped single and double quotes
- quotes inside values
- values containing `=` or `:`
- CRLF line endings
- comments, malformed lines, and empty values
Related PR: https://github.com/appwrite/console/pull/3015
### 👀 Have you spent some time to check if this issue has been raised before?
- [x] I checked and didn't find similar issue
### 🏢 Have you read the Code of Conduct?
- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Assessment
This issue has not been assessed yet.