mfer/proto/mf.proto

70 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "git.eeqj.de/sneak/mfer/mfer";
import "google/protobuf/timestamp.proto";
message MFFile {
enum Version {
NONE = 0;
ONE = 1; // only one for now
}
// required mffile root attributes 1xx
required Version version = 101;
required bytes innerMessage = 102;
// these are used solely to detect corruption/truncation
// and not for cryptographic integrity.
required uint64 size = 103;
required bytes sha256 = 104;
// 2xx for optional manifest root attributes
// think we might use gosignify instead of gpg:
// github.com/frankbraun/gosignify
//detached signature, ascii or binary
bytes signature = 201;
//full GPG key id
bytes signer = 202;
//full GPG signing public key, ascii or binary
bytes signingPubKey = 203;
}
message MFFilePath {
// required attributes:
required string path = 101;
required uint64 size = 102;
// gotta have at least one:
required repeated MFFileChecksum hashes = 201;
// optional per-file metadata
string mimeType = 301;
google.protobuf.Timestamp mtime = 302;
google.protobuf.Timestamp ctime = 303;
google.protobuf.Timestamp atime = 304;
}
message MFFileChecksum {
// 1.0 golang implementation must write a multihash here
// it's ok to only ever use/verify sha256 multihash
required bytes multiHash = 1;
}
message MFFileInner {
enum Version {
NONE = 0;
ONE = 1; // only one for now
}
required Version version = 101;
// required manifest attributes:
required uint64 fileCount = 102; //FIXME is this necessary?
required repeated MFFilePath files = 103;
// optional manifest attributes 2xx:
google.protobuf.Timestamp createdAt = 201;
}