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

Implement secrets mv command #248

Open
tegefaulkes opened this issue Jul 11, 2024 · 1 comment
Open

Implement secrets mv command #248

tegefaulkes opened this issue Jul 11, 2024 · 1 comment
Assignees
Labels
development Standard development

Comments

@tegefaulkes
Copy link
Contributor

Specification

The secrets mv command is a pretty important one. It will be the main way of moving secrets in and out of vaults. Moving into or between vaults would be very useful. Moving out of a vault will be less so I think but supported all the same.

mv has the following features we want to support.

  1. Move a file or directory to a destination directory.
  2. Multiple source paths can be specified. the last argument is the destination.
  3. Globing and wildcards are supported for sources.
  4. Globing is supported for the destination. but only the last of the list is the destination. I say we don't support it.

This one will be pretty complex to implement. A lot of the useful functionality will be from the wildcards and globing so we need to support that well. On top of that we need a way to serialise all the found files and directories over the RPC.

So we need the following.

  1. A generic fs walker that translates wildcards and globing into a fs tree and their contents. It needs to work on the fs and efs.
  2. Transformers that convert the file trees and contents into a raw binary stream and back. We'll need to design it as parser/generator using the standards we've used before.

One thing to note, moving a file generally is atomic and doesn't modify the file. The Inode is unchanged when moving. However when moving in, out and between vaults are essentially different file systems. So moving between them is functionally a copy and delete operation. I believe this is how mv works between drives. Within the same drive the mv operation preserves the file while moving it. Akin to a link to new path and unlink from old path.

Additional context

Related #32

Tasks

  1. Implement a secrets mv command
  2. Supports moving a file from source path to destination.
  3. And take a variable number of source paths with the last path being the destination.
  4. Supports globing and wild cards.
  5. Supports moving directories with contents.
  6. Between filesystems will copy and remove old file. Within a filesystem the Inode should be preserved.
@tegefaulkes tegefaulkes added the development Standard development label Jul 11, 2024
Copy link

linear bot commented Jul 11, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development
Development

No branches or pull requests

2 participants