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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --export option to the secrets env command #145

Closed
2 tasks
tegefaulkes opened this issue Feb 28, 2024 · 5 comments
Closed
2 tasks

Add --export option to the secrets env command #145

tegefaulkes opened this issue Feb 28, 2024 · 5 comments
Assignees
Labels
development Standard development r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management

Comments

@tegefaulkes
Copy link
Contributor

Specification

We want to add export behaviour to the secrets env command. This will act similar to how export key="value" in linux. Essentially it will add the secrets selected with -e vault:secretPath to be added to the current environment.

This will need to work on all of the supported platforms. So it needs to work on windows too.

Unless I'm missing any nuance it should be as simple as adding the envs with process.env[key]=value;.

We need to decide if it will work along side the other functionality or become the main function when run. For example, if we run the command with polykey secrets env -e vault1:secret1 --export some command will it run some command AND export to the current environment? OR just export? Same for the formatted outputs?

Additional context

Tasks

  • 1. Add the --export flag which will add the selected secrets to the current environment.
  • 2. Make sure to support windows and all of the platforms.
@tegefaulkes tegefaulkes added the development Standard development label Feb 28, 2024
@tegefaulkes
Copy link
Contributor Author

I did a quick sanity check with

[brian@matrix-precision-3480-syzygy:~/workspace/Polykey-CLI]$ node -e "process.env.test='value'"

[brian@matrix-precision-3480-syzygy:~/workspace/Polykey-CLI]$ echo $test


[brian@matrix-precision-3480-syzygy:~/workspace/Polykey-CLI]$ 

So while we can set process.env.key to be whatever, it will only afffect the current process and any children. Wit will not be exported to the environment running the command. We'll need to find an alternative.

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Feb 28, 2024 via email

@tegefaulkes
Copy link
Contributor Author

Just checking if it was a viable way to do this but it doesn't work for our needs. I'll need to look into this more.

@tegefaulkes
Copy link
Contributor Author

I recall from discussion that this is not actually a use case we want to support. If you want to export the env variables from the secrets env command you need to take the output from the command and do one of the provided terminal methods for doing this. The secrets env command shouldn't do it for you.

Closing as not planned.

@tegefaulkes tegefaulkes closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@CMCDragonkai
Copy link
Member

This is impossible to do.

@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management
Development

No branches or pull requests

2 participants