the-13th-letter / derivepassphrase

an almost-faithful Python reimplementation of James Coglan's vault, a deterministic password manager/generator
MIT License
0 stars 0 forks source link

`derivepassphrase vault` differs from vault(1) behavior with falsy stored configuration values #17

Closed the-13th-letter closed 1 month ago

the-13th-letter commented 1 month ago

derivepassphrase vault uses a very strict validator to ensure that a configuration is valid, both its contents and its types. For example, the configuration {"global": {"phrase": null}, "services": {}} is not valid according to derivepassphrase's validator, because the phrase value must be a string.

vault(1) however tests most of its parameters for falsy values (in the JavaScript sense), and so will accept the configuration {"global": {"phrase": null, "upper": ""}, "services": {}}, among others.

Therefore, in the interest of compatibility with vault(1), convert all falsy values to their correctly typed equivalent before validating them.

We shall still make sure that any configuration we write is valid according to our validator as well, not just vault(1)'s.