Skip to content

Implement secrets write command #242

@tegefaulkes

Description

@tegefaulkes

Specification

As part of the #32 issue refactoring, we need to implement secrets write command. This command is the most basic method of writing secrets.

secrets read

This command needs to read the contents of a secret in a vault. The contents will be outputted to stdout. Pretty much just the existing secrets get command. I don't think any changes need to be made to it.

The command takes the form of pk secrets read [secretPath]. The output can be redirected with pk secrets read [secretPath] > some file and piping into it shouldn't do anything. (see #242 (comment))

secrets write

This command needs to update or create the contents of a file. There will be two ways to provide the secret contents here. Coompared to current implementation, this pretty much is just secrets create but allows you to update a secret as well.

  1. Interactively via stdin. so if you call secrets write secretPath you can type in you contents to the terminal and send EOF (ctrl+d) to finish writing.
  2. Piping data in.

In both cases the behaviour should match cat > file.

Additional context

Tasks

  1. Implement secrets read command.
  2. Implement secret write command.
  3. create tests demonstrating behaviour for read.
  4. create tests demonstrating behaviour for write.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions