mirror of
https://github.com/logos-messaging/chat_proto.git
synced 2026-01-07 07:23:07 +00:00
refactor protos
This commit is contained in:
parent
1fb7f61407
commit
247323fd6c
@ -1,68 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package umbra.base;
|
||||
|
||||
import "encryption.proto";
|
||||
import "invite.proto";
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Protocol Frames
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
message InboxV1Frame {
|
||||
string recipient = 1;
|
||||
// string conversation_type = 2;
|
||||
oneof frame_type {
|
||||
invite.InvitePrivateV1 invite_private_v1 = 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SDS Payloads
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
message HistoryEntry {
|
||||
string message_id = 1; // Unique identifier of the SDS message, as defined in `Message`
|
||||
bytes retrieval_hint = 2; // Optional information to help remote parties retrieve this SDS
|
||||
// message; For example, A Waku deterministic message hash or routing payload hash
|
||||
}
|
||||
|
||||
message ReliableBytes {
|
||||
string message_id = 2;
|
||||
string channel_id = 3;
|
||||
int32 lamport_timestamp = 10;
|
||||
repeated HistoryEntry causal_history = 11;
|
||||
bytes bloom_filter = 12;
|
||||
bytes content = 20;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Encryption
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// TODO: This also encompasses plaintexts, is there a better name?
|
||||
// Alternatives: ???
|
||||
message EncryptedBytes {
|
||||
|
||||
oneof encryption {
|
||||
encryption.Plaintext plaintext = 1;
|
||||
encryption.Ecies ecies = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Payload Framing Messages
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
message UmbraEnvelopeV1 {
|
||||
|
||||
string conversation_hint = 1;
|
||||
uint64 salt = 2;
|
||||
|
||||
bytes payload = 5;
|
||||
}
|
||||
@ -3,6 +3,16 @@ syntax = "proto3";
|
||||
package umbra.encryption;
|
||||
|
||||
|
||||
// TODO: This also encompasses plaintexts, is there a better name?
|
||||
// Alternatives: ???
|
||||
message EncryptedPayload {
|
||||
|
||||
oneof encryption {
|
||||
encryption.Plaintext plaintext = 1;
|
||||
encryption.Ecies ecies = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message Plaintext {
|
||||
bytes payload=1;
|
||||
}
|
||||
|
||||
16
proto/umbra/envelope.proto
Normal file
16
proto/umbra/envelope.proto
Normal file
@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package umbra.envelope;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Payload Framing Messages
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
message UmbraEnvelopeV1 {
|
||||
|
||||
string conversation_hint = 1;
|
||||
uint64 salt = 2;
|
||||
|
||||
bytes payload = 5;
|
||||
}
|
||||
12
proto/umbra/inbox.proto
Normal file
12
proto/umbra/inbox.proto
Normal file
@ -0,0 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package umbra.inbox;
|
||||
|
||||
import "invite.proto";
|
||||
|
||||
message InboxV1Frame {
|
||||
string recipient = 1;
|
||||
oneof frame_type {
|
||||
invite.InvitePrivateV1 invite_private_v1 = 10;
|
||||
}
|
||||
}
|
||||
23
proto/umbra/reliability.proto
Normal file
23
proto/umbra/reliability.proto
Normal file
@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package umbra.reliability;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SDS Payloads
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
message HistoryEntry {
|
||||
string message_id = 1; // Unique identifier of the SDS message, as defined in `Message`
|
||||
bytes retrieval_hint = 2; // Optional information to help remote parties retrieve this SDS
|
||||
// message; For example, A Waku deterministic message hash or routing payload hash
|
||||
}
|
||||
|
||||
message ReliablePayload {
|
||||
string message_id = 2;
|
||||
string channel_id = 3;
|
||||
int32 lamport_timestamp = 10;
|
||||
repeated HistoryEntry causal_history = 11;
|
||||
bytes bloom_filter = 12;
|
||||
// Optional field causes errors in nim protobuf generation. Removing for now as optional is implied anways.
|
||||
bytes content = 20;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user