msamgan / laravel-env-keys-checker

check if all the keys are available across all the .env files.
MIT License
12 stars 2 forks source link

[Bug]: Multi-line environment vars not supported #11

Open pelmered opened 4 days ago

pelmered commented 4 days ago

What happened?

I have my Passport keys in my .env files like this:

PASSPORT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----
my key
as a multi-line
string here
-----END PUBLIC KEY-----"

This is not parsed correctly as each line is considered an environment key.

How to reproduce the bug

Just add the environment var from above to you .env file and run the env:keys-check command.

Package Version

v1.3.0

PHP Version

8.3.12

Laravel Version

11.26.0

Which operating systems does with happen with?

macOS

Notes

No response

pelmered commented 4 days ago

I guess the GetKey action should check for matching quotation marks?

msamgan commented 4 days ago

hey @pelmered, thanks for raising the bug. Multi-line keys are not very common, so it skipped my mind, but definitely, this will be considered in further releases.