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