Skip to content

Commit

Permalink
Merge pull request #152 from xmtp/st/add-message-backups
Browse files Browse the repository at this point in the history
Add message backup request and response
  • Loading branch information
tuddman authored Mar 25, 2024
2 parents 44bec69 + 1d7e4e4 commit d6448a1
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 28 deletions.
2 changes: 1 addition & 1 deletion go/keystore_api/v1/keystore.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_api/v1/authn.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_api/v1/message_api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_api/v1/message_api_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/ciphertext.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/composite.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/contact.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/content.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/conversation_reference.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/invitation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions go/message_contents/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/private_key.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/public_key.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/message_contents/signature.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/mls/api/v1/mls.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/mls/api/v1/mls_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/mls_validation/v1/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/mls_validation/v1/service_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions proto/message_contents/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ message MessageHeaderV1 {

// Message is the top level protocol element
message MessageV1 {
bytes header_bytes = 1; // encapsulates encoded MessageHeaderV1
// encapsulates encoded MessageHeaderV1
bytes header_bytes = 1;
// Ciphertext.payload MUST contain encrypted EncodedContent
Ciphertext ciphertext = 2;
}
Expand All @@ -42,12 +43,15 @@ message MessageHeaderV2 {

// Message combines the encoded header with the encrypted payload.
message MessageV2 {
bytes header_bytes = 1; // encapsulates encoded MessageHeaderV2
// encapsulates encoded MessageHeaderV2
bytes header_bytes = 1;
// Ciphertext.payload MUST contain encrypted SignedContent
Ciphertext ciphertext = 2;
// HMAC of the message ciphertext, with the HMAC key derived from the topic key
// HMAC of the message ciphertext, with the HMAC key derived from the topic
// key
optional bytes sender_hmac = 3;
// Flag indicating whether the message should be pushed from a notification server
// Flag indicating whether the message should be pushed from a notification
// server
optional bool should_push = 4;
}

Expand Down
32 changes: 30 additions & 2 deletions proto/mls/message_contents/content.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ option java_package = "org.xmtp.proto.mls.message.contents";

// ContentTypeId is used to identify the type of content stored in a Message.
message ContentTypeId {
string authority_id = 1; // authority governing this content type
string type_id = 2; // type identifier
string authority_id = 1; // authority governing this content type
string type_id = 2; // type identifier
uint32 version_major = 3; // major version of the type
uint32 version_minor = 4; // minor version of the type
}
Expand Down Expand Up @@ -52,7 +52,35 @@ message PlaintextEnvelope {
string idempotency_key = 2;
}

// Version 2 of the encrypted envelope
message V2 {
oneof message_type {
// Expected to be EncodedContent
bytes content = 1;
// Initiator sends the request to receive history
MessageHistoryRequest message_history_request = 2;
// Other credentialed party sends response
MessageHistoryResponse message_history_response = 3;
}
}

// Selector which declares which version of the EncodedContent this
// PlaintextEnvelope is
oneof content {
V1 v1 = 1;
V2 v2 = 2;
}
}

// The initiator or new installation id that is requesting a history will send a
// request
message MessageHistoryRequest { string request_id = 1; }

// Pre-existing installation id that is capable of supplying a history will send
// this response
message MessageHistoryResponse {
string request_id = 1;
string backup_url = 2;
bytes backup_file_hash = 3;
int64 expiration_time_ns = 4;
}

0 comments on commit d6448a1

Please sign in to comment.