Skip to content

Commit

Permalink
Merge pull request #178 from xmtp/insipx/validate-cred
Browse files Browse the repository at this point in the history
Protos for credential validation of Inbox IDs
  • Loading branch information
insipx authored May 8, 2024
2 parents 9be1dcf + 9361fe2 commit 680f802
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions proto/mls_validation/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package xmtp.mls_validation.v1;

import "identity/associations/association.proto";
import "identity/credential.proto";

option go_package = "github.com/xmtp/proto/v3/go/mls_validation/v1";

Expand All @@ -16,6 +17,27 @@ service ValidationApi {

// Gets the final association state for a batch of identity updates
rpc GetAssociationState(GetAssociationStateRequest) returns (GetAssociationStateResponse) {}

// Validates InboxID key packages and returns credential information for them, without checking
// whether an InboxId <> InstallationPublicKey pair is really valid.
rpc ValidateInboxIdKeyPackages(ValidateKeyPackagesRequest) returns (ValidateInboxIdKeyPackagesResponse) {}

// Validate an InboxID Key Package
// need public key possibly
rpc ValidateInboxIds(ValidateInboxIdsRequest) returns (ValidateInboxIdsResponse) {}
}

// Validates a Inbox-ID Key Package Type
message ValidateInboxIdKeyPackagesResponse {
// one response corresponding to information about one key package
message Response {
bool is_ok = 1;
string error_message = 2;
xmtp.identity.MlsCredential credential = 3;
bytes installation_public_key = 4;
}

repeated Response responses = 1;
}

// Contains a batch of serialized Key Packages
Expand Down Expand Up @@ -78,3 +100,28 @@ message GetAssociationStateResponse {
xmtp.identity.associations.AssociationState association_state = 1;
xmtp.identity.associations.AssociationStateDiff state_diff = 2;
}

// Request to validate an InboxID with the backend service. Ensures an Inbox Id <> Installation key are valid.
message ValidateInboxIdsRequest {
// a single validation request
message ValidationRequest {
xmtp.identity.MlsCredential credential = 1;
bytes installation_public_key = 2;
repeated xmtp.identity.associations.IdentityUpdate identity_updates = 3;
}

// list of validation requests
repeated ValidationRequest requests = 1;
}

// Response to ValidateInboxIdRequest
message ValidateInboxIdsResponse {
// a single validation response
message ValidationResponse {
bool is_ok = 1;
string error_message = 2;
string inbox_id = 3;
}
// List of validation responses
repeated ValidationResponse responses = 1;
}

0 comments on commit 680f802

Please sign in to comment.