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 mkdir command #246

Closed
tegefaulkes opened this issue Jul 11, 2024 · 4 comments
Closed

Implement secrets mkdir command #246

tegefaulkes opened this issue Jul 11, 2024 · 4 comments
Assignees
Labels
development Standard development

Comments

@tegefaulkes
Copy link
Contributor

Specification

secrets mkdir is pretty simple, it will create a directory at the specified paths.

  1. Creates a directory at the specified path.
  2. Can take multiple paths to create multiple directories.
  3. Does not support wildcards or globing
  4. If a parent directory of a path doesn't exist then it will throw ENOENT
  5. If -p is specified then it will create missing parent directories.

Additional context

Related #32

Tasks

  1. Implement secrets mkdir command
  2. Supports multiple paths for creation.
  3. Supports -p flag for recursively creating directories.
  4. Can take either normal paths or secret paths.
@tegefaulkes tegefaulkes added the development Standard development label Jul 11, 2024
Copy link

linear bot commented Jul 11, 2024

Copy link
Contributor

aryanjassal commented Oct 1, 2024

UNIX mkdir doesn't stop on error. It keeps going, making what directories it can make, leaving what it cannot. I think that instead of returning an ENOENT or other error, it should catch it, and ignore it, returning an error string that can be printed out instead.

Currently, we just return a success message. Instead of that, we can use duplex streaming to return an error message or success flag every time a directory is created, or we can accumulate the errors and return them in one large chunk at the end of the whole process.

I would also need to make a new vaultOps for returning an error string instead of throwing an error, so if one path is invalid in multiple vaults, it won't stop creating more paths, but return an error string instead, and continue. Either this, or I can implement a flag to continue on errors in the existing vaultOps.mkdir.

I need some inputs on this.

@tegefaulkes
Copy link
Contributor Author

tegefaulkes commented Oct 1, 2024

Go with the duplex method then. Keep in mind that you may need to support making directories across multiple vaults at once. And multiple directories in a single vault must be done in a single commit in the vault. That will affect how you implement things.

@aryanjassal
Copy link
Contributor

Go with the duplex method then. Keep in mind that you may need to support making directories across multiple vaults at once. And multiple directories in a single vault must be done in a single commit in the vault. That will affect how you implement things.

Yes, I am taking inspiration from how I handled this in VaultsSecretsRemove to delete files from all vaults in a single commit.

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