pulumi/pkg/secrets
Justin Van Patten 6c7a330051
Fix passphrase secrets provider prompting (#8986)
In #2736, caching was introduced inside the passphrase secrets provider to avoid prompting the user for a password multiple times in the same `pulumi` command. However, the cache is not used in all cases, which leads to double prompting and/or erroring if the passphrase is not set in the `PULUMI_CONFIG_PASSPHRASE` envvar. In some cases, the user is prompted for their passphrase and then the command fails because the passphrase wasn't set via the envvar.

This change addresses these issues. The net effect is that when using the passphrase secrets provider, you'll be prompted for your passphrase up-front once (if interactive and the envvar isn't set), and subsequent uses will use the cached value and won't prompt or error if the envvar isn't set.

Implementation note: This moves the prompting code inside the `passphrase` package. I was originally trying to avoid this, to avoid the package depending on `cmdutil.ReadConsoleNoEcho` and `cmdutil.Interactive`, but this lead to unnatural contortions elsewhere. It ended up being much cleaner to have the prompting happen inside the passphrase implementation. Functions that may prompt (when interactive and the envvar isn't set) include "Prompt" in their name.
2022-02-16 13:39:08 -08:00
..
b64 Using a decryptAll functionality when deserializing a deployment (#8676) 2022-01-24 22:33:40 +02:00
cloud Using a decryptAll functionality when deserializing a deployment (#8676) 2022-01-24 22:33:40 +02:00
passphrase Fix passphrase secrets provider prompting (#8986) 2022-02-16 13:39:08 -08:00
service Using a decryptAll functionality when deserializing a deployment (#8676) 2022-01-24 22:33:40 +02:00
manager.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00