I've been going over the new secrets commands to see if they function as expected. I'll be outlining problems I find here. I'm not considering any localpath to vault crossover for now.
Make sure all errors exit with the code that matches the unix command.
General questions
How should we format the errors. I want to have fs style errors match the unix commands way of doing it. such as rm: cannot remove 'nodir': No such file or directory. However what if the error is a missing vault? Should we format that better than we are right now? Keep it more inline with the fs style error formatting?
How do we want to handle ../ in paths that point outside of the root tree for the vault. Writing treats it as in the root directory. But ls will append the ../ paths to the file names. The ls behaviour needs to be changed but is the write behaviour allowed?
write
expectations
[X] 1. no args gives help text. vault and path must be provided.
[ ] 2. existing vault with no path should give EISDIR type error. before allowing input
[X] 3. non-existing vault with no path errors should give a ErrorVaultsVaultUndefined error. Before providing input.
[X] 4. writing to an existing secret should work and overwrite the file.
[X] 5. Writing to a new file should create it.
[X] 6. Writing without a newline should not add it.
[ ] 7. Providing multiple args should error with help - Its writing the first path provided.
[ ] 8. We should properly handle ../ paths. - Works but treats it as the root directory. Do we allow this or explicitly not allow the path?
rm
[x] 1. no args gives help text. vault and path must be provided.
[ ] 2. Specifying existing vaultname should... - How do we want to handle this? We want to treat it as the root directory so we have 3 options. Don't allow it at all with a isRootDir error or something, Allow it but special case to delete the vault if empty of recursive set. Or allow but special case to just delete all root contents.
[ ] 3. Specifying a not existing vault name should error with a vaults ErrorVaultsVaultUndefined error. - Right now it's giving a EPERM cannot remove vault root error message. (addressed in Polykey#838)
[X] 4. Can remove a single file
[X] 5. Can remove multiple files
[X] 6. Can remove multiple files across vaults
[ ] 7. remove from non existing dir should give formatted ENOENT - gives error but not the expected formatting (addressed in Polykey-CLI#320)
[X] 8. remove empty dir without complaint.
[ ] 9. remove full dir should error with formatted is a directory - Got error but not expected format. (addressed in Polykey-CLI#320)
[X] 10. remove full dir with recursive.
[ ] 11. Multiple paths should handle non existing path with formatted error (addressed in Polykey-CLI#320 and Polykey#838)
[ ] 12. Multiple paths should handle directory with formatted error. (addressed in Polykey-CLI#320 and Polykey#838)
edit
[X] 1. no args gives help text
[ ] 2. with exsting vault should give formatted EISDIR error - getting a bad error TypeError: The "path" argument must be of type string. Received undefined (addressed in Polykey#838)
[ ] 3. with non existing vault should give a vaults undefined error - getting a bad error TypeError: The "path" argument must be of type string. Received undefined (addressed in Polykey#838)
[X] 4. create new file
[X] 5. existing file includes existing contents and is modified
[X] 6. create new file in directory
[ ] 7. create new file in non existing directory should error before editing - opens editor and fails with undefined.
[ ] 8. Keeping the editor open will result in a websocket connection timeout after a while. This needs to be fixed. (addressed in Polykey-CLI#320)
cat
[X] 1. no args gives help text
[X] 2. with exsting vault should give EISDIR formatted error
[X] 3. with non existing vault should give vaults undefined error - Should we treat this as a non existing path?
[X] 4. non existing file should give formatted ENOENT error
[X] 5. Existing file should output contents
[X] 6. Multiple files should output contents concantiated together
[X] 7. Files across vaults should work like multiple files.
[X] 8. file in directory should output contents
[X] 9. directory should give EISDIR formatted error
[X] 10. non exsting file in non existing directory
[X] 11. multiple paths include non existing path
[X] 12. multiple paths include directory
ls
I'm not sure we added multiple path support to ls yet.
[X] 1. No args gives help text.
[X] 2. existing vault should list vaults contents
[X] 3. non existing vault should give vaults undefined error. - should we treat this as a non existing path?
[ ] 4. non existing path should give ENOENT error - theres an error but it's badly formatted
[ ] 5. exiting file should just list itself - giving a not a directory error.
[ ] 6. multiple files should list themselves - giving a not a directory error
[ ] 7. listing should work across vaults - only list the first argument
[X] 8. directory should list contents
[ ] 9. non existing path inside non existing directory should ENOENT formatted error - gives a badly formatted error
[ ] 10. handles multiple paths with non existing path and directory - multiple paths not supported
This still needs work to support multiple paths.
mkdir
Need to fill this in.
Be sure to add onto the lists if you think of any checks to do.
Additional context
Tasks
Run through the list and check the problems
Group problems into child-issues. Use your best judgement here but per command is probably the best way to break it down unless the problem applies to multiple commands at once.
Specification
I've been going over the new secrets commands to see if they function as expected. I'll be outlining problems I find here. I'm not considering any localpath to vault crossover for now.
General questions
rm: cannot remove 'nodir': No such file or directory
. However what if the error is a missing vault? Should we format that better than we are right now? Keep it more inline with the fs style error formatting?../
in paths that point outside of the root tree for the vault. Writing treats it as in the root directory. But ls will append the../
paths to the file names. The ls behaviour needs to be changed but is the write behaviour allowed?write
expectations
ErrorVaultsVaultUndefined
error. Before providing input.../
paths. - Works but treats it as the root directory. Do we allow this or explicitly not allow the path?rm
isRootDir
error or something, Allow it but special case to delete the vault if empty of recursive set. Or allow but special case to just delete all root contents.ErrorVaultsVaultUndefined
error. - Right now it's giving a EPERM cannot remove vault root error message. (addressed in Polykey#838)edit
TypeError: The "path" argument must be of type string. Received undefined
(addressed in Polykey#838)TypeError: The "path" argument must be of type string. Received undefined
(addressed in Polykey#838)undefined
.cat
ls
I'm not sure we added multiple path support to ls yet.
This still needs work to support multiple paths.
mkdir
Be sure to add onto the lists if you think of any checks to do.
Additional context
Tasks