diff --git a/proto/message_contents/private_preferences.proto b/proto/message_contents/private_preferences.proto index bde0a8d7..fb278efc 100644 --- a/proto/message_contents/private_preferences.proto +++ b/proto/message_contents/private_preferences.proto @@ -26,6 +26,19 @@ message PrivatePreferencesAction { repeated string wallet_addresses = 1; } + // Allow V3 1:1 direct message (DM) access + message AllowInboxId { + // Add the given inbox id to the allow list + repeated string inbox_ids = 1; + } + + // Deny (block) V3 1:1 direct message (DM) access + message DenyInboxId { + // Add the given inbox id to the deny list + repeated string inbox_ids = 1; + } + + // Allow Group access message AllowGroup { // Add the given group_ids to the allow list @@ -43,6 +56,8 @@ message PrivatePreferencesAction { DenyAddress deny_address = 2; AllowGroup allow_group = 3; DenyGroup deny_group = 4; + AllowInboxId allow_inbox_id = 5; + DenyInboxId deny_inbox_id = 6; } } diff --git a/proto/mls/message_contents/group_metadata.proto b/proto/mls/message_contents/group_metadata.proto index 5f77b678..8a39ad48 100644 --- a/proto/mls/message_contents/group_metadata.proto +++ b/proto/mls/message_contents/group_metadata.proto @@ -1,4 +1,4 @@ -// Group metadata +// Group immutable metadata syntax = "proto3"; package xmtp.mls.message_contents; @@ -11,8 +11,7 @@ message GroupMetadataV1 { ConversationType conversation_type = 1; // This will be removed soon string creator_account_address = 2; - PolicySet policies = 3; - string creator_inbox_id = 4; + string creator_inbox_id = 3; } // Defines the type of conversation @@ -22,64 +21,3 @@ enum ConversationType { CONVERSATION_TYPE_DM = 2; CONVERSATION_TYPE_SYNC = 3; } - -// The set of policies that govern the group -message PolicySet { - MembershipPolicy add_member_policy = 1; - MembershipPolicy remove_member_policy = 2; - map update_metadata_policy = 3; -} - -// A policy that governs adding/removing members or installations -message MembershipPolicy { - // Base policy - enum BasePolicy { - BASE_POLICY_UNSPECIFIED = 0; - BASE_POLICY_ALLOW = 1; - BASE_POLICY_DENY = 2; - BASE_POLICY_ALLOW_IF_ACTOR_CREATOR = 3; - } - - // Combine multiple policies. All must evaluate to true - message AndCondition { - repeated MembershipPolicy policies = 1; - } - - // Combine multiple policies. Any must evaluate to true - message AnyCondition { - repeated MembershipPolicy policies = 1; - } - - oneof kind { - BasePolicy base = 1; - AndCondition and_condition = 2; - AnyCondition any_condition = 3; - } -} - -// A policy that governs updating metadata -message MetadataPolicy { - // Base policy - enum MetadataBasePolicy { - METADATA_BASE_POLICY_UNSPECIFIED = 0; - METADATA_BASE_POLICY_ALLOW = 1; - METADATA_BASE_POLICY_DENY = 2; - METADATA_BASE_POLICY_ALLOW_IF_ACTOR_CREATOR = 3; - } - - // Combine multiple policies. All must evaluate to true - message AndCondition { - repeated MetadataPolicy policies = 1; - } - - // Combine multiple policies. Any must evaluate to true - message AnyCondition { - repeated MetadataPolicy policies = 1; - } - - oneof kind { - MetadataBasePolicy base = 1; - AndCondition and_condition = 2; - AnyCondition any_condition = 3; - } -} diff --git a/proto/mls/message_contents/group_mutable_metadata.proto b/proto/mls/message_contents/group_mutable_metadata.proto index 82926ef1..16db3bf4 100644 --- a/proto/mls/message_contents/group_mutable_metadata.proto +++ b/proto/mls/message_contents/group_mutable_metadata.proto @@ -6,7 +6,18 @@ package xmtp.mls.message_contents; option go_package = "github.com/xmtp/proto/v3/go/mls/message_contents"; option java_package = "org.xmtp.proto.mls.message.contents"; + // Message for group mutable metadata message GroupMutableMetadataV1 { - map attributes = 1; // Map to store various metadata attributes + // Map to store various metadata attributes (Group name, etc.) + map attributes = 1; + Inboxes admin_list = 2; + // Creator starts as only super_admin + // Only super_admin can add/remove other super_admin + Inboxes super_admin_list = 3; +} + +// Wrapper around a list of repeated Inbox Ids +message Inboxes { + repeated string inbox_ids = 1; } diff --git a/proto/mls/message_contents/group_permissions.proto b/proto/mls/message_contents/group_permissions.proto new file mode 100644 index 00000000..f6367a30 --- /dev/null +++ b/proto/mls/message_contents/group_permissions.proto @@ -0,0 +1,105 @@ +// Group mutable permissions metadata +syntax = "proto3"; + +package xmtp.mls.message_contents; + +option go_package = "github.com/xmtp/proto/v3/go/mls/message_contents"; +option java_package = "org.xmtp.proto.mls.message.contents"; + +// Message for group mutable metadata +message GroupMutablePermissionsV1 { + PolicySet policies = 1; +} + +// The set of policies that govern the group +message PolicySet { + MembershipPolicy add_member_policy = 1; + MembershipPolicy remove_member_policy = 2; + map update_metadata_policy = 3; + PermissionsUpdatePolicy add_admin_policy = 4; + PermissionsUpdatePolicy remove_admin_policy = 5; + PermissionsUpdatePolicy update_permissions_policy = 6; +} + +// A policy that governs adding/removing members or installations +message MembershipPolicy { + // Base policy + enum BasePolicy { + BASE_POLICY_UNSPECIFIED = 0; + BASE_POLICY_ALLOW = 1; + BASE_POLICY_DENY = 2; + BASE_POLICY_ALLOW_IF_ADMIN_OR_SUPER_ADMIN = 3; + BASE_POLICY_ALLOW_IF_SUPER_ADMIN = 4; + } + + // Combine multiple policies. All must evaluate to true + message AndCondition { + repeated MembershipPolicy policies = 1; + } + + // Combine multiple policies. Any must evaluate to true + message AnyCondition { + repeated MembershipPolicy policies = 1; + } + + oneof kind { + BasePolicy base = 1; + AndCondition and_condition = 2; + AnyCondition any_condition = 3; + } +} + +// A policy that governs updating metadata +message MetadataPolicy { + // Base policy + enum MetadataBasePolicy { + METADATA_BASE_POLICY_UNSPECIFIED = 0; + METADATA_BASE_POLICY_ALLOW = 1; + METADATA_BASE_POLICY_DENY = 2; + METADATA_BASE_POLICY_ALLOW_IF_ADMIN = 3; + METADATA_BASE_POLICY_ALLOW_IF_SUPER_ADMIN = 4; + } + + // Combine multiple policies. All must evaluate to true + message AndCondition { + repeated MetadataPolicy policies = 1; + } + + // Combine multiple policies. Any must evaluate to true + message AnyCondition { + repeated MetadataPolicy policies = 1; + } + + oneof kind { + MetadataBasePolicy base = 1; + AndCondition and_condition = 2; + AnyCondition any_condition = 3; + } +} + +// A policy that governs updating permissions +message PermissionsUpdatePolicy { + // Base policy + enum PermissionsBasePolicy { + PERMISSIONS_BASE_POLICY_UNSPECIFIED = 0; + PERMISSIONS_BASE_POLICY_DENY = 1; + PERMISSIONS_BASE_POLICY_ALLOW_IF_ADMIN = 2; + PERMISSIONS_BASE_POLICY_ALLOW_IF_SUPER_ADMIN = 3; + } + + // Combine multiple policies. All must evaluate to true + message AndCondition { + repeated PermissionsUpdatePolicy policies = 1; + } + + // Combine multiple policies. Any must evaluate to true + message AnyCondition { + repeated PermissionsUpdatePolicy policies = 1; + } + + oneof kind { + PermissionsBasePolicy base = 1; + AndCondition and_condition = 2; + AnyCondition any_condition = 3; + } +} diff --git a/proto/mls_validation/v1/service.proto b/proto/mls_validation/v1/service.proto index 5a0482bd..a677356e 100644 --- a/proto/mls_validation/v1/service.proto +++ b/proto/mls_validation/v1/service.proto @@ -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"; @@ -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 @@ -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; +}