Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow STDIN to change passphrase #11083

Closed
mrlnstpn opened this issue Oct 19, 2022 · 2 comments 路 Fixed by #11094
Closed

Allow STDIN to change passphrase #11083

mrlnstpn opened this issue Oct 19, 2022 · 2 comments 路 Fixed by #11094
Assignees
Labels
area/cli UX of using the CLI (args, output, logs) impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Milestone

Comments

@mrlnstpn
Copy link

mrlnstpn commented Oct 19, 2022

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Can you allow STDIN in changing the pulumi config passphrase?

tux@pc:~/Platform$ echo "wasdwasd" | pulumi stack change-secrets-provider passphrase --non-interactive error: passphrase rotation requires an interactive terminal

tux@pc:~/Platform$ bash -x rotate.sh DEFAULT_PASSPHRASE=ILgR6JPuhlqTy1NB6hNvnGAg/XM7p7Eg9nC6adAA0buQYsZMCZmTbc8QuLC8u3Wb echo ILgR6JPuhlqTy1NB6hNvnGAg/XM7p7Eg9nC6adAA0buQYsZMCZmTbc8QuLC8u3Wb pulumi stack change-secrets-provider passphrase --non-interactive error: passphrase rotation requires an interactive terminal

tux@pc:~/Platform$ cat rotate.sh #!/bin/bash DEFAULT_PASSPHRASE=${PULUMI_CONFIG_PASSPHRASE:-default} echo $DEFAULT_PASSPHRASE | pulumi stack change-secrets-provider passphrase --non-interactive

return "", nil, fmt.Errorf("passphrase rotation requires an interactive terminal")

@mrlnstpn mrlnstpn added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Oct 19, 2022
@RobbieMcKinstry
Copy link
Contributor

Hi @mrlnstpn, thanks for the tip. #11094 looks pretty good, so I suspect we'll have this out with the next release on Wednesday.

@RobbieMcKinstry RobbieMcKinstry added area/cli UX of using the CLI (args, output, logs) impact/usability Something that impacts users' ability to use the product easily and intuitively and removed needs-triage Needs attention from the triage team labels Oct 20, 2022
@RobbieMcKinstry RobbieMcKinstry self-assigned this Oct 20, 2022
bors bot added a commit that referenced this issue Oct 24, 2022
11094: Allow rotating the password non-interactively r=Frassle a=nicklasfrahm

Signed-off-by: Nicklas Frahm <nilfr@vestas.com>

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

Fixes #11083. Also fixes some deprecation warnings within the `passphrase` package.

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have tested this locally using:
  ```bash
  export PULUMI_CONFIG_PASSPHRASE=test
  pulumi stack init -s test
  echo "hello" | pulumi stack change-secrets-provider passphrase
  export PULUMI_CONFIG_PASSPHRASE=hello
  echo "test" | pulumi stack change-secrets-provider passphrase
  ```
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Nicklas Frahm <nilfr@vestas.com>
bors bot added a commit that referenced this issue Oct 24, 2022
11094: Allow rotating the password non-interactively r=Frassle a=nicklasfrahm

Signed-off-by: Nicklas Frahm <nilfr@vestas.com>

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

Fixes #11083. Also fixes some deprecation warnings within the `passphrase` package.

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have tested this locally using:
  ```bash
  export PULUMI_CONFIG_PASSPHRASE=test
  pulumi stack init -s test
  echo "hello" | pulumi stack change-secrets-provider passphrase
  export PULUMI_CONFIG_PASSPHRASE=hello
  echo "test" | pulumi stack change-secrets-provider passphrase
  ```
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Nicklas Frahm <nilfr@vestas.com>
@bors bors bot closed this as completed in 4870ecd Oct 24, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Oct 24, 2022
@RobbieMcKinstry
Copy link
Contributor

馃殌 Hurray! Very glad this shipped! :D

@mikhailshilkov mikhailshilkov added this to the 0.79 milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli UX of using the CLI (args, output, logs) impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants