-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cli] Ensure the user has set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE #6893
Conversation
@@ -90,13 +90,6 @@ func newStackExportCmd() *cobra.Command { | |||
} | |||
|
|||
if showSecrets { | |||
// Currently, the stack.DefaultSecretsProvider is cached so adding a call to getStackSecretsManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is now going to error properly, we can remove this workaround we added in this specific usecase
…IG_PASSPHRASE_FILE Fixes: #6286 When a user is using the passphrase provider and unsets the environment variables that let them interact with the secrets provider, then would get an error as follows: ``` ▶ pulumi up -y -f error: decrypting secret value: failed to decrypt: incorrect passphrase, please set PULUMI_CONFIG_PASSPHRASE to the correct passphrase ``` We are oging to change this error message to make it more obvious to a user what the error is and how they need to fix it ``` ▶ pulumi up -y -f error: constructing secrets manager of type "passphrase": unable to find either `PULUMI_CONFIG_PASSPHRASE` nor `PULUMI_CONFIG_PASSPHRASE_FILE` when trying to access the Passphrase Secrets Manager. Please ensure one of these values are set to allow the operation to continue ``` Ideally, we would like to prompt the user for the passphrase at this point rather than error, but the CLI could be in the middle of an update operation as the same codepath is used for reading stackreference values
5a168b8
to
a1a2ce9
Compare
This incorporates some post merge feedback from #6893 This doesn't change the functionality of any of the tests: ``` go test -v ./secrets/passphrase -count=1 === RUN TestPassphraseManagerIncorrectPassphraseReturnsErrorCrypter --- PASS: TestPassphraseManagerIncorrectPassphraseReturnsErrorCrypter (0.89s) === RUN TestPassphraseManagerIncorrectStateReturnsError --- PASS: TestPassphraseManagerIncorrectStateReturnsError (0.00s) === RUN TestPassphraseManagerCorrectPassphraseReturnsSecretsManager --- PASS: TestPassphraseManagerCorrectPassphraseReturnsSecretsManager (1.08s) === RUN TestPassphraseManagerNoEnvironmentVariablesReturnsError --- PASS: TestPassphraseManagerNoEnvironmentVariablesReturnsError (0.00s) PASS ok github.com/pulumi/pulumi/pkg/v3/secrets/passphrase 2.270s ```
I've opened a further PR to address the comments by @lukehoban |
This incorporates some post merge feedback from #6893 This doesn't change the functionality of any of the tests: ``` go test -v ./secrets/passphrase -count=1 === RUN TestPassphraseManagerIncorrectPassphraseReturnsErrorCrypter --- PASS: TestPassphraseManagerIncorrectPassphraseReturnsErrorCrypter (0.89s) === RUN TestPassphraseManagerIncorrectStateReturnsError --- PASS: TestPassphraseManagerIncorrectStateReturnsError (0.00s) === RUN TestPassphraseManagerCorrectPassphraseReturnsSecretsManager --- PASS: TestPassphraseManagerCorrectPassphraseReturnsSecretsManager (1.08s) === RUN TestPassphraseManagerNoEnvironmentVariablesReturnsError --- PASS: TestPassphraseManagerNoEnvironmentVariablesReturnsError (0.00s) PASS ok github.com/pulumi/pulumi/pkg/v3/secrets/passphrase 2.270s ```
…ate (#6909) This incorporates some post merge feedback from #6893 This doesn't change the functionality of any of the tests: ``` go test -v ./secrets/passphrase -count=1 === RUN TestPassphraseManagerIncorrectPassphraseReturnsErrorCrypter --- PASS: TestPassphraseManagerIncorrectPassphraseReturnsErrorCrypter (0.89s) === RUN TestPassphraseManagerIncorrectStateReturnsError --- PASS: TestPassphraseManagerIncorrectStateReturnsError (0.00s) === RUN TestPassphraseManagerCorrectPassphraseReturnsSecretsManager --- PASS: TestPassphraseManagerCorrectPassphraseReturnsSecretsManager (1.08s) === RUN TestPassphraseManagerNoEnvironmentVariablesReturnsError --- PASS: TestPassphraseManagerNoEnvironmentVariablesReturnsError (0.00s) PASS ok github.com/pulumi/pulumi/pkg/v3/secrets/passphrase 2.270s ```
Hi @justinvp - we've just upgraded to this version and despite setting |
I got the same problem for not able to use pulumi because my |
Hey @lyenliang / @simonpinn I just opened a Pull request that will fix this up - this was not intended to remove support for "" You will still need to set PULUMI_CONFIG_PASSPHRASE as an "" but then it will work Please stay tuned for v3.2.1 release Paul |
Fixes: #6286
When a user is using the passphrase provider and unsets the environment
variables that let them interact with the secrets provider, then would
get an error as follows:
We are oging to change this error message to make it more obvious
to a user what the error is and how they need to fix it
Ideally, we would like to prompt the user for the passphrase at this
point rather than error, but the CLI could be in the middle of an
update operation as the same codepath is used for reading stackreference
values