meowlib/pb/messages.proto

110 lines
3.6 KiB
Protocol Buffer
Raw Normal View History

2022-01-15 22:19:29 +01:00
syntax = "proto3";
package meowlib;
option go_package = "forge.redroom.link/yves/meowlib";
// structure definnig a message as received by a server in protobuf format
2022-01-15 22:19:29 +01:00
message PackedServerMessage {
string from = 1; // The client public key for that server to get an answer
bytes payload = 2; // The ToServerMessage encrypted with the server public key
bytes signature = 3; // The message signature with the client public key
2022-01-15 22:19:29 +01:00
}
// structure defining a message for a server, that will be encrypted, then sent in a "packedmessage" payload
2022-09-05 14:09:39 +02:00
message ToServerMessage {
string type = 1; // Type
string from = 2 ; // My pub key for the server to send me an encrypter answer
bytes payload = 3 ; // optional payload for server
2022-01-15 22:19:29 +01:00
// structure for requesting incoming messages
message ConversationRequest {
2022-09-05 14:09:39 +02:00
string lookupKey = 1; // lookup key for a conversation
string lastServerUuidOK = 2; // Last Server message UUID received (send me all after that one)
bool publishOnline = 3; // ?? Publish my online status for that contact ?
2022-09-05 14:09:39 +02:00
string lookupSignature = 4; // prove that I own the private key by signing that block
2022-01-15 22:19:29 +01:00
}
repeated ConversationRequest pullRequest = 4;
repeated PackedUserMessage messages = 5;
repeated Server knownServers = 6;
string uuid = 7;
2022-09-05 14:09:39 +02:00
}
// structure defining a from server receiver message decrypted from a "packedmessage" payload
2022-09-05 14:09:39 +02:00
message FromServerMessage {
string type = 1; // Type
string serverPublicKey = 2 ; // Pub key from the server
bytes payload = 3 ; //
string uuidAck = 4 ; // Ack for the last received ToServerMessage Uuid
string serverUuid = 5 ; // Provides the server uuid that replaced the client uuid
2022-09-05 14:09:39 +02:00
2022-01-15 22:19:29 +01:00
message ConversationResponse {
repeated string messageUuids = 1;
2022-01-15 22:19:29 +01:00
}
map<string,ConversationResponse> pullResponse = 6;
2022-01-15 22:19:29 +01:00
message PostedMessage{
2022-09-05 14:09:39 +02:00
string lookupKey= 1;
repeated PackedUserMessage messages = 2;
2022-01-15 22:19:29 +01:00
}
repeated PostedMessage chat = 7;
2022-01-15 22:19:29 +01:00
}
// structure describing required server attributes
2022-01-15 22:19:29 +01:00
message Server {
string name = 1;
string description=2;
string publicKey = 3;
string url = 4;
int32 confidenceLevel = 5;
2022-01-15 22:19:29 +01:00
}
// structure describing a user contact card ie the minimum set of attributes for exchanging identities
2022-09-06 09:30:45 +02:00
message ContactCard {
string name=1;
string contactPublicKey =2;
string encryptionPublicKey= 3;
string lookupPublicKey =4;
repeated Server pullServers =5;
int32 version = 6;
2022-09-06 09:30:45 +02:00
}
// structure for sending a message to be forwarded to another user in protobuf format
message PackedUserMessage {
string from = 1; // the client identity public key as known by the destination peer
string destination=2; // the peer's current conversation lookup public key
bytes payload=3; // the message UserMessage encrypted with the destination peer's public key
bytes signature=4; // the payload signature with the client identity private key
2022-01-15 22:19:29 +01:00
}
// structure defining information that might be exchanged between two peers.
2022-01-15 22:19:29 +01:00
message UserMessage {
string Destination = 1;
string From = 2;
string Type = 3;
bytes Data = 4;
message ConversationStatus {
string LocalUuid = 1;
uint64 LocalSequence = 2 ;
uint64 Sent = 3 ;
uint64 Received = 4;
uint64 Processed = 5;
ContactCard myNextIdentity = 6;
int32 peerNextIdentityAck = 7; // version of the new peed accepted id
}
2022-01-15 22:19:29 +01:00
ConversationStatus Status = 5;
ContactCard contact = 6;
2022-01-15 22:19:29 +01:00
Server knownServers = 7;
2022-01-15 22:19:29 +01:00
message Group{
string name=1;
repeated ContactCard members = 2;
2022-01-15 22:19:29 +01:00
}
Group group = 8;
2022-01-15 22:19:29 +01:00
}