Signal-iOS/SignalServiceKit/protobuf/StorageService.proto

94 lines
2.0 KiB
Protocol Buffer

//
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
// iOS - since we use a modern proto-compiler, we must specify
// the legacy proto format.
syntax = "proto2";
// iOS - package name determines class prefix
package StorageServiceProtos;
message StorageItem {
// @required
optional bytes key = 1; // Randomly generated 16-byte value
// @required
optional bytes value = 2; // Encrypted serialized bytes
}
message StorageManifest {
// @required
optional uint64 version = 1; // Monotonically increasing value
// @required
optional bytes value = 2; // Encrypted serialized bytes
}
message StorageItems {
repeated StorageItem items = 1; // Corresponds to the requested
// keys that were found
}
message ReadOperation {
repeated bytes readKey = 1;
}
message WriteOperation {
optional StorageManifest manifest = 1;
repeated StorageItem insertItem = 2;
repeated bytes deleteKey = 3;
}
message StorageRecord {
enum Type {
UNKNOWN = 0;
CONTACT = 1;
GROUPV1 = 2;
}
// @required
optional uint32 type = 1;
optional ContactRecord contact = 2;
optional GroupV1Record groupV1 = 3;
}
message ContactRecord {
message Identity {
enum State {
DEFAULT = 0;
VERIFIED = 1;
UNVERIFIED = 2;
}
optional bytes key = 1;
optional State state = 2;
}
message Profile {
optional string givenName = 1;
optional bytes key = 2;
optional string username = 3;
optional string familyName = 4;
}
optional string serviceUuid = 1;
optional string serviceE164 = 2;
optional Profile profile = 3;
optional Identity identity = 4;
optional bool blocked = 5;
optional bool whitelisted = 6;
optional string nickname = 7;
}
message GroupV1Record {
// @required
optional bytes id = 1;
optional bool blocked = 2;
optional bool whitelisted = 3;
}
message ManifestRecord {
// @required
optional uint64 version = 1;
repeated bytes keys = 2;
}