To properly create a new drive, two new entities need to be created, a new Drive entity and a new Folder entity representing the root folder of that drive.
New Drive Entity
The user must specify a
name
of the drive which is stored within the Drive Entity’s metadata JSON.ArDrive generates a new unique uuidv4 for the drive entity’s
Drive-Id
ArDrive also generates a new unique uuidv4 for the drive entity’s
rootFolderId
, which will refer to theFolder-Id
of the new folder entity that will be created.This
rootFolderId
is stored within the Drive Entity’s metadata JSON.
Drive Entity Metadata transactions must have
Entity-Type: "drive"
ArDrive will take the current local system time as seconds since Unix epoch for the drive entity’s
Unix-Time
The drive's entity’s
Drive-Privacy
must also be set topublic
orprivate
in order for its subfolders and files to have the right security settings.If the drive is private
its
Cipher
tag must be filled out with the respective encryption algorithm (currentlyAES256-GCM
)its
Cipher-IV
tag must be filled out with the generated Initialization Vector for the private file.The ArFS client must derive the Drive Key and encrypt the Drive entity’s metadata JSON using the assigned
Cipher
andCipher-IV
New Root Folder Entity
The
name
of the drive and folder entity must be the same.This
name
is stored within the Folder Entity’s metadata JSON.
The folder entity’s
Folder-Id
must match therootFolderId
previously created for the Drive EntityThe folder entity’s
Drive-Id
must match theDrive-Id
previously created for the Drive EntityThe folder entity must not include a
Parent-Folder-Id
tag.This is how it is determined to be the root folder for a drive
Folder Entity Metadata transactions must have
Entity-Type: "folder"
The client gets the user’s local time for the
Unix-Time
tag, represented as Seconds Since Unix Epoch.Public folders must have the following content type
Content-Type: "application/json"
If the folder is private
Its
Cipher
tag must be filled out with the respective encryption algorithm (currentlyAES256-GCM
)Its
Cipher-IV
tag must be filled out with the generated Initialization Vector for the private folder.It must have the following content type
Content-Type: "application/octet-stream"
The ArFS client must encrypt the Drive entity’s metadata JSON using the assigned
Cipher
andCipher-IV
Comments
0 comments
Please sign in to leave a comment.