-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
Prototype identity apis
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm test | ||
./dev/go/generate | ||
. "$(dirname -- "$0")/_/husky.sh" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// Message API | ||
syntax = "proto3"; | ||
package xmtp.identity.api.v1; | ||
|
||
import "google/api/annotations.proto"; | ||
import "identity/associations/association.proto"; | ||
import "protoc-gen-openapiv2/options/annotations.proto"; | ||
|
||
option go_package = "github.com/xmtp/proto/v3/go/mls/api/v1"; | ||
option java_package = "org.xmtp.proto.mls.api.v1"; | ||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { | ||
info: { | ||
title: "IdentityApi"; | ||
version: "1.0"; | ||
}; | ||
}; | ||
|
||
// RPCs for the new MLS API | ||
service IdentityApi { | ||
// Publishes an identity update for an XID or wallet. An identity update may | ||
// consist of multiple identity actions that have been batch signed. | ||
rpc PublishIdentityUpdate(PublishIdentityUpdateRequest) returns (PublishIdentityUpdateResponse) { | ||
option (google.api.http) = { | ||
post: "/identity/v1/publish-identity-update" | ||
body: "*" | ||
}; | ||
} | ||
|
||
// Used to check for changes related to members of a group. | ||
// Would return an array of any new installations associated with the wallet | ||
// address, and any revocations that have happened. | ||
rpc GetIdentityUpdates(GetIdentityUpdatesRequest) returns (GetIdentityUpdatesResponse) { | ||
option (google.api.http) = { | ||
post: "/identity/v1/get-identity-updates" | ||
body: "*" | ||
}; | ||
} | ||
|
||
// Retrieve the XIDs for the given addresses | ||
rpc GetInboxIds(GetInboxIdsRequest) returns (GetInboxIdsResponse) { | ||
option (google.api.http) = { | ||
post: "/identity/v1/get-inbox-ids" | ||
body: "*" | ||
}; | ||
} | ||
} | ||
|
||
// Publishes an identity update to the network | ||
message PublishIdentityUpdateRequest { | ||
xmtp.identity.associations.IdentityUpdate identity_update = 1; | ||
} | ||
|
||
// The response when an identity update is published | ||
message PublishIdentityUpdateResponse {} | ||
|
||
// Get all updates for an identity since the specified time | ||
message GetIdentityUpdatesRequest { | ||
// Points to the last entry the client has received. The sequence_id should be | ||
// set to 0 if the client has not received anything. | ||
message Request { | ||
string inbox_id = 1; | ||
uint64 sequence_id = 2; | ||
} | ||
|
||
repeated Request requests = 1; | ||
} | ||
|
||
// Returns all log entries for the requested identities | ||
message GetIdentityUpdatesResponse { | ||
// A single entry in the XID log on the server. | ||
message IdentityUpdateLog { | ||
uint64 sequence_id = 1; | ||
uint64 server_timestamp_ns = 2; | ||
xmtp.identity.associations.IdentityUpdate update = 3; | ||
} | ||
|
||
// The update log for a single identity, starting after the last cursor | ||
message Response { | ||
string inbox_id = 1; | ||
repeated IdentityUpdateLog updates = 2; | ||
} | ||
|
||
repeated Response responses = 1; | ||
} | ||
|
||
// Request to retrieve the XIDs for the given addresses | ||
message GetInboxIdsRequest { | ||
// A single request for a given address | ||
message Request { | ||
string address = 1; | ||
} | ||
|
||
repeated Request requests = 1; | ||
} | ||
|
||
// Response with the XIDs for the requested addresses | ||
message GetInboxIdsResponse { | ||
// A single response for a given address | ||
message Response { | ||
string address = 1; | ||
optional string inbox_id = 2; | ||
} | ||
|
||
repeated Response responses = 1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Payloads to be signed for identity associations | ||
syntax = "proto3"; | ||
|
||
package xmtp.identity.associations; | ||
|
||
import "identity/associations/signature.proto"; | ||
|
||
option go_package = "github.com/xmtp/proto/v3/go/identity/associations"; | ||
option java_package = "org.xmtp.proto.identity.associations"; | ||
|
||
// The identifier for a member of an XID | ||
message MemberIdentifier { | ||
oneof kind { | ||
string address = 1; | ||
bytes installation_public_key = 2; | ||
} | ||
} | ||
|
||
// The first entry of any XID log. The XID must be deterministically derivable | ||
// from the address and nonce. | ||
// The recovery address defaults to the initial associated_address unless | ||
// there is a subsequent ChangeRecoveryAddress in the log. | ||
message CreateInbox { | ||
string initial_address = 1; | ||
uint64 nonce = 2; | ||
Signature initial_address_signature = 3; // Must be an addressable member | ||
} | ||
|
||
// Adds a new member for an XID - either an addressable member such as a | ||
// wallet, or an installation acting on behalf of an address. | ||
// A key-pair that has been associated with one role MUST not be permitted to be | ||
// associated with a different role. | ||
message AddAssociation { | ||
MemberIdentifier new_member_identifier = 1; | ||
Signature existing_member_signature = 2; | ||
Signature new_member_signature = 3; | ||
} | ||
|
||
// Revokes a member from an XID. The recovery address must sign the revocation. | ||
message RevokeAssociation { | ||
MemberIdentifier member_to_revoke = 1; | ||
Signature recovery_address_signature = 2; | ||
} | ||
|
||
// Changes the recovery address for an XID. The recovery address is not required | ||
// to be a member of the XID. In addition to being able to add members, the | ||
// recovery address can also revoke members. | ||
message ChangeRecoveryAddress { | ||
string new_recovery_address = 1; | ||
Signature existing_recovery_address_signature = 2; | ||
} | ||
|
||
// A single identity operation | ||
message IdentityAction { | ||
oneof kind { | ||
CreateInbox create_inbox = 1; | ||
AddAssociation add = 2; | ||
RevokeAssociation revoke = 3; | ||
ChangeRecoveryAddress change_recovery_address = 4; | ||
} | ||
} | ||
|
||
// One or more identity actions that were signed together. | ||
// Example: [CreateXid, AddAssociation, ChangeRecoveryAddress] | ||
// 1. The batched signature text is created by concatenating the signature text | ||
// of each association together with a separator, '\n\n\n'. | ||
// 2. The user signs this concatenated result. | ||
// 3. The resulting signature is added to each association proto where relevant. | ||
// The same signature may be used for multiple associations in the array. | ||
message IdentityUpdate { | ||
repeated IdentityAction actions = 1; | ||
uint64 client_timestamp_ns = 2; | ||
string inbox_id = 3; | ||
} |