Skip to content

Implement secrets cat command #243

Closed
@tegefaulkes

Description

@tegefaulkes

Specification

As per the #32 issue refactor, we need to implement a simplified cat command as secrets cat.

This will function identically to cat while omitting some of the options for now. It pretty much combines the functionality of read and write commands along with the concatination cat is known for.

Uses are

  1. read the contents of a secret secrets cat secretPath or file secrets cat filePath.
  2. write the stdin to a secret cat > secretPath or file cat > filePath. stdin will support pipes as well.
  3. concatenating files together in the output. secrets cat secretPath filePath secretPath/*.

Pretty much the the functionality boils down to two things

  1. Will output the contents of all specified files to stdout in the order they are specified.
  2. If no files are specified then it will just output stdin to stdout.

Redirection into a secret path might not be possible with how commander parses inputs and how shell works, at least, not with the cat > secretPath syntax. We'll need to prototype that. If it doesn't work, we'd have to use an option --redirect secretPath to enable the functionality. (see comment)

Additional context

Tasks

  1. Create a secrets cat command
  2. If no arguments are provided it will take stdin and output to stdout.
  3. If arguments are provided it will write their contents to stdout in the order they are provided.
  4. Support specifying normal files along side secret paths.
  5. Support specifying wildcards and possibly globbing for the paths.
  6. Support redirecton into a secret using secretPath syntax. Failing that provide an option that handles that behaviour. (see comment)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions