2021-10-26 09:00:50 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2022-12-09 00:02:33 +00:00
|
|
|
option go_package = "git.eeqj.de/sneak/mfer/mfer";
|
2021-10-26 09:00:50 +00:00
|
|
|
|
2022-02-02 08:26:18 +00:00
|
|
|
message Timestamp {
|
|
|
|
int64 seconds = 1;
|
|
|
|
int32 nanos = 2;
|
|
|
|
}
|
2021-11-03 11:19:42 +00:00
|
|
|
|
2022-12-09 00:02:33 +00:00
|
|
|
message MFFileOuter {
|
2021-11-03 10:49:40 +00:00
|
|
|
enum Version {
|
2022-12-09 00:02:33 +00:00
|
|
|
VERSION_NONE = 0;
|
|
|
|
VERSION_ONE = 1; // only one for now
|
2021-11-03 10:49:40 +00:00
|
|
|
}
|
|
|
|
|
2021-11-03 11:19:42 +00:00
|
|
|
// required mffile root attributes 1xx
|
2022-02-02 07:48:42 +00:00
|
|
|
Version version = 101;
|
2022-12-09 00:02:33 +00:00
|
|
|
|
|
|
|
enum CompressionType {
|
|
|
|
COMPRESSION_NONE = 0;
|
|
|
|
COMPRESSION_GZIP = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
CompressionType compressionType = 102;
|
|
|
|
|
2021-11-03 10:49:40 +00:00
|
|
|
// these are used solely to detect corruption/truncation
|
|
|
|
// and not for cryptographic integrity.
|
2022-12-04 07:59:36 +00:00
|
|
|
int64 size = 103;
|
2022-02-02 07:48:42 +00:00
|
|
|
bytes sha256 = 104;
|
2021-11-03 10:49:40 +00:00
|
|
|
|
2022-12-09 00:02:33 +00:00
|
|
|
bytes innerMessage = 199;
|
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
|
2022-12-04 07:59:36 +00:00
|
|
|
optional bytes signature = 201;
|
2021-11-03 10:49:40 +00:00
|
|
|
//full GPG key id
|
2022-12-04 07:59:36 +00:00
|
|
|
optional bytes signer = 202;
|
2021-11-03 10:49:40 +00:00
|
|
|
//full GPG signing public key, ascii or binary
|
2022-12-04 07:59:36 +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:
|
2022-12-04 07:59:36 +00:00
|
|
|
string path = 1;
|
|
|
|
int64 size = 2;
|
2021-11-03 11:19:42 +00:00
|
|
|
|
|
|
|
// gotta have at least one:
|
2022-12-04 07:59:36 +00:00
|
|
|
repeated MFFileChecksum hashes = 3;
|
2021-11-03 11:19:42 +00:00
|
|
|
|
|
|
|
// optional per-file metadata
|
2022-12-04 07:59:36 +00:00
|
|
|
optional string mimeType = 301;
|
|
|
|
optional Timestamp mtime = 302;
|
|
|
|
optional Timestamp ctime = 303;
|
|
|
|
optional Timestamp atime = 304;
|
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
|
2022-02-02 07:48:42 +00:00
|
|
|
bytes multiHash = 1;
|
2021-10-26 09:00:50 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 00:02:33 +00:00
|
|
|
message MFFile {
|
2021-11-03 10:49:40 +00:00
|
|
|
enum Version {
|
2022-12-09 00:02:33 +00:00
|
|
|
VERSION_NONE = 0;
|
|
|
|
VERSION_ONE = 1; // only one for now
|
2021-11-03 10:49:40 +00:00
|
|
|
}
|
2022-12-04 07:59:36 +00:00
|
|
|
Version version = 100;
|
2021-11-03 11:19:42 +00:00
|
|
|
|
|
|
|
// required manifest attributes:
|
2022-12-04 07:59:36 +00:00
|
|
|
repeated MFFilePath files = 101;
|
2021-11-03 11:19:42 +00:00
|
|
|
|
|
|
|
// optional manifest attributes 2xx:
|
2022-12-04 07:59:36 +00:00
|
|
|
optional Timestamp createdAt = 201;
|
2021-10-26 09:00:50 +00:00
|
|
|
}
|
2021-11-03 11:19:42 +00:00
|
|
|
|