Cleanup + proto update + Peers functions

This commit is contained in:
ycc
2022-09-18 18:09:27 +02:00
parent 4b20844e51
commit 01aec23f76
7 changed files with 451 additions and 602 deletions

View File

@ -2,93 +2,86 @@ syntax = "proto3";
package meowlib;
option go_package = "forge.redroom.link/yves/meowlib";
// structure for sending a message intended for server use in protobuf format
// structure definnig a message as received by a server in protobuf format
message PackedServerMessage {
string From = 1;
bytes Payload = 2;
bytes Signature = 3;
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
}
// structure for sending a message to be forwarded to another user in protobuf format
message PackedUserMessage {
string From = 1;
string Destination=2;
bytes Payload=3;
bytes Signature=4;
}
// structure defining a message encrypted, then sent in a "packedmessage" payload
// structure defining a message for a server, that will be encrypted, then sent in a "packedmessage" payload
message ToServerMessage {
string Type = 1; // Type
string ServerPubKey = 2 ; // My pub key for the server to send me an encrypter answer
bytes Payload = 3 ; // optional payload for server
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
message ConversationRequest { // Structure for requestion incoming messages
// structure for requesting incoming messages
message ConversationRequest {
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 ?
string lastServerUuidOK = 2; // Last Server message UUID received (send me all after that one)
bool publishOnline = 3; // ?? Publish my online status for that contact ?
string lookupSignature = 4; // prove that I own the private key by signing that block
}
repeated ConversationRequest PullRequest = 7;
repeated ConversationRequest pullRequest = 4;
repeated PackedUserMessage messages = 5;
repeated Server knownServers = 6;
message PostedMessage{
string lookupKey= 1;
repeated PackedUserMessage Messages = 2;
}
repeated PostedMessage Messages = 9;
string NextServerKey = 10;
string Url = 11;
}
// structure defining a from serve receiver message decrypted from a "packedmessage" payload
// structure defining a from server receiver message decrypted from a "packedmessage" payload
message FromServerMessage {
string Type = 1; // Type
string ServerPubKey = 2 ; // My pub key for the server to send me an encrypter answer
bytes Payload = 3 ; //
uint64 ServerReceived = 4 ;
string ServerUuid = 5 ;
string type = 1; // Type
string serverPubKey = 2 ; // My pub key for the server to send me an encrypter answer
bytes payload = 3 ; //
uint64 serverReceived = 4 ;
string serverUuid = 5 ;
message ConversationResponse {
repeated string MessageUuids = 1;
repeated string messageUuids = 1;
}
map<string,ConversationResponse> PullResponse = 8;
map<string,ConversationResponse> pullResponse = 6;
message PostedMessage{
string lookupKey= 1;
repeated PackedUserMessage Messages = 2;
repeated PackedUserMessage messages = 2;
}
repeated PostedMessage Messages = 9;
string NextServerKey = 10;
string Url = 11;
repeated PostedMessage chat = 7;
}
// structure describing required server attributes
message Server {
string Name = 1;
string Description=2;
string PublicKey = 3;
string Url = 4;
int32 ConfidenceLevel = 5;
string name = 1;
string description=2;
string publicKey = 3;
string url = 4;
int32 confidenceLevel = 5;
}
// structure describing a user contact card ie the minimum set of attributes for exchanging identities
message ContactCard {
string name=1;
string contactPublicKey =2;
string encryptionPublicKey= 3;
string lookupPublicKey =4;
repeated Server PullServers =5;
repeated Server pullServers =5;
int32 version = 6;
}
message MinimalContact {
string name=1;
string publicKey=2;
repeated Server TrustedServers = 3;
// 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
}
// structure defining information that might be exchanged between two peers.
message UserMessage {
string Destination = 1;
string From = 2;
string Type = 3;
@ -99,21 +92,18 @@ message UserMessage {
uint64 Sent = 3 ;
uint64 Received = 4;
uint64 Processed = 5;
string NextCkey = 6; // contact key
bool NextCkeyAck = 7; // false when proposing a new id, true for accepting it
string NextEkey = 8; // encryption key
bool NextKeyEkeyAck = 9; // false when proposing a new key, true for accpeting it
string NextLkey = 10; // lookup key
bool NextLkeyAck = 11; // false when proposing a new id, true for accepting it
}
ContactCard myNextIdentity = 6;
int32 peerNextIdentityAck = 7; // version of the new peed accepted id
}
ConversationStatus Status = 5;
ContactCard contact = 6;
MinimalContact contact = 6;
Server knownServers = 7;
message Group{
string name=1;
repeated MinimalContact members = 2;
repeated ContactCard members = 2;
}
Group group = 7;
Group group = 8;
}