update file format a bit

This commit is contained in:
Jeffrey Paul 2021-11-03 03:49:40 -07:00
parent 38df94a9b2
commit 92b92c190d

View File

@ -3,33 +3,34 @@ syntax = "proto3";
option go_package = "mfer"; option go_package = "mfer";
message MFFile { message MFFile {
enum Version { enum Version {
NONE = 0; NONE = 0;
ONE = 1; // only one for now ONE = 1; // only one for now
} }
Version version = 1; Version version = 1;
bytes innerMessage = 2; bytes innerMessage = 2;
// these are used solely to detect corruption/truncation // these are used solely to detect corruption/truncation
// and not for cryptographic integrity. // and not for cryptographic integrity.
uint64 size = 3; uint64 size = 3;
bytes sha256 = 4; bytes sha256 = 4;
// think we might use gosignify instead of gpg: // think we might use gosignify instead of gpg:
// github.com/frankbraun/gosignify // github.com/frankbraun/gosignify
//detached signature, ascii or binary //detached signature, ascii or binary
optional bytes signature = 5; optional bytes signature = 5;
//full GPG key id //full GPG key id
optional bytes signer = 6; optional bytes signer = 6;
//full GPG signing public key, ascii or binary //full GPG signing public key, ascii or binary
optional bytes signingPubKey = 7; optional bytes signingPubKey = 7;
} }
message MFFilePath { message MFFilePath {
string path = 1; string path = 1;
uint64 size = 2;
// when verifying, count(hashes) must be > 0. // when verifying, count(hashes) must be > 0.
optional repeated MFFileChecksum hashes = 2; optional repeated MFFileChecksum hashes = 201;
optional string mimeType = 101; optional string mimeType = 101;
optional string mtime = 102; optional string mtime = 102;
optional string ctime = 103; optional string ctime = 103;
@ -42,11 +43,11 @@ message MFFileChecksum {
} }
message MFFileInner { message MFFileInner {
enum Version { enum Version {
NONE = 0; NONE = 0;
ONE = 1; // only one for now ONE = 1; // only one for now
} }
Version version = 1; Version version = 1;
uint64 count = 2; uint64 count = 2;
repeated MFFilePath files = 3; repeated MFFilePath files = 3;
} }