Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

command to add a secret to a worker #907

Closed
ashleymichal opened this issue Nov 25, 2019 · 2 comments · Fixed by #1045
Closed

command to add a secret to a worker #907

ashleymichal opened this issue Nov 25, 2019 · 2 comments · Fixed by #1045
Labels
feature Feature requests and suggestions regression Something is broken, but works in previous releases

Comments

@ashleymichal
Copy link
Contributor

ashleymichal commented Nov 25, 2019

wrangler should support a command that allows the user to securely add a secret environment variable to the script of their choosing. should be interactive by default to prevent sensitive data from leaking into terminal history. ideally also allows for values to be piped to it.

Syntax

$ wrangler secret set secret-name
=> Enter your secret value
# or
$ echo $SECRET_VALUE | wrangler secret secret-name

this command should support the environment flag; when not present, the command should create a secret in the context of the top level worker. when present, the command should create a secret in the context of the worker specified in the env.

outstanding questions:

  1. what to do when the worker does not exist yet
  2. does this require extra encryption before sending?

Depends on

  • add endpoint to workers configuration api to add a secret binding to an already existing worker
  • add endpoint definition to cloudflare-rs for calling the above endpoint
@ashleymichal ashleymichal added this to the Wrangler Secret support milestone Nov 25, 2019
@ashleymichal ashleymichal changed the title command to add a secret to a command to add a secret to a worker Nov 25, 2019
@ashleymichal ashleymichal added cross-team - cloudflare-rs feature Feature requests and suggestions regression Something is broken, but works in previous releases labels Nov 26, 2019
@exvuma
Copy link
Contributor

exvuma commented Nov 26, 2019

Thinking about this, I actually think we should be consistent with how wrangler uses : to separate actions from subcommand. We should either change how kv: does this or omit the : here
See https://wiki.cfops.it/display/~victoria/Wrangler+Commands

@ashleymichal
Copy link
Contributor Author

ashleymichal commented Nov 26, 2019

we shouldn't change how kv does things. the difference between kv and secrets is that in kv you are potentially manipulating one of many subresources: namespaces vs keys, for example, so the whole foo:bar segment is still a "noun" (e.g. kv:namespace or kv:key) while the command that follows is the verb. likewise here the only noun is secret and the verbs are still create, list, and delete

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions regression Something is broken, but works in previous releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants