Use tar
archival format to transfer file tree structure and data between Polykey vaults and local file systems
#811
Labels
Specification
There are times when we need to transfer the secrets from a vault to either another vault or the user's file system. Sometimes, only one secret needs to be transferred. Other times, we need to transfer multiple file trees including their directory structure.
As all the vaults are stored on the same encrypted file system (
efs
), to transfer file trees between vaults, we only need to use regular file copying/moving operations on file systems; something along the lines offs.promises.copy()
should work well to transfer secrets between vaults.However, doing this between the vaults and the user's file system is not as straightforward. To efficiently transmit the file tree, we will be using an archival format like
tar
. Thetar
archival format is inherently streamable, and can be used to zip the file tree into a single file, which can then be transmitted over a RPC call, then be unpacked on the client, effectively transferring the file structure to the user's file system. Of course, we can also compress the resulting file, but we won't get into that quite yet.Additional context
tar
from a file system.tar
bindings for JavaScript.Tasks
fs
operations. Multiple locks might be required if transferring between multiple vaults.The text was updated successfully, but these errors were encountered: