From 8cfe5727d2f8ba96274b3aacf886f9afdbe11ddf Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:14:39 -0700 Subject: [PATCH 01/20] Validation service scaffold (#320) * Scaffold MLS server * Update go.mod * Fix missing argument * Add unsaved file * Lint * Working end-to-end * Lint * Add new push action * Address review comments * Change method casing * Change casing of server options * Change casing of validation options * Remove unused function * Remove double pointer * Make private again --- .github/workflows/push-mls.yml | 34 ++++ cmd/xmtpd/main.go | 7 + go.mod | 19 +- go.sum | 44 +++-- pkg/api/config.go | 12 +- pkg/api/message/v3/service.go | 90 +++++++-- pkg/api/server.go | 6 +- .../mls/20231023050806_init-schema.down.sql | 8 + .../mls/20231023050806_init-schema.up.sql | 44 +++++ pkg/migrations/mls/migrations.go | 18 ++ pkg/mlsstore/models.go | 24 +++ pkg/mlsstore/store.go | 157 +++++++++++++++- pkg/mlsstore/store_test.go | 171 ++++++++++++++++++ pkg/mlsvalidate/config.go | 5 + pkg/mlsvalidate/service.go | 107 +++++++++++ pkg/mlsvalidate/service_test.go | 63 +++++++ pkg/server/options.go | 19 +- pkg/server/server.go | 51 +++++- pkg/testing/store.go | 15 ++ 19 files changed, 827 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/push-mls.yml create mode 100644 pkg/migrations/mls/20231023050806_init-schema.down.sql create mode 100644 pkg/migrations/mls/20231023050806_init-schema.up.sql create mode 100644 pkg/migrations/mls/migrations.go create mode 100644 pkg/mlsstore/models.go create mode 100644 pkg/mlsstore/store_test.go create mode 100644 pkg/mlsvalidate/config.go create mode 100644 pkg/mlsvalidate/service.go create mode 100644 pkg/mlsvalidate/service_test.go diff --git a/.github/workflows/push-mls.yml b/.github/workflows/push-mls.yml new file mode 100644 index 00000000..8ad7f1e5 --- /dev/null +++ b/.github/workflows/push-mls.yml @@ -0,0 +1,34 @@ +name: Deploy Nodes +on: + push: + branches: + - mls +jobs: + deploy: + concurrency: main + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: xmtpeng + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Git Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version-file: go.mod + + - name: Push + id: push + run: | + export DOCKER_IMAGE_TAG=mls + IMAGE_TO_DEPLOY=xmtp/node-go@$(dev/docker/build) + echo Successfully pushed $IMAGE_TO_DEPLOY + echo "docker_image=${IMAGE_TO_DEPLOY}" >> $GITHUB_OUTPUT diff --git a/cmd/xmtpd/main.go b/cmd/xmtpd/main.go index cd948fff..c26364a5 100644 --- a/cmd/xmtpd/main.go +++ b/cmd/xmtpd/main.go @@ -92,6 +92,13 @@ func main() { return } + if options.CreateMlsMigration != "" && options.MLSStore.DbConnectionString != "" { + if err := server.CreateMlsMigration(options.CreateMlsMigration, options.MLSStore.DbConnectionString, options.WaitForDB, options.MLSStore.ReadTimeout, options.MLSStore.WriteTimeout, options.Store.MaxOpenConns); err != nil { + log.Fatal("creating authz db migration", zap.Error(err)) + } + return + } + if options.Tracing.Enable { log.Info("starting tracer") tracing.Start(Commit, utils.Logger()) diff --git a/go.mod b/go.mod index 026e3958..e86b30f8 100644 --- a/go.mod +++ b/go.mod @@ -25,12 +25,12 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.4 github.com/swaggest/swgui v1.6.2 - github.com/uptrace/bun v1.1.3 - github.com/uptrace/bun/dialect/pgdialect v1.1.3 - github.com/uptrace/bun/driver/pgdriver v1.1.3 + github.com/uptrace/bun v1.1.16 + github.com/uptrace/bun/dialect/pgdialect v1.1.16 + github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.30.0 + github.com/xmtp/proto/v3 v3.29.1-0.20231023182354-832c8d572ed4 github.com/yoheimuta/protolint v0.39.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 @@ -108,7 +108,7 @@ require ( github.com/libp2p/go-yamux/v4 v4.0.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect - github.com/mattn/go-colorable v0.1.11 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.55 // indirect @@ -148,6 +148,7 @@ require ( github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tinylib/msgp v1.1.2 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect @@ -167,12 +168,12 @@ require ( go.uber.org/dig v1.17.0 // indirect go.uber.org/fx v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.14.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 // indirect golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect @@ -181,7 +182,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect - mellium.im/sasl v0.2.1 // indirect + mellium.im/sasl v0.3.1 // indirect ) // From node-go diff --git a/go.sum b/go.sum index 7f82e8f3..71df1b4f 100644 --- a/go.sum +++ b/go.sum @@ -94,6 +94,7 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -298,6 +299,7 @@ github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= @@ -633,16 +635,19 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= @@ -733,8 +738,9 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -747,6 +753,7 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -803,6 +810,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -834,6 +842,7 @@ github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/n github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= @@ -965,6 +974,7 @@ github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1 github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= @@ -1037,7 +1047,9 @@ github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZL github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -1046,7 +1058,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/swaggest/swgui v1.6.2 h1:DR+ioYt11YrXMaEmLcgaOEFSZ/8QW30uYYE/Ck41cPA= @@ -1086,12 +1100,12 @@ github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZ github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/uptrace/bun v1.1.3 h1:v62tsUyKjVCR5q7J49uckM6CVVTqMO26aV73F3G6RFk= -github.com/uptrace/bun v1.1.3/go.mod h1:aQbKvxs7/n9MMef/b8lYOh5Rwlo4Jd5A31E4HlYNqSc= -github.com/uptrace/bun/dialect/pgdialect v1.1.3 h1:EMRCC98YKSpo/EXyujsr+5v0PKYkRE0rwxJKKEcrOuE= -github.com/uptrace/bun/dialect/pgdialect v1.1.3/go.mod h1:2GJogfkVHmCKxt6N88vRbJNSUV5wfPym/rp6N25dShc= -github.com/uptrace/bun/driver/pgdriver v1.1.3 h1:WWxEfGnJQCXgODtjU37E+XWEVvCGwvs2fRgCYFqmKAY= -github.com/uptrace/bun/driver/pgdriver v1.1.3/go.mod h1:D7tTNXLIR9udcf/Dm9W+x1qvY+GDCkYVIRLgQyMElCY= +github.com/uptrace/bun v1.1.16 h1:cn9cgEMFwcyYRsQLfxCRMUxyK1WaHwOVrR3TvzEFZ/A= +github.com/uptrace/bun v1.1.16/go.mod h1:7HnsMRRvpLFUcquJxp22JO8PsWKpFQO/gNXqqsuGWg8= +github.com/uptrace/bun/dialect/pgdialect v1.1.16 h1:eUPZ+YCJ69BA+W1X1ZmpOJSkv1oYtinr0zCXf7zCo5g= +github.com/uptrace/bun/dialect/pgdialect v1.1.16/go.mod h1:KQjfx/r6JM0OXfbv0rFrxAbdkPD7idK8VitnjIV9fZI= +github.com/uptrace/bun/driver/pgdriver v1.1.16 h1:b/NiSXk6Ldw7KLfMLbOqIkm4odHd7QiNOCPLqPFJjK4= +github.com/uptrace/bun/driver/pgdriver v1.1.16/go.mod h1:Rmfbc+7lx1z/umjMyAxkOHK81LgnGj71XC5YpA6k1vU= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= @@ -1231,8 +1245,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1431,10 +1445,11 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1448,8 +1463,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1697,8 +1712,9 @@ k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKf k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= +mellium.im/sasl v0.3.1 h1:wE0LW6g7U83vhvxjC1IY8DnXM+EU095yeo8XClvCdfo= +mellium.im/sasl v0.3.1/go.mod h1:xm59PUYpZHhgQ9ZqoJ5QaCqzWMi8IeS49dhp6plPCzw= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/pkg/api/config.go b/pkg/api/config.go index f61d8ff4..723679bf 100644 --- a/pkg/api/config.go +++ b/pkg/api/config.go @@ -8,6 +8,7 @@ import ( wakunode "github.com/waku-org/go-waku/waku/v2/node" "github.com/xmtp/xmtp-node-go/pkg/authz" "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" "github.com/xmtp/xmtp-node-go/pkg/store" "go.uber.org/zap" @@ -31,11 +32,12 @@ type Options struct { type Config struct { Options - AllowLister authz.WalletAllowLister - Waku *wakunode.WakuNode - Log *zap.Logger - Store *store.Store - MlsStore mlsstore.MlsStore + AllowLister authz.WalletAllowLister + Waku *wakunode.WakuNode + Log *zap.Logger + Store *store.Store + MLSStore mlsstore.MlsStore + MLSValidator mlsvalidate.MLSValidationService } // AuthnOptions bundle command line options associated with the authn package. diff --git a/pkg/api/message/v3/service.go b/pkg/api/message/v3/service.go index 54df462b..9ea61de4 100644 --- a/pkg/api/message/v3/service.go +++ b/pkg/api/message/v3/service.go @@ -6,6 +6,7 @@ import ( wakunode "github.com/waku-org/go-waku/waku/v2/node" proto "github.com/xmtp/proto/v3/go/message_api/v3" "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/store" "go.uber.org/zap" "google.golang.org/grpc/codes" @@ -16,21 +17,23 @@ import ( type Service struct { proto.UnimplementedMlsApiServer - log *zap.Logger - waku *wakunode.WakuNode - messageStore *store.Store - mlsStore mlsstore.MlsStore + log *zap.Logger + waku *wakunode.WakuNode + messageStore *store.Store + mlsStore mlsstore.MlsStore + validationService mlsvalidate.MLSValidationService ctx context.Context ctxCancel func() } -func NewService(node *wakunode.WakuNode, logger *zap.Logger, messageStore *store.Store, mlsStore mlsstore.MlsStore) (s *Service, err error) { +func NewService(node *wakunode.WakuNode, logger *zap.Logger, messageStore *store.Store, mlsStore mlsstore.MlsStore, validationService mlsvalidate.MLSValidationService) (s *Service, err error) { s = &Service{ - log: logger.Named("message/v3"), - waku: node, - messageStore: messageStore, - mlsStore: mlsStore, + log: logger.Named("message/v3"), + waku: node, + messageStore: messageStore, + mlsStore: mlsStore, + validationService: validationService, } s.ctx, s.ctxCancel = context.WithCancel(context.Background()) @@ -45,11 +48,54 @@ func (s *Service) Close() { } func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterInstallationRequest) (*proto.RegisterInstallationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") + results, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{req.LastResortKeyPackage.KeyPackageTlsSerialized}) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) + } + if len(results) != 1 { + return nil, status.Errorf(codes.Internal, "unexpected number of results: %d", len(results)) + } + + installationId := results[0].InstallationId + walletAddress := results[0].WalletAddress + + err = s.mlsStore.CreateInstallation(ctx, installationId, walletAddress, req.LastResortKeyPackage.KeyPackageTlsSerialized) + if err != nil { + return nil, err + } + + return &proto.RegisterInstallationResponse{ + InstallationId: installationId, + }, nil } func (s *Service) ConsumeKeyPackages(ctx context.Context, req *proto.ConsumeKeyPackagesRequest) (*proto.ConsumeKeyPackagesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") + ids := req.InstallationIds + keyPackages, err := s.mlsStore.ConsumeKeyPackages(ctx, ids) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to consume key packages: %s", err) + } + keyPackageMap := make(map[string]int) + for idx, id := range ids { + keyPackageMap[id] = idx + } + + resPackages := make([]*proto.ConsumeKeyPackagesResponse_KeyPackage, len(keyPackages)) + for _, keyPackage := range keyPackages { + + idx, ok := keyPackageMap[keyPackage.InstallationId] + if !ok { + return nil, status.Errorf(codes.Internal, "could not find key package for installation") + } + + resPackages[idx] = &proto.ConsumeKeyPackagesResponse_KeyPackage{ + KeyPackageTlsSerialized: keyPackage.Data, + } + } + + return &proto.ConsumeKeyPackagesResponse{ + KeyPackages: resPackages, + }, nil } func (s *Service) PublishToGroup(ctx context.Context, req *proto.PublishToGroupRequest) (*emptypb.Empty, error) { @@ -61,7 +107,27 @@ func (s *Service) PublishWelcomes(ctx context.Context, req *proto.PublishWelcome } func (s *Service) UploadKeyPackages(ctx context.Context, req *proto.UploadKeyPackagesRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") + keyPackageBytes := make([][]byte, len(req.KeyPackages)) + for i, keyPackage := range req.KeyPackages { + keyPackageBytes[i] = keyPackage.KeyPackageTlsSerialized + } + validationResults, err := s.validationService.ValidateKeyPackages(ctx, keyPackageBytes) + if err != nil { + // TODO: Differentiate between validation errors and internal errors + return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) + } + + keyPackageModels := make([]*mlsstore.KeyPackage, len(validationResults)) + for i, validationResult := range validationResults { + kp := mlsstore.NewKeyPackage(validationResult.InstallationId, keyPackageBytes[i], false) + keyPackageModels[i] = kp + } + err = s.mlsStore.InsertKeyPackages(ctx, keyPackageModels) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to insert key packages: %s", err) + } + + return &emptypb.Empty{}, nil } func (s *Service) RevokeInstallation(ctx context.Context, req *proto.RevokeInstallationRequest) (*emptypb.Empty, error) { diff --git a/pkg/api/server.go b/pkg/api/server.go index e7f1b643..9648c3a1 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -130,8 +130,8 @@ func (s *Server) startGRPC() error { proto.RegisterMessageApiServer(grpcServer, s.messagev1) // Enable the MLS server if a store is provided - if s.Config.MlsStore != nil && s.Config.EnableMls { - s.messagev3, err = messagev3.NewService(s.Waku, s.Log, s.Store, s.Config.MlsStore) + if s.Config.MLSStore != nil && s.Config.MLSValidator != nil && s.Config.EnableMls { + s.messagev3, err = messagev3.NewService(s.Waku, s.Log, s.Store, s.Config.MLSStore, s.Config.MLSValidator) if err != nil { return errors.Wrap(err, "creating mls service") } @@ -183,7 +183,7 @@ func (s *Server) startHTTP() error { return errors.Wrap(err, "registering message handler") } - if s.Config.MlsStore != nil && s.Config.EnableMls { + if s.Config.MLSStore != nil && s.Config.EnableMls { err = v3Proto.RegisterMlsApiHandler(s.ctx, gwmux, conn) if err != nil { return errors.Wrap(err, "registering mls handler") diff --git a/pkg/migrations/mls/20231023050806_init-schema.down.sql b/pkg/migrations/mls/20231023050806_init-schema.down.sql new file mode 100644 index 00000000..b1077270 --- /dev/null +++ b/pkg/migrations/mls/20231023050806_init-schema.down.sql @@ -0,0 +1,8 @@ +SET + statement_timeout = 0; + +--bun:split +DROP TABLE IF EXISTS installations; + +--bun:split +DROP TABLE IF EXISTS key_packages; \ No newline at end of file diff --git a/pkg/migrations/mls/20231023050806_init-schema.up.sql b/pkg/migrations/mls/20231023050806_init-schema.up.sql new file mode 100644 index 00000000..b6aa90d5 --- /dev/null +++ b/pkg/migrations/mls/20231023050806_init-schema.up.sql @@ -0,0 +1,44 @@ +SET + statement_timeout = 0; + +--bun:split +CREATE TABLE installations ( + id TEXT PRIMARY KEY, + wallet_address TEXT NOT NULL, + created_at BIGINT NOT NULL, + revoked_at BIGINT +); + +--bun:split +CREATE TABLE key_packages ( + id TEXT PRIMARY KEY, + installation_id TEXT NOT NULL, + created_at BIGINT NOT NULL, + consumed_at BIGINT, + not_consumed BOOLEAN DEFAULT TRUE NOT NULL, + is_last_resort BOOLEAN NOT NULL, + data BYTEA NOT NULL, + -- Add a foreign key constraint to ensure key packages cannot be added for unregistered installations + CONSTRAINT fk_installation_id FOREIGN KEY (installation_id) REFERENCES installations (id) +); + +--bun:split +CREATE INDEX idx_installations_wallet_address ON installations(wallet_address); + +--bun:split +CREATE INDEX idx_installations_created_at ON installations(created_at); + +--bun:split +CREATE INDEX idx_installations_revoked_at ON installations(revoked_at); + +--bun:split +-- Adding indexes for the key_packages table +CREATE INDEX idx_key_packages_installation_id_not_is_last_resort_created_at ON key_packages( + installation_id, + not_consumed, + is_last_resort, + created_at +); + +--bun:split +CREATE INDEX idx_key_packages_is_last_resort_id ON key_packages(is_last_resort, id); \ No newline at end of file diff --git a/pkg/migrations/mls/migrations.go b/pkg/migrations/mls/migrations.go new file mode 100644 index 00000000..860e0445 --- /dev/null +++ b/pkg/migrations/mls/migrations.go @@ -0,0 +1,18 @@ +package mls + +import ( + "embed" + + "github.com/uptrace/bun/migrate" +) + +var Migrations = migrate.NewMigrations() + +//go:embed *.sql +var sqlMigrations embed.FS + +func init() { + if err := Migrations.Discover(sqlMigrations); err != nil { + panic(err) + } +} diff --git a/pkg/mlsstore/models.go b/pkg/mlsstore/models.go new file mode 100644 index 00000000..533c595d --- /dev/null +++ b/pkg/mlsstore/models.go @@ -0,0 +1,24 @@ +package mlsstore + +import "github.com/uptrace/bun" + +type Installation struct { + bun.BaseModel `bun:"table:installations"` + + ID string `bun:",pk"` + WalletAddress string `bun:"wallet_address,notnull"` + CreatedAt int64 `bun:"created_at,notnull"` + RevokedAt *int64 `bun:"revoked_at"` +} + +type KeyPackage struct { + bun.BaseModel `bun:"table:key_packages"` + + ID string `bun:",pk"` // ID is the hash of the data field + InstallationId string `bun:"installation_id,notnull"` + CreatedAt int64 `bun:"created_at,notnull"` + ConsumedAt *int64 `bun:"consumed_at"` + NotConsumed bool `bun:"not_consumed,default:true"` + IsLastResort bool `bun:"is_last_resort,notnull"` + Data []byte `bun:"data,notnull,type:bytea"` +} diff --git a/pkg/mlsstore/store.go b/pkg/mlsstore/store.go index 4dcfd277..f528b78d 100644 --- a/pkg/mlsstore/store.go +++ b/pkg/mlsstore/store.go @@ -2,27 +2,172 @@ package mlsstore import ( "context" + "crypto/sha256" + "database/sql" + "encoding/hex" + "errors" + "time" "github.com/uptrace/bun" + "github.com/uptrace/bun/migrate" + "github.com/xmtp/xmtp-node-go/pkg/migrations/messages" "go.uber.org/zap" ) type Store struct { - ctx context.Context - cancel context.CancelFunc + config Config log *zap.Logger db *bun.DB } type MlsStore interface { + CreateInstallation(ctx context.Context, installationId string, walletAddress string, lastResortKeyPackage []byte) error + InsertKeyPackages(ctx context.Context, keyPackages []*KeyPackage) error + ConsumeKeyPackages(ctx context.Context, installationIds []string) ([]*KeyPackage, error) } -func New(config Config) (*Store, error) { +func New(ctx context.Context, config Config) (*Store, error) { s := &Store{ - log: config.Log.Named("mlsstore"), - db: config.DB, + log: config.Log.Named("mlsstore"), + db: config.DB, + config: config, + } + + if err := s.migrate(ctx); err != nil { + return nil, err } - s.ctx, s.cancel = context.WithCancel(context.Background()) return s, nil } + +func (s *Store) Close() { + if s.db != nil { + s.db.Close() + } +} + +// Creates the installation and last resort key package +func (s *Store) CreateInstallation(ctx context.Context, installationId string, walletAddress string, lastResortKeyPackage []byte) error { + createdAt := nowNs() + + installation := Installation{ + ID: installationId, + WalletAddress: walletAddress, + CreatedAt: createdAt, + } + + keyPackage := NewKeyPackage(installationId, lastResortKeyPackage, true) + + return s.db.RunInTx(ctx, &sql.TxOptions{}, func(ctx context.Context, tx bun.Tx) error { + _, err := tx.NewInsert(). + Model(&installation). + Ignore(). + Exec(ctx) + + if err != nil { + return err + } + + _, err = tx.NewInsert(). + Model(keyPackage). + Ignore(). + Exec(ctx) + + if err != nil { + return err + } + + return nil + }) +} + +// Insert a batch of key packages, ignoring any that may already exist +func (s *Store) InsertKeyPackages(ctx context.Context, keyPackages []*KeyPackage) error { + _, err := s.db.NewInsert().Model(&keyPackages).Ignore().Exec(ctx) + return err +} + +func (s *Store) ConsumeKeyPackages(ctx context.Context, installationIds []string) ([]*KeyPackage, error) { + keyPackages := make([]*KeyPackage, 0) + err := s.db.RunInTx(ctx, &sql.TxOptions{}, func(ctx context.Context, tx bun.Tx) error { + err := tx.NewRaw(` + SELECT DISTINCT ON(installation_id) * FROM key_packages + WHERE "installation_id" IN (?) + AND not_consumed = TRUE + ORDER BY installation_id ASC, is_last_resort ASC, created_at ASC + `, + bun.In(installationIds)). + Scan(ctx, &keyPackages) + + if err != nil { + return err + } + + if len(keyPackages) < len(installationIds) { + return errors.New("key packages not found") + } + + _, err = tx.NewUpdate(). + Table("key_packages"). + Set("consumed_at = ?", nowNs()). + Set("not_consumed = FALSE"). + Where("is_last_resort = FALSE"). + Where("id IN (?)", bun.In(extractIds(keyPackages))). + Exec(ctx) + + return err + }) + + if err != nil { + return nil, err + } + + return keyPackages, nil +} + +func NewKeyPackage(installationId string, data []byte, isLastResort bool) *KeyPackage { + return &KeyPackage{ + ID: buildKeyPackageId(data), + InstallationId: installationId, + CreatedAt: nowNs(), + IsLastResort: isLastResort, + NotConsumed: true, + Data: data, + } +} + +func extractIds(keyPackages []*KeyPackage) []string { + out := make([]string, len(keyPackages)) + for i, keyPackage := range keyPackages { + out[i] = keyPackage.ID + } + return out +} + +func (s *Store) migrate(ctx context.Context) error { + migrator := migrate.NewMigrator(s.db, messages.Migrations) + err := migrator.Init(ctx) + if err != nil { + return err + } + + group, err := migrator.Migrate(ctx) + if err != nil { + return err + } + + if group.IsZero() { + s.log.Info("No new migrations to run") + } + + return nil +} + +func nowNs() int64 { + return time.Now().UTC().UnixNano() +} + +func buildKeyPackageId(keyPackageData []byte) string { + digest := sha256.Sum256(keyPackageData) + return hex.EncodeToString(digest[:]) +} diff --git a/pkg/mlsstore/store_test.go b/pkg/mlsstore/store_test.go new file mode 100644 index 00000000..026b3da9 --- /dev/null +++ b/pkg/mlsstore/store_test.go @@ -0,0 +1,171 @@ +package mlsstore + +import ( + "context" + "crypto/rand" + "fmt" + "testing" + + "github.com/stretchr/testify/require" + test "github.com/xmtp/xmtp-node-go/pkg/testing" +) + +func NewTestStore(t *testing.T) (*Store, func()) { + log := test.NewLog(t) + db, _, dbCleanup := test.NewMlsDB(t) + ctx := context.Background() + c := Config{ + Log: log, + DB: db, + } + + store, err := New(ctx, c) + require.NoError(t, err) + + return store, dbCleanup +} + +func randomBytes(n int) []byte { + b := make([]byte, n) + _, _ = rand.Reader.Read(b) + return b +} + +func randomString(n int) string { + return fmt.Sprintf("%x", randomBytes(n)) +} + +func TestCreateInstallation(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + installationId := randomString(32) + walletAddress := randomString(32) + + err := store.CreateInstallation(ctx, installationId, walletAddress, randomBytes(32)) + require.NoError(t, err) + + installationFromDb := &Installation{} + require.NoError(t, store.db.NewSelect().Model(installationFromDb).Where("id = ?", installationId).Scan(ctx)) + require.Equal(t, walletAddress, installationFromDb.WalletAddress) + + keyPackageFromDB := &KeyPackage{} + require.NoError(t, store.db.NewSelect().Model(keyPackageFromDB).Where("installation_id = ?", installationId).Scan(ctx)) + require.Equal(t, installationId, keyPackageFromDB.InstallationId) +} + +func TestCreateInstallationIdempotent(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + installationId := randomString(32) + walletAddress := randomString(32) + keyPackage := randomBytes(32) + + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + require.NoError(t, err) + err = store.CreateInstallation(ctx, installationId, walletAddress, randomBytes(32)) + require.NoError(t, err) + + keyPackageFromDb := &KeyPackage{} + require.NoError(t, store.db.NewSelect().Model(keyPackageFromDb).Where("installation_id = ?", installationId).Scan(ctx)) + require.Equal(t, keyPackage, keyPackageFromDb.Data) +} + +func TestInsertKeyPackages(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + installationId := randomString(32) + walletAddress := randomString(32) + keyPackage := randomBytes(32) + + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + require.NoError(t, err) + + keyPackage2 := randomBytes(32) + err = store.InsertKeyPackages(ctx, []*KeyPackage{{ + ID: buildKeyPackageId(keyPackage2), + InstallationId: installationId, + CreatedAt: nowNs(), + IsLastResort: false, + Data: keyPackage2, + }}) + require.NoError(t, err) + + keyPackagesFromDb := []*KeyPackage{} + require.NoError(t, store.db.NewSelect().Model(&keyPackagesFromDb).Where("installation_id = ?", installationId).Scan(ctx)) + require.Len(t, keyPackagesFromDb, 2) + + hasLastResort := false + hasRegular := false + for _, keyPackageFromDb := range keyPackagesFromDb { + require.Equal(t, installationId, keyPackageFromDb.InstallationId) + if keyPackageFromDb.IsLastResort { + hasLastResort = true + } + if !keyPackageFromDb.IsLastResort { + hasRegular = true + require.Equal(t, keyPackage2, keyPackageFromDb.Data) + } + } + + require.True(t, hasLastResort) + require.True(t, hasRegular) +} + +func TestConsumeLastResortKeyPackage(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + installationId := randomString(32) + walletAddress := randomString(32) + keyPackage := randomBytes(32) + + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + require.NoError(t, err) + + consumeResult, err := store.ConsumeKeyPackages(ctx, []string{installationId}) + require.NoError(t, err) + require.Len(t, consumeResult, 1) + require.Equal(t, keyPackage, consumeResult[0].Data) + require.Equal(t, installationId, consumeResult[0].InstallationId) +} + +func TestConsumeMultipleKeyPackages(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + installationId := randomString(32) + walletAddress := randomString(32) + keyPackage := randomBytes(32) + + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + require.NoError(t, err) + + keyPackage2 := randomBytes(32) + require.NoError(t, store.InsertKeyPackages(ctx, []*KeyPackage{{ + ID: buildKeyPackageId(keyPackage2), + InstallationId: installationId, + CreatedAt: nowNs(), + IsLastResort: false, + Data: keyPackage2, + }})) + + consumeResult, err := store.ConsumeKeyPackages(ctx, []string{installationId}) + require.NoError(t, err) + require.Len(t, consumeResult, 1) + require.Equal(t, keyPackage2, consumeResult[0].Data) + require.Equal(t, installationId, consumeResult[0].InstallationId) + + consumeResult, err = store.ConsumeKeyPackages(ctx, []string{installationId}) + require.NoError(t, err) + require.Len(t, consumeResult, 1) + // Now we are out of regular key packages. Expect to consume the last resort + require.Equal(t, keyPackage, consumeResult[0].Data) +} diff --git a/pkg/mlsvalidate/config.go b/pkg/mlsvalidate/config.go new file mode 100644 index 00000000..dd644eab --- /dev/null +++ b/pkg/mlsvalidate/config.go @@ -0,0 +1,5 @@ +package mlsvalidate + +type MLSValidationOptions struct { + GRPCAddress string `long:"grpc-address" description:"Address for the GRPC validation service"` +} diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go new file mode 100644 index 00000000..36756ee2 --- /dev/null +++ b/pkg/mlsvalidate/service.go @@ -0,0 +1,107 @@ +package mlsvalidate + +import ( + "context" + "fmt" + + svc "github.com/xmtp/proto/v3/go/mls_validation/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +type IdentityValidationResult struct { + WalletAddress string + InstallationId string +} + +type GroupMessageValidationResult struct { + GroupId string +} + +type IdentityInput struct { + SigningPublicKey []byte + Identity []byte +} + +type MLSValidationService interface { + ValidateKeyPackages(ctx context.Context, keyPackages [][]byte) ([]IdentityValidationResult, error) + ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]GroupMessageValidationResult, error) +} + +type MLSValidationServiceImpl struct { + grpcClient svc.ValidationApiClient +} + +func NewMlsValidationService(ctx context.Context, options MLSValidationOptions) (*MLSValidationServiceImpl, error) { + conn, err := grpc.DialContext(ctx, options.GRPCAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, err + } + return &MLSValidationServiceImpl{ + grpcClient: svc.NewValidationApiClient(conn), + }, nil +} + +func (s *MLSValidationServiceImpl) ValidateKeyPackages(ctx context.Context, keyPackages [][]byte) ([]IdentityValidationResult, error) { + req := makeValidateKeyPackageRequest(keyPackages) + response, err := s.grpcClient.ValidateKeyPackages(ctx, req) + if err != nil { + return nil, err + } + out := make([]IdentityValidationResult, len(response.Responses)) + for i, response := range response.Responses { + if !response.IsOk { + return nil, fmt.Errorf("validation failed with error %s", response.ErrorMessage) + } + out[i] = IdentityValidationResult{ + WalletAddress: response.WalletAddress, + InstallationId: response.InstallationId, + } + } + return out, nil +} + +func makeValidateKeyPackageRequest(keyPackageBytes [][]byte) *svc.ValidateKeyPackagesRequest { + keyPackageRequests := make([]*svc.ValidateKeyPackagesRequest_KeyPackage, len(keyPackageBytes)) + for i, keyPackage := range keyPackageBytes { + keyPackageRequests[i] = &svc.ValidateKeyPackagesRequest_KeyPackage{ + KeyPackageBytesTlsSerialized: keyPackage, + } + } + return &svc.ValidateKeyPackagesRequest{ + KeyPackages: keyPackageRequests, + } +} + +func (s *MLSValidationServiceImpl) ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]GroupMessageValidationResult, error) { + req := makeValidateGroupMessagesRequest(groupMessages) + + response, err := s.grpcClient.ValidateGroupMessages(ctx, req) + if err != nil { + return nil, err + } + + out := make([]GroupMessageValidationResult, len(response.Responses)) + for i, response := range response.Responses { + if !response.IsOk { + return nil, fmt.Errorf("validation failed with error %s", response.ErrorMessage) + } + out[i] = GroupMessageValidationResult{ + GroupId: response.GroupId, + } + } + + return out, nil +} + +func makeValidateGroupMessagesRequest(groupMessages [][]byte) *svc.ValidateGroupMessagesRequest { + groupMessageRequests := make([]*svc.ValidateGroupMessagesRequest_GroupMessage, len(groupMessages)) + for i, groupMessage := range groupMessages { + groupMessageRequests[i] = &svc.ValidateGroupMessagesRequest_GroupMessage{ + GroupMessageBytesTlsSerialized: groupMessage, + } + } + return &svc.ValidateGroupMessagesRequest{ + GroupMessages: groupMessageRequests, + } +} diff --git a/pkg/mlsvalidate/service_test.go b/pkg/mlsvalidate/service_test.go new file mode 100644 index 00000000..2fb2cca3 --- /dev/null +++ b/pkg/mlsvalidate/service_test.go @@ -0,0 +1,63 @@ +package mlsvalidate + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + svc "github.com/xmtp/proto/v3/go/mls_validation/v1" + "google.golang.org/grpc" +) + +type MockedGRPCService struct { + mock.Mock +} + +func (m *MockedGRPCService) ValidateKeyPackages(ctx context.Context, req *svc.ValidateKeyPackagesRequest, opts ...grpc.CallOption) (*svc.ValidateKeyPackagesResponse, error) { + args := m.Called(ctx, req) + + return args.Get(0).(*svc.ValidateKeyPackagesResponse), args.Error(1) +} + +func (m *MockedGRPCService) ValidateGroupMessages(ctx context.Context, req *svc.ValidateGroupMessagesRequest, opts ...grpc.CallOption) (*svc.ValidateGroupMessagesResponse, error) { + args := m.Called(ctx, req) + + return args.Get(0).(*svc.ValidateGroupMessagesResponse), args.Error(1) +} + +func getMockedService() (*MockedGRPCService, MLSValidationService) { + mockService := new(MockedGRPCService) + service := &MLSValidationServiceImpl{ + grpcClient: mockService, + } + + return mockService, service +} + +func TestValidateKeyPackages(t *testing.T) { + mockGrpc, service := getMockedService() + + ctx := context.Background() + + firstResponse := svc.ValidateKeyPackagesResponse_ValidationResponse{ + IsOk: true, + WalletAddress: "0x123", + InstallationId: "123", + ErrorMessage: "", + } + + mockGrpc.On("ValidateKeyPackages", ctx, mock.Anything).Return(&svc.ValidateKeyPackagesResponse{ + Responses: []*svc.ValidateKeyPackagesResponse_ValidationResponse{&firstResponse}, + }, nil) + + res, err := service.ValidateKeyPackages(ctx, nil) + assert.NoError(t, err) + assert.Equal(t, 1, len(res)) + assert.Equal(t, "0x123", res[0].WalletAddress) + assert.Equal(t, "123", res[0].InstallationId) +} + +func TestValidateKeyPackagesError(t *testing.T) { + +} diff --git a/pkg/server/options.go b/pkg/server/options.go index 40041f4d..e21e3efb 100644 --- a/pkg/server/options.go +++ b/pkg/server/options.go @@ -5,6 +5,7 @@ import ( "github.com/xmtp/xmtp-node-go/pkg/api" "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/store" ) @@ -62,17 +63,19 @@ type Options struct { LogEncoding string `long:"log-encoding" description:"Log encoding format. Either console or json" choice:"console" choice:"json" default:"console"` CreateMessageMigration string `long:"create-message-migration" default:"" description:"Create a migration. Must provide a name"` CreateAuthzMigration string `long:"create-authz-migration" default:"" description:"Create a migration for the auth db. Must provide a name"` + CreateMlsMigration string `long:"create-mls-migration" default:"" description:"Create a migration for the mls db. Must provide a name"` WaitForDB time.Duration `long:"wait-for-db" description:"wait for DB on start, up to specified duration"` Version bool `long:"version" description:"Output binary version and exit"` GoProfiling bool `long:"go-profiling" description:"Enable Go profiling"` MetricsPeriod time.Duration `long:"metrics-period" description:"Polling period for server status metrics" default:"30s"` - API api.Options `group:"API Options" namespace:"api"` - Authz AuthzOptions `group:"Authz Options"` - Relay RelayOptions `group:"Relay Options"` - Store store.Options `group:"Store Options" namespace:"store"` - Metrics MetricsOptions `group:"Metrics Options"` - Tracing TracingOptions `group:"DD APM Tracing Options"` - Profiling ProfilingOptions `group:"DD APM Profiling Options" namespace:"profiling"` - MlsStore mlsstore.StoreOptions `group:"MLS Options" namespace:"mlsstore"` + API api.Options `group:"API Options" namespace:"api"` + Authz AuthzOptions `group:"Authz Options"` + Relay RelayOptions `group:"Relay Options"` + Store store.Options `group:"Store Options" namespace:"store"` + Metrics MetricsOptions `group:"Metrics Options"` + Tracing TracingOptions `group:"DD APM Tracing Options"` + Profiling ProfilingOptions `group:"DD APM Profiling Options" namespace:"profiling"` + MLSStore mlsstore.StoreOptions `group:"MLS Options" namespace:"mls-store"` + MlsValidation mlsvalidate.MLSValidationOptions `group:"MLS Validation Options" namespace:"mls-validation"` } diff --git a/pkg/server/server.go b/pkg/server/server.go index adf2ca53..8887fb82 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -37,7 +37,9 @@ import ( "github.com/xmtp/xmtp-node-go/pkg/metrics" authzmigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/authz" messagemigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/messages" + mlsmigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" xmtpstore "github.com/xmtp/xmtp-node-go/pkg/store" "github.com/xmtp/xmtp-node-go/pkg/tracing" "go.uber.org/zap" @@ -59,6 +61,7 @@ type Server struct { allowLister authz.WalletAllowLister authenticator *authn.XmtpAuthentication grpc *api.Server + MLSStore *mlsstore.Store } // Create a new Server @@ -226,32 +229,43 @@ func New(ctx context.Context, log *zap.Logger, options Options) (*Server, error) } s.log.With(logging.MultiAddrs("listen", maddrs...)).Info("got server") - var mlsStore mlsstore.MlsStore + var MLSStore mlsstore.MlsStore - if options.MlsStore.DbConnectionString != "" { - mlsDb, err := createBunDB(options.MlsStore.DbConnectionString, options.WaitForDB, options.MlsStore.ReadTimeout, options.MlsStore.WriteTimeout, options.MlsStore.MaxOpenConns) + if options.MLSStore.DbConnectionString != "" { + mlsDb, err := createBunDB(options.MLSStore.DbConnectionString, options.WaitForDB, options.MLSStore.ReadTimeout, options.MLSStore.WriteTimeout, options.MLSStore.MaxOpenConns) if err != nil { return nil, errors.Wrap(err, "creating mls db") } - mlsStore, err = mlsstore.New(mlsstore.Config{ + s.MLSStore, err = mlsstore.New(s.ctx, mlsstore.Config{ Log: s.log, DB: mlsDb, }) + if err != nil { return nil, errors.Wrap(err, "creating mls store") } } + var MLSValidator mlsvalidate.MLSValidationService + if options.MlsValidation.GRPCAddress != "" { + MLSValidator, err = mlsvalidate.NewMlsValidationService(ctx, options.MlsValidation) + if err != nil { + return nil, errors.Wrap(err, "creating mls validation service") + } + + } + // Initialize gRPC server. s.grpc, err = api.New( &api.Config{ - Options: options.API, - Log: s.log.Named("api"), - Waku: s.wakuNode, - Store: s.store, - MlsStore: mlsStore, - AllowLister: s.allowLister, + Options: options.API, + Log: s.log.Named("`api"), + Waku: s.wakuNode, + Store: s.store, + MLSStore: MLSStore, + AllowLister: s.allowLister, + MLSValidator: MLSValidator, }, ) if err != nil { @@ -292,6 +306,9 @@ func (s *Server) Shutdown() { if s.store != nil { s.store.Close() } + if s.MLSStore != nil { + s.MLSStore.Close() + } // Close metrics server. if s.metricsServer != nil { @@ -510,6 +527,20 @@ func CreateAuthzMigration(migrationName, dbConnectionString string, waitForDb, r return err } +func CreateMlsMigration(migrationName, dbConnectionString string, waitForDb, readTimeout, writeTimeout time.Duration, maxOpenConns int) error { + db, err := createBunDB(dbConnectionString, waitForDb, readTimeout, writeTimeout, maxOpenConns) + if err != nil { + return err + } + migrator := migrate.NewMigrator(db, mlsmigrations.Migrations) + files, err := migrator.CreateSQLMigrations(context.Background(), migrationName) + for _, mf := range files { + fmt.Printf("created authz migration %s (%s)\n", mf.Name, mf.Path) + } + + return err +} + func createBunDB(dsn string, waitForDB, readTimeout, writeTimeout time.Duration, maxOpenConns int) (*bun.DB, error) { db, err := createDB(dsn, waitForDB, readTimeout, writeTimeout, maxOpenConns) if err != nil { diff --git a/pkg/testing/store.go b/pkg/testing/store.go index 35806f45..f9a2266c 100644 --- a/pkg/testing/store.go +++ b/pkg/testing/store.go @@ -11,6 +11,7 @@ import ( "github.com/uptrace/bun/driver/pgdriver" "github.com/uptrace/bun/migrate" "github.com/xmtp/xmtp-node-go/pkg/migrations/authz" + "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" ) const ( @@ -48,3 +49,17 @@ func NewAuthzDB(t *testing.T) (*bun.DB, string, func()) { return bunDB, dsn, cleanup } + +func NewMlsDB(t *testing.T) (*bun.DB, string, func()) { + db, dsn, cleanup := NewDB(t) + bunDB := bun.NewDB(db, pgdialect.New()) + + ctx := context.Background() + migrator := migrate.NewMigrator(bunDB, mls.Migrations) + err := migrator.Init(ctx) + require.NoError(t, err) + _, err = migrator.Migrate(ctx) + require.NoError(t, err) + + return bunDB, dsn, cleanup +} From 4367d6449490a30118ea4cc030b7a0b218169f57 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Thu, 26 Oct 2023 18:44:31 -0700 Subject: [PATCH 02/20] Add more MLS methods (#321) * Scaffold MLS server * Update go.mod * Fix missing argument * Add unsaved file * Lint * Working end-to-end * Lint * Add new push action * Add a bunch of new endpoints * Address review comments * Change method casing * Change casing of server options * Change casing of validation options * Remove unused function * Remove double pointer * Make private again * Fix pointer to key package * Capitalize more things * Update server fields * Add test for sort methods * Save change to capitalization * Fix lint warnings * Fix problem with mocks * Fix index name * Move sorting to the store * Fix ciphertext validation * Make installation_id bytes * Add missing credential identity * Hack sql in query * Revert "Hack sql in query" This reverts commit 168b78a1111d135b175453b2e7a27cd25c8beef7. * Remove custom type * Update to latest protos * Add CredentialIdentity --- go.mod | 2 +- pkg/api/message/v3/service.go | 213 ++++++++++-- pkg/api/message/v3/service_test.go | 312 ++++++++++++++++++ .../mls/20231023050806_init-schema.up.sql | 7 +- pkg/mlsstore/models.go | 11 +- pkg/mlsstore/store.go | 108 +++++- pkg/mlsstore/store_test.go | 155 ++++++--- pkg/mlsvalidate/service.go | 10 +- pkg/mlsvalidate/service_test.go | 12 +- pkg/server/options.go | 2 +- pkg/server/server.go | 25 +- pkg/store/query_test.go | 31 ++ pkg/store/store.go | 72 ++++ pkg/testing/random.go | 7 + pkg/testing/store.go | 2 +- pkg/topic/topic.go | 13 +- 16 files changed, 872 insertions(+), 110 deletions(-) create mode 100644 pkg/api/message/v3/service_test.go diff --git a/go.mod b/go.mod index e86b30f8..e40e63bf 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.29.1-0.20231023182354-832c8d572ed4 + github.com/xmtp/proto/v3 v3.32.1-0.20231026053711-5efc208e3135 github.com/yoheimuta/protolint v0.39.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 diff --git a/pkg/api/message/v3/service.go b/pkg/api/message/v3/service.go index 9ea61de4..e3d4140d 100644 --- a/pkg/api/message/v3/service.go +++ b/pkg/api/message/v3/service.go @@ -4,10 +4,13 @@ import ( "context" wakunode "github.com/waku-org/go-waku/waku/v2/node" + wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" proto "github.com/xmtp/proto/v3/go/message_api/v3" + "github.com/xmtp/xmtp-node-go/pkg/metrics" "github.com/xmtp/xmtp-node-go/pkg/mlsstore" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/store" + "github.com/xmtp/xmtp-node-go/pkg/topic" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -22,9 +25,6 @@ type Service struct { messageStore *store.Store mlsStore mlsstore.MlsStore validationService mlsvalidate.MLSValidationService - - ctx context.Context - ctxCancel func() } func NewService(node *wakunode.WakuNode, logger *zap.Logger, messageStore *store.Store, mlsStore mlsstore.MlsStore, validationService mlsvalidate.MLSValidationService) (s *Service, err error) { @@ -36,18 +36,15 @@ func NewService(node *wakunode.WakuNode, logger *zap.Logger, messageStore *store validationService: validationService, } - s.ctx, s.ctxCancel = context.WithCancel(context.Background()) - + s.log.Info("Starting MLS service") return s, nil } -func (s *Service) Close() { - if s.ctxCancel != nil { - s.ctxCancel() +func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterInstallationRequest) (*proto.RegisterInstallationResponse, error) { + if err := validateRegisterInstallationRequest(req); err != nil { + return nil, err } -} -func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterInstallationRequest) (*proto.RegisterInstallationResponse, error) { results, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{req.LastResortKeyPackage.KeyPackageTlsSerialized}) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) @@ -58,9 +55,9 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterI installationId := results[0].InstallationId walletAddress := results[0].WalletAddress + credentialIdentity := results[0].CredentialIdentity - err = s.mlsStore.CreateInstallation(ctx, installationId, walletAddress, req.LastResortKeyPackage.KeyPackageTlsSerialized) - if err != nil { + if err = s.mlsStore.CreateInstallation(ctx, installationId, walletAddress, req.LastResortKeyPackage.KeyPackageTlsSerialized, credentialIdentity); err != nil { return nil, err } @@ -77,13 +74,13 @@ func (s *Service) ConsumeKeyPackages(ctx context.Context, req *proto.ConsumeKeyP } keyPackageMap := make(map[string]int) for idx, id := range ids { - keyPackageMap[id] = idx + keyPackageMap[string(id)] = idx } resPackages := make([]*proto.ConsumeKeyPackagesResponse_KeyPackage, len(keyPackages)) for _, keyPackage := range keyPackages { - idx, ok := keyPackageMap[keyPackage.InstallationId] + idx, ok := keyPackageMap[string(keyPackage.InstallationId)] if !ok { return nil, status.Errorf(codes.Internal, "could not find key package for installation") } @@ -98,15 +95,82 @@ func (s *Service) ConsumeKeyPackages(ctx context.Context, req *proto.ConsumeKeyP }, nil } -func (s *Service) PublishToGroup(ctx context.Context, req *proto.PublishToGroupRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") +func (s *Service) PublishToGroup(ctx context.Context, req *proto.PublishToGroupRequest) (res *emptypb.Empty, err error) { + if err = validatePublishToGroupRequest(req); err != nil { + return nil, err + } + + messages := make([][]byte, len(req.Messages)) + for i, message := range req.Messages { + v1 := message.GetV1() + if v1 == nil { + return nil, status.Errorf(codes.InvalidArgument, "message must be v1") + } + messages[i] = v1.MlsMessageTlsSerialized + } + + validationResults, err := s.validationService.ValidateGroupMessages(ctx, messages) + if err != nil { + // TODO: Separate validation errors from internal errors + return nil, status.Errorf(codes.InvalidArgument, "invalid group message: %s", err) + } + + for i, result := range validationResults { + message := messages[i] + + if err = requireReadyToSend(result.GroupId, message); err != nil { + return nil, err + } + + // TODO: Wrap this in a transaction so publishing is all or nothing + if err = s.publishMessage(ctx, topic.BuildGroupTopic(result.GroupId), message); err != nil { + return nil, status.Errorf(codes.Internal, "failed to publish message: %s", err) + } + } + + return &emptypb.Empty{}, nil } -func (s *Service) PublishWelcomes(ctx context.Context, req *proto.PublishWelcomesRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") +func (s *Service) publishMessage(ctx context.Context, contentTopic string, message []byte) error { + log := s.log.Named("publish-mls").With(zap.String("content_topic", contentTopic)) + env, err := s.messageStore.InsertMLSMessage(ctx, contentTopic, message) + if err != nil { + return status.Errorf(codes.Internal, "failed to insert message: %s", err) + } + + if _, err = s.waku.Relay().Publish(ctx, &wakupb.WakuMessage{ + ContentTopic: contentTopic, + Timestamp: int64(env.TimestampNs), + Payload: message, + }); err != nil { + return status.Errorf(codes.Internal, "failed to publish message: %s", err) + } + + metrics.EmitPublishedEnvelope(ctx, log, env) + + return nil +} + +func (s *Service) PublishWelcomes(ctx context.Context, req *proto.PublishWelcomesRequest) (res *emptypb.Empty, err error) { + if err = validatePublishWelcomesRequest(req); err != nil { + return nil, err + } + + // TODO: Wrap this in a transaction so publishing is all or nothing + for _, welcome := range req.WelcomeMessages { + contentTopic := topic.BuildWelcomeTopic(welcome.InstallationId) + if err = s.publishMessage(ctx, contentTopic, welcome.WelcomeMessage.GetV1().WelcomeMessageTlsSerialized); err != nil { + return nil, status.Errorf(codes.Internal, "failed to publish welcome message: %s", err) + } + } + return &emptypb.Empty{}, nil } -func (s *Service) UploadKeyPackages(ctx context.Context, req *proto.UploadKeyPackagesRequest) (*emptypb.Empty, error) { +func (s *Service) UploadKeyPackages(ctx context.Context, req *proto.UploadKeyPackagesRequest) (res *emptypb.Empty, err error) { + if err = validateUploadKeyPackagesRequest(req); err != nil { + return nil, err + } + // Extract the key packages from the request keyPackageBytes := make([][]byte, len(req.KeyPackages)) for i, keyPackage := range req.KeyPackages { keyPackageBytes[i] = keyPackage.KeyPackageTlsSerialized @@ -122,8 +186,8 @@ func (s *Service) UploadKeyPackages(ctx context.Context, req *proto.UploadKeyPac kp := mlsstore.NewKeyPackage(validationResult.InstallationId, keyPackageBytes[i], false) keyPackageModels[i] = kp } - err = s.mlsStore.InsertKeyPackages(ctx, keyPackageModels) - if err != nil { + + if err = s.mlsStore.InsertKeyPackages(ctx, keyPackageModels); err != nil { return nil, status.Errorf(codes.Internal, "failed to insert key packages: %s", err) } @@ -134,6 +198,109 @@ func (s *Service) RevokeInstallation(ctx context.Context, req *proto.RevokeInsta return nil, status.Errorf(codes.Unimplemented, "unimplemented") } -func (s *Service) GetIdentityUpdates(ctx context.Context, req *proto.GetIdentityUpdatesRequest) (*proto.GetIdentityUpdatesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") +func (s *Service) GetIdentityUpdates(ctx context.Context, req *proto.GetIdentityUpdatesRequest) (res *proto.GetIdentityUpdatesResponse, err error) { + if err = validateGetIdentityUpdatesRequest(req); err != nil { + return nil, err + } + + walletAddresses := req.WalletAddresses + updates, err := s.mlsStore.GetIdentityUpdates(ctx, req.WalletAddresses, int64(req.StartTimeNs)) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get identity updates: %s", err) + } + + resUpdates := make([]*proto.GetIdentityUpdatesResponse_WalletUpdates, len(walletAddresses)) + for i, walletAddress := range walletAddresses { + walletUpdates := updates[walletAddress] + + resUpdates[i] = &proto.GetIdentityUpdatesResponse_WalletUpdates{ + Updates: []*proto.GetIdentityUpdatesResponse_Update{}, + } + + for _, walletUpdate := range walletUpdates { + resUpdates[i].Updates = append(resUpdates[i].Updates, buildIdentityUpdate(walletUpdate)) + } + } + + return &proto.GetIdentityUpdatesResponse{ + Updates: resUpdates, + }, nil +} + +func buildIdentityUpdate(update mlsstore.IdentityUpdate) *proto.GetIdentityUpdatesResponse_Update { + base := proto.GetIdentityUpdatesResponse_Update{ + TimestampNs: update.TimestampNs, + } + switch update.Kind { + case mlsstore.Create: + base.Kind = &proto.GetIdentityUpdatesResponse_Update_NewInstallation{ + NewInstallation: &proto.GetIdentityUpdatesResponse_NewInstallationUpdate{ + InstallationId: update.InstallationId, + CredentialIdentity: update.CredentialIdentity, + }, + } + case mlsstore.Revoke: + base.Kind = &proto.GetIdentityUpdatesResponse_Update_RevokedInstallation{ + RevokedInstallation: &proto.GetIdentityUpdatesResponse_RevokedInstallationUpdate{ + InstallationId: update.InstallationId, + }, + } + } + + return &base +} + +func validatePublishToGroupRequest(req *proto.PublishToGroupRequest) error { + if req == nil || len(req.Messages) == 0 { + return status.Errorf(codes.InvalidArgument, "no messages to publish") + } + return nil +} + +func validatePublishWelcomesRequest(req *proto.PublishWelcomesRequest) error { + if req == nil || len(req.WelcomeMessages) == 0 { + return status.Errorf(codes.InvalidArgument, "no welcome messages to publish") + } + for _, welcome := range req.WelcomeMessages { + if welcome == nil || welcome.WelcomeMessage == nil { + return status.Errorf(codes.InvalidArgument, "invalid welcome message") + } + + v1 := welcome.WelcomeMessage.GetV1() + if v1 == nil || len(v1.WelcomeMessageTlsSerialized) == 0 { + return status.Errorf(codes.InvalidArgument, "invalid welcome message") + } + } + return nil +} + +func validateRegisterInstallationRequest(req *proto.RegisterInstallationRequest) error { + if req == nil || req.LastResortKeyPackage == nil { + return status.Errorf(codes.InvalidArgument, "no last resort key package") + } + return nil +} + +func validateUploadKeyPackagesRequest(req *proto.UploadKeyPackagesRequest) error { + if req == nil || len(req.KeyPackages) == 0 { + return status.Errorf(codes.InvalidArgument, "no key packages to upload") + } + return nil +} + +func validateGetIdentityUpdatesRequest(req *proto.GetIdentityUpdatesRequest) error { + if req == nil || len(req.WalletAddresses) == 0 { + return status.Errorf(codes.InvalidArgument, "no wallet addresses to get updates for") + } + return nil +} + +func requireReadyToSend(groupId string, message []byte) error { + if groupId == "" { + return status.Errorf(codes.InvalidArgument, "group id is empty") + } + if len(message) == 0 { + return status.Errorf(codes.InvalidArgument, "message is empty") + } + return nil } diff --git a/pkg/api/message/v3/service_test.go b/pkg/api/message/v3/service_test.go new file mode 100644 index 00000000..a2d61679 --- /dev/null +++ b/pkg/api/message/v3/service_test.go @@ -0,0 +1,312 @@ +package api + +import ( + "context" + "errors" + "fmt" + "testing" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "github.com/uptrace/bun" + v1 "github.com/xmtp/proto/v3/go/message_api/v1" + proto "github.com/xmtp/proto/v3/go/message_api/v3" + messageContents "github.com/xmtp/proto/v3/go/mls/message_contents" + "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" + "github.com/xmtp/xmtp-node-go/pkg/store" + test "github.com/xmtp/xmtp-node-go/pkg/testing" +) + +type mockedMLSValidationService struct { + mock.Mock +} + +func (m *mockedMLSValidationService) ValidateKeyPackages(ctx context.Context, keyPackages [][]byte) ([]mlsvalidate.IdentityValidationResult, error) { + args := m.Called(ctx, keyPackages) + + response := args.Get(0) + if response == nil { + return nil, args.Error(1) + } + + return response.([]mlsvalidate.IdentityValidationResult), args.Error(1) +} + +func (m *mockedMLSValidationService) ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]mlsvalidate.GroupMessageValidationResult, error) { + args := m.Called(ctx, groupMessages) + + return args.Get(0).([]mlsvalidate.GroupMessageValidationResult), args.Error(1) +} + +func newMockedValidationService() *mockedMLSValidationService { + return new(mockedMLSValidationService) +} + +func (m *mockedMLSValidationService) mockValidateKeyPackages(installationId []byte, walletAddress string) *mock.Call { + return m.On("ValidateKeyPackages", mock.Anything, mock.Anything).Return([]mlsvalidate.IdentityValidationResult{ + { + InstallationId: installationId, + WalletAddress: walletAddress, + CredentialIdentity: []byte("test"), + }, + }, nil) +} + +func (m *mockedMLSValidationService) mockValidateGroupMessages(groupId string) *mock.Call { + return m.On("ValidateGroupMessages", mock.Anything, mock.Anything).Return([]mlsvalidate.GroupMessageValidationResult{ + { + GroupId: groupId, + }, + }, nil) +} + +func newTestService(t *testing.T, ctx context.Context) (*Service, *bun.DB, *mockedMLSValidationService, func()) { + log := test.NewLog(t) + mlsDb, _, mlsDbCleanup := test.NewMLSDB(t) + mlsStore, err := mlsstore.New(ctx, mlsstore.Config{ + Log: log, + DB: mlsDb, + }) + require.NoError(t, err) + messageDb, _, messageDbCleanup := test.NewDB(t) + messageStore, err := store.New(&store.Config{ + Log: log, + DB: messageDb, + ReaderDB: messageDb, + CleanerDB: messageDb, + }) + require.NoError(t, err) + node, nodeCleanup := test.NewNode(t) + mlsValidationService := newMockedValidationService() + + svc, err := NewService(node, log, messageStore, mlsStore, mlsValidationService) + require.NoError(t, err) + + return svc, mlsDb, mlsValidationService, func() { + messageStore.Close() + mlsDbCleanup() + messageDbCleanup() + nodeCleanup() + } +} + +func TestRegisterInstallation(t *testing.T) { + ctx := context.Background() + svc, mlsDb, mlsValidationService, cleanup := newTestService(t, ctx) + defer cleanup() + + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + + mlsValidationService.mockValidateKeyPackages(installationId, walletAddress) + + res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test"), + }, + }) + + require.NoError(t, err) + require.Equal(t, installationId, res.InstallationId) + + installations := []mlsstore.Installation{} + err = mlsDb.NewSelect().Model(&installations).Where("id = ?", installationId).Scan(ctx) + require.NoError(t, err) + + require.Len(t, installations, 1) + require.Equal(t, walletAddress, installations[0].WalletAddress) +} + +func TestRegisterInstallationError(t *testing.T) { + ctx := context.Background() + svc, _, mlsValidationService, cleanup := newTestService(t, ctx) + defer cleanup() + + mlsValidationService.On("ValidateKeyPackages", ctx, mock.Anything).Return(nil, errors.New("error validating")) + + res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test"), + }, + }) + require.Error(t, err) + require.Nil(t, res) +} + +func TestUploadKeyPackages(t *testing.T) { + ctx := context.Background() + svc, mlsDb, mlsValidationService, cleanup := newTestService(t, ctx) + defer cleanup() + + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + + mlsValidationService.mockValidateKeyPackages(installationId, walletAddress) + + res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test"), + }, + }) + require.NoError(t, err) + require.NotNil(t, res) + + uploadRes, err := svc.UploadKeyPackages(ctx, &proto.UploadKeyPackagesRequest{ + KeyPackages: []*proto.KeyPackageUpload{ + {KeyPackageTlsSerialized: []byte("test2")}, + }, + }) + require.NoError(t, err) + require.NotNil(t, uploadRes) + + keyPackages := []mlsstore.KeyPackage{} + err = mlsDb.NewSelect().Model(&keyPackages).Where("installation_id = ?", installationId).Scan(ctx) + require.NoError(t, err) + require.Len(t, keyPackages, 2) +} + +func TestConsumeKeyPackages(t *testing.T) { + ctx := context.Background() + svc, _, mlsValidationService, cleanup := newTestService(t, ctx) + defer cleanup() + + installationId1 := test.RandomBytes(32) + walletAddress1 := test.RandomString(32) + + mockCall := mlsValidationService.mockValidateKeyPackages(installationId1, walletAddress1) + + res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test"), + }, + }) + require.NoError(t, err) + require.NotNil(t, res) + + // Add a second key package + installationId2 := test.RandomBytes(32) + walletAddress2 := test.RandomString(32) + // Unset the original mock so we can set a new one + mockCall.Unset() + mlsValidationService.mockValidateKeyPackages(installationId2, walletAddress2) + + res, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test2"), + }, + }) + require.NoError(t, err) + require.NotNil(t, res) + + consumeRes, err := svc.ConsumeKeyPackages(ctx, &proto.ConsumeKeyPackagesRequest{ + InstallationIds: [][]byte{installationId1, installationId2}, + }) + require.NoError(t, err) + require.NotNil(t, consumeRes) + require.Len(t, consumeRes.KeyPackages, 2) + require.Equal(t, []byte("test"), consumeRes.KeyPackages[0].KeyPackageTlsSerialized) + require.Equal(t, []byte("test2"), consumeRes.KeyPackages[1].KeyPackageTlsSerialized) + + // Now do it with the installationIds reversed + consumeRes, err = svc.ConsumeKeyPackages(ctx, &proto.ConsumeKeyPackagesRequest{ + InstallationIds: [][]byte{installationId2, installationId1}, + }) + + require.NoError(t, err) + require.NotNil(t, consumeRes) + require.Len(t, consumeRes.KeyPackages, 2) + require.Equal(t, []byte("test2"), consumeRes.KeyPackages[0].KeyPackageTlsSerialized) + require.Equal(t, []byte("test"), consumeRes.KeyPackages[1].KeyPackageTlsSerialized) +} + +// Trying to consume key packages that don't exist should fail +func TestConsumeKeyPackagesFail(t *testing.T) { + ctx := context.Background() + svc, _, _, cleanup := newTestService(t, ctx) + defer cleanup() + + consumeRes, err := svc.ConsumeKeyPackages(ctx, &proto.ConsumeKeyPackagesRequest{ + InstallationIds: [][]byte{test.RandomBytes(32)}, + }) + require.Error(t, err) + require.Nil(t, consumeRes) +} + +func TestPublishToGroup(t *testing.T) { + ctx := context.Background() + svc, _, mlsValidationService, cleanup := newTestService(t, ctx) + defer cleanup() + + groupId := test.RandomString(32) + + mlsValidationService.mockValidateGroupMessages(groupId) + + _, err := svc.PublishToGroup(ctx, &proto.PublishToGroupRequest{ + Messages: []*messageContents.GroupMessage{{ + Version: &messageContents.GroupMessage_V1_{ + V1: &messageContents.GroupMessage_V1{ + MlsMessageTlsSerialized: []byte("test"), + }, + }, + }}, + }) + require.NoError(t, err) + + results, err := svc.messageStore.Query(&v1.QueryRequest{ + ContentTopics: []string{fmt.Sprintf("/xmtp/3/g-%s/proto", groupId)}, + }) + require.NoError(t, err) + require.Len(t, results.Envelopes, 1) + require.Equal(t, results.Envelopes[0].Message, []byte("test")) + require.NotNil(t, results.Envelopes[0].TimestampNs) +} + +func TestGetIdentityUpdates(t *testing.T) { + ctx := context.Background() + svc, _, mlsValidationService, cleanup := newTestService(t, ctx) + defer cleanup() + + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + + mockCall := mlsValidationService.mockValidateKeyPackages(installationId, walletAddress) + + _, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test"), + }, + }) + require.NoError(t, err) + + identityUpdates, err := svc.GetIdentityUpdates(ctx, &proto.GetIdentityUpdatesRequest{ + WalletAddresses: []string{walletAddress}, + }) + require.NoError(t, err) + require.NotNil(t, identityUpdates) + require.Len(t, identityUpdates.Updates, 1) + require.Equal(t, identityUpdates.Updates[0].Updates[0].GetNewInstallation().InstallationId, installationId) + require.Equal(t, identityUpdates.Updates[0].Updates[0].GetNewInstallation().CredentialIdentity, []byte("test")) + + for _, walletUpdate := range identityUpdates.Updates { + for _, update := range walletUpdate.Updates { + require.Equal(t, installationId, update.GetNewInstallation().InstallationId) + } + } + + mockCall.Unset() + mlsValidationService.mockValidateKeyPackages(test.RandomBytes(32), walletAddress) + _, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ + LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test"), + }, + }) + require.NoError(t, err) + + identityUpdates, err = svc.GetIdentityUpdates(ctx, &proto.GetIdentityUpdatesRequest{ + WalletAddresses: []string{walletAddress}, + }) + require.NoError(t, err) + require.Len(t, identityUpdates.Updates, 1) + require.Len(t, identityUpdates.Updates[0].Updates, 2) +} diff --git a/pkg/migrations/mls/20231023050806_init-schema.up.sql b/pkg/migrations/mls/20231023050806_init-schema.up.sql index b6aa90d5..e77152e9 100644 --- a/pkg/migrations/mls/20231023050806_init-schema.up.sql +++ b/pkg/migrations/mls/20231023050806_init-schema.up.sql @@ -3,16 +3,17 @@ SET --bun:split CREATE TABLE installations ( - id TEXT PRIMARY KEY, + id BYTEA PRIMARY KEY, wallet_address TEXT NOT NULL, created_at BIGINT NOT NULL, + credential_identity BYTEA NOT NULL, revoked_at BIGINT ); --bun:split CREATE TABLE key_packages ( id TEXT PRIMARY KEY, - installation_id TEXT NOT NULL, + installation_id BYTEA NOT NULL, created_at BIGINT NOT NULL, consumed_at BIGINT, not_consumed BOOLEAN DEFAULT TRUE NOT NULL, @@ -33,7 +34,7 @@ CREATE INDEX idx_installations_revoked_at ON installations(revoked_at); --bun:split -- Adding indexes for the key_packages table -CREATE INDEX idx_key_packages_installation_id_not_is_last_resort_created_at ON key_packages( +CREATE INDEX idx_key_packages_installation_id_not_consumed_is_last_resort_created_at ON key_packages( installation_id, not_consumed, is_last_resort, diff --git a/pkg/mlsstore/models.go b/pkg/mlsstore/models.go index 533c595d..226db843 100644 --- a/pkg/mlsstore/models.go +++ b/pkg/mlsstore/models.go @@ -5,17 +5,18 @@ import "github.com/uptrace/bun" type Installation struct { bun.BaseModel `bun:"table:installations"` - ID string `bun:",pk"` - WalletAddress string `bun:"wallet_address,notnull"` - CreatedAt int64 `bun:"created_at,notnull"` - RevokedAt *int64 `bun:"revoked_at"` + ID []byte `bun:",pk,type:bytea"` + WalletAddress string `bun:"wallet_address,notnull"` + CreatedAt int64 `bun:"created_at,notnull"` + RevokedAt *int64 `bun:"revoked_at"` + CredentialIdentity []byte `bun:"credential_identity,notnull,type:bytea"` } type KeyPackage struct { bun.BaseModel `bun:"table:key_packages"` ID string `bun:",pk"` // ID is the hash of the data field - InstallationId string `bun:"installation_id,notnull"` + InstallationId []byte `bun:"installation_id,notnull,type:bytea"` CreatedAt int64 `bun:"created_at,notnull"` ConsumedAt *int64 `bun:"consumed_at"` NotConsumed bool `bun:"not_consumed,default:true"` diff --git a/pkg/mlsstore/store.go b/pkg/mlsstore/store.go index f528b78d..df2f392a 100644 --- a/pkg/mlsstore/store.go +++ b/pkg/mlsstore/store.go @@ -6,6 +6,7 @@ import ( "database/sql" "encoding/hex" "errors" + "sort" "time" "github.com/uptrace/bun" @@ -21,9 +22,10 @@ type Store struct { } type MlsStore interface { - CreateInstallation(ctx context.Context, installationId string, walletAddress string, lastResortKeyPackage []byte) error + CreateInstallation(ctx context.Context, installationId []byte, walletAddress string, lastResortKeyPackage []byte, credentialIdentity []byte) error InsertKeyPackages(ctx context.Context, keyPackages []*KeyPackage) error - ConsumeKeyPackages(ctx context.Context, installationIds []string) ([]*KeyPackage, error) + ConsumeKeyPackages(ctx context.Context, installationIds [][]byte) ([]*KeyPackage, error) + GetIdentityUpdates(ctx context.Context, walletAddresses []string, startTimeNs int64) (map[string]IdentityUpdateList, error) } func New(ctx context.Context, config Config) (*Store, error) { @@ -40,20 +42,15 @@ func New(ctx context.Context, config Config) (*Store, error) { return s, nil } -func (s *Store) Close() { - if s.db != nil { - s.db.Close() - } -} - // Creates the installation and last resort key package -func (s *Store) CreateInstallation(ctx context.Context, installationId string, walletAddress string, lastResortKeyPackage []byte) error { +func (s *Store) CreateInstallation(ctx context.Context, installationId []byte, walletAddress string, lastResortKeyPackage []byte, credentialIdentity []byte) error { createdAt := nowNs() installation := Installation{ - ID: installationId, - WalletAddress: walletAddress, - CreatedAt: createdAt, + ID: installationId, + WalletAddress: walletAddress, + CreatedAt: createdAt, + CredentialIdentity: credentialIdentity, } keyPackage := NewKeyPackage(installationId, lastResortKeyPackage, true) @@ -87,7 +84,7 @@ func (s *Store) InsertKeyPackages(ctx context.Context, keyPackages []*KeyPackage return err } -func (s *Store) ConsumeKeyPackages(ctx context.Context, installationIds []string) ([]*KeyPackage, error) { +func (s *Store) ConsumeKeyPackages(ctx context.Context, installationIds [][]byte) ([]*KeyPackage, error) { keyPackages := make([]*KeyPackage, 0) err := s.db.RunInTx(ctx, &sql.TxOptions{}, func(ctx context.Context, tx bun.Tx) error { err := tx.NewRaw(` @@ -125,7 +122,61 @@ func (s *Store) ConsumeKeyPackages(ctx context.Context, installationIds []string return keyPackages, nil } -func NewKeyPackage(installationId string, data []byte, isLastResort bool) *KeyPackage { +func (s *Store) GetIdentityUpdates(ctx context.Context, walletAddresses []string, startTimeNs int64) (map[string]IdentityUpdateList, error) { + updated := make([]*Installation, 0) + // Find all installations that were changed since the startTimeNs + err := s.db.NewSelect(). + Model(&updated). + Where("wallet_address IN (?)", bun.In(walletAddresses)). + WhereGroup(" AND ", func(q *bun.SelectQuery) *bun.SelectQuery { + return q.Where("created_at > ?", startTimeNs).WhereOr("revoked_at > ?", startTimeNs) + }). + Order("created_at ASC"). + Scan(ctx) + + if err != nil { + return nil, err + } + + // The returned list is only partially sorted + out := make(map[string]IdentityUpdateList) + for _, installation := range updated { + if installation.CreatedAt > startTimeNs { + out[installation.WalletAddress] = append(out[installation.WalletAddress], IdentityUpdate{ + Kind: Create, + InstallationId: installation.ID, + CredentialIdentity: installation.CredentialIdentity, + TimestampNs: uint64(installation.CreatedAt), + }) + } + if installation.RevokedAt != nil && *installation.RevokedAt > startTimeNs { + out[installation.WalletAddress] = append(out[installation.WalletAddress], IdentityUpdate{ + Kind: Revoke, + InstallationId: installation.ID, + TimestampNs: uint64(*installation.RevokedAt), + }) + } + } + // Sort the updates by timestamp now that the full list is assembled + for _, updates := range out { + sort.Sort(updates) + } + + return out, nil +} + +func (s *Store) RevokeInstallation(ctx context.Context, installationId []byte) error { + _, err := s.db.NewUpdate(). + Model(&Installation{}). + Set("revoked_at = ?", nowNs()). + Where("id = ?", installationId). + Where("revoked_at IS NULL"). + Exec(ctx) + + return err +} + +func NewKeyPackage(installationId []byte, data []byte, isLastResort bool) *KeyPackage { return &KeyPackage{ ID: buildKeyPackageId(data), InstallationId: installationId, @@ -171,3 +222,32 @@ func buildKeyPackageId(keyPackageData []byte) string { digest := sha256.Sum256(keyPackageData) return hex.EncodeToString(digest[:]) } + +type IdentityUpdateKind int + +const ( + Create IdentityUpdateKind = iota + Revoke +) + +type IdentityUpdate struct { + Kind IdentityUpdateKind + InstallationId []byte + CredentialIdentity []byte + TimestampNs uint64 +} + +// Add the required methods to make a valid sort.Sort interface +type IdentityUpdateList []IdentityUpdate + +func (a IdentityUpdateList) Len() int { + return len(a) +} + +func (a IdentityUpdateList) Swap(i, j int) { + a[i], a[j] = a[j], a[i] +} + +func (a IdentityUpdateList) Less(i, j int) bool { + return a[i].TimestampNs < a[j].TimestampNs +} diff --git a/pkg/mlsstore/store_test.go b/pkg/mlsstore/store_test.go index 026b3da9..50673cec 100644 --- a/pkg/mlsstore/store_test.go +++ b/pkg/mlsstore/store_test.go @@ -2,8 +2,7 @@ package mlsstore import ( "context" - "crypto/rand" - "fmt" + "sort" "testing" "github.com/stretchr/testify/require" @@ -12,7 +11,7 @@ import ( func NewTestStore(t *testing.T) (*Store, func()) { log := test.NewLog(t) - db, _, dbCleanup := test.NewMlsDB(t) + db, _, dbCleanup := test.NewMLSDB(t) ctx := context.Background() c := Config{ Log: log, @@ -25,25 +24,15 @@ func NewTestStore(t *testing.T) (*Store, func()) { return store, dbCleanup } -func randomBytes(n int) []byte { - b := make([]byte, n) - _, _ = rand.Reader.Read(b) - return b -} - -func randomString(n int) string { - return fmt.Sprintf("%x", randomBytes(n)) -} - func TestCreateInstallation(t *testing.T) { store, cleanup := NewTestStore(t) defer cleanup() ctx := context.Background() - installationId := randomString(32) - walletAddress := randomString(32) + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, randomBytes(32)) + err := store.CreateInstallation(ctx, installationId, walletAddress, test.RandomBytes(32), test.RandomBytes(32)) require.NoError(t, err) installationFromDb := &Installation{} @@ -60,13 +49,13 @@ func TestCreateInstallationIdempotent(t *testing.T) { defer cleanup() ctx := context.Background() - installationId := randomString(32) - walletAddress := randomString(32) - keyPackage := randomBytes(32) + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + keyPackage := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) require.NoError(t, err) - err = store.CreateInstallation(ctx, installationId, walletAddress, randomBytes(32)) + err = store.CreateInstallation(ctx, installationId, walletAddress, test.RandomBytes(32), test.RandomBytes(32)) require.NoError(t, err) keyPackageFromDb := &KeyPackage{} @@ -79,14 +68,14 @@ func TestInsertKeyPackages(t *testing.T) { defer cleanup() ctx := context.Background() - installationId := randomString(32) - walletAddress := randomString(32) - keyPackage := randomBytes(32) + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + keyPackage := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) require.NoError(t, err) - keyPackage2 := randomBytes(32) + keyPackage2 := test.RandomBytes(32) err = store.InsertKeyPackages(ctx, []*KeyPackage{{ ID: buildKeyPackageId(keyPackage2), InstallationId: installationId, @@ -122,14 +111,14 @@ func TestConsumeLastResortKeyPackage(t *testing.T) { defer cleanup() ctx := context.Background() - installationId := randomString(32) - walletAddress := randomString(32) - keyPackage := randomBytes(32) + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + keyPackage := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) require.NoError(t, err) - consumeResult, err := store.ConsumeKeyPackages(ctx, []string{installationId}) + consumeResult, err := store.ConsumeKeyPackages(ctx, [][]byte{installationId}) require.NoError(t, err) require.Len(t, consumeResult, 1) require.Equal(t, keyPackage, consumeResult[0].Data) @@ -141,14 +130,14 @@ func TestConsumeMultipleKeyPackages(t *testing.T) { defer cleanup() ctx := context.Background() - installationId := randomString(32) - walletAddress := randomString(32) - keyPackage := randomBytes(32) + installationId := test.RandomBytes(32) + walletAddress := test.RandomString(32) + keyPackage := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage) + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) require.NoError(t, err) - keyPackage2 := randomBytes(32) + keyPackage2 := test.RandomBytes(32) require.NoError(t, store.InsertKeyPackages(ctx, []*KeyPackage{{ ID: buildKeyPackageId(keyPackage2), InstallationId: installationId, @@ -157,15 +146,105 @@ func TestConsumeMultipleKeyPackages(t *testing.T) { Data: keyPackage2, }})) - consumeResult, err := store.ConsumeKeyPackages(ctx, []string{installationId}) + consumeResult, err := store.ConsumeKeyPackages(ctx, [][]byte{installationId}) require.NoError(t, err) require.Len(t, consumeResult, 1) require.Equal(t, keyPackage2, consumeResult[0].Data) require.Equal(t, installationId, consumeResult[0].InstallationId) - consumeResult, err = store.ConsumeKeyPackages(ctx, []string{installationId}) + consumeResult, err = store.ConsumeKeyPackages(ctx, [][]byte{installationId}) require.NoError(t, err) require.Len(t, consumeResult, 1) // Now we are out of regular key packages. Expect to consume the last resort require.Equal(t, keyPackage, consumeResult[0].Data) } + +func TestGetIdentityUpdates(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + walletAddress := test.RandomString(32) + + installationId1 := test.RandomBytes(32) + keyPackage1 := test.RandomBytes(32) + + err := store.CreateInstallation(ctx, installationId1, walletAddress, keyPackage1, keyPackage1) + require.NoError(t, err) + + installationId2 := test.RandomBytes(32) + keyPackage2 := test.RandomBytes(32) + + err = store.CreateInstallation(ctx, installationId2, walletAddress, keyPackage2, keyPackage2) + require.NoError(t, err) + + identityUpdates, err := store.GetIdentityUpdates(ctx, []string{walletAddress}, 0) + require.NoError(t, err) + require.Len(t, identityUpdates[walletAddress], 2) + require.Equal(t, identityUpdates[walletAddress][0].InstallationId, installationId1) + require.Equal(t, identityUpdates[walletAddress][0].Kind, Create) + require.Equal(t, identityUpdates[walletAddress][1].InstallationId, installationId2) + + // Make sure that date filtering works + identityUpdates, err = store.GetIdentityUpdates(ctx, []string{walletAddress}, nowNs()+1000000) + require.NoError(t, err) + require.Len(t, identityUpdates[walletAddress], 0) +} + +func TestGetIdentityUpdatesMultipleWallets(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + walletAddress1 := test.RandomString(32) + installationId1 := test.RandomBytes(32) + keyPackage1 := test.RandomBytes(32) + + err := store.CreateInstallation(ctx, installationId1, walletAddress1, keyPackage1, keyPackage1) + require.NoError(t, err) + + walletAddress2 := test.RandomString(32) + installationId2 := test.RandomBytes(32) + keyPackage2 := test.RandomBytes(32) + + err = store.CreateInstallation(ctx, installationId2, walletAddress2, keyPackage2, keyPackage2) + require.NoError(t, err) + + identityUpdates, err := store.GetIdentityUpdates(ctx, []string{walletAddress1, walletAddress2}, 0) + require.NoError(t, err) + require.Len(t, identityUpdates[walletAddress1], 1) + require.Len(t, identityUpdates[walletAddress2], 1) +} + +func TestGetIdentityUpdatesNoResult(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + walletAddress := test.RandomString(32) + + identityUpdates, err := store.GetIdentityUpdates(ctx, []string{walletAddress}, 0) + require.NoError(t, err) + require.Len(t, identityUpdates[walletAddress], 0) +} + +func TestIdentityUpdateSort(t *testing.T) { + updates := IdentityUpdateList([]IdentityUpdate{ + { + Kind: Create, + TimestampNs: 2, + }, + { + Kind: Create, + TimestampNs: 3, + }, + { + Kind: Create, + TimestampNs: 1, + }, + }) + sort.Sort(updates) + require.Equal(t, updates[0].TimestampNs, uint64(1)) + require.Equal(t, updates[1].TimestampNs, uint64(2)) + require.Equal(t, updates[2].TimestampNs, uint64(3)) +} diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go index 36756ee2..686e533e 100644 --- a/pkg/mlsvalidate/service.go +++ b/pkg/mlsvalidate/service.go @@ -10,8 +10,9 @@ import ( ) type IdentityValidationResult struct { - WalletAddress string - InstallationId string + WalletAddress string + InstallationId []byte + CredentialIdentity []byte } type GroupMessageValidationResult struct { @@ -54,8 +55,9 @@ func (s *MLSValidationServiceImpl) ValidateKeyPackages(ctx context.Context, keyP return nil, fmt.Errorf("validation failed with error %s", response.ErrorMessage) } out[i] = IdentityValidationResult{ - WalletAddress: response.WalletAddress, - InstallationId: response.InstallationId, + WalletAddress: response.WalletAddress, + InstallationId: response.InstallationId, + CredentialIdentity: response.CredentialIdentityBytes, } } return out, nil diff --git a/pkg/mlsvalidate/service_test.go b/pkg/mlsvalidate/service_test.go index 2fb2cca3..9613eb98 100644 --- a/pkg/mlsvalidate/service_test.go +++ b/pkg/mlsvalidate/service_test.go @@ -41,10 +41,11 @@ func TestValidateKeyPackages(t *testing.T) { ctx := context.Background() firstResponse := svc.ValidateKeyPackagesResponse_ValidationResponse{ - IsOk: true, - WalletAddress: "0x123", - InstallationId: "123", - ErrorMessage: "", + IsOk: true, + WalletAddress: "0x123", + InstallationId: []byte("123"), + CredentialIdentityBytes: []byte("456"), + ErrorMessage: "", } mockGrpc.On("ValidateKeyPackages", ctx, mock.Anything).Return(&svc.ValidateKeyPackagesResponse{ @@ -55,7 +56,8 @@ func TestValidateKeyPackages(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 1, len(res)) assert.Equal(t, "0x123", res[0].WalletAddress) - assert.Equal(t, "123", res[0].InstallationId) + assert.Equal(t, []byte("123"), res[0].InstallationId) + assert.Equal(t, []byte("456"), res[0].CredentialIdentity) } func TestValidateKeyPackagesError(t *testing.T) { diff --git a/pkg/server/options.go b/pkg/server/options.go index e21e3efb..477c99e9 100644 --- a/pkg/server/options.go +++ b/pkg/server/options.go @@ -77,5 +77,5 @@ type Options struct { Tracing TracingOptions `group:"DD APM Tracing Options"` Profiling ProfilingOptions `group:"DD APM Profiling Options" namespace:"profiling"` MLSStore mlsstore.StoreOptions `group:"MLS Options" namespace:"mls-store"` - MlsValidation mlsvalidate.MLSValidationOptions `group:"MLS Validation Options" namespace:"mls-validation"` + MLSValidation mlsvalidate.MLSValidationOptions `group:"MLS Validation Options" namespace:"mls-validation"` } diff --git a/pkg/server/server.go b/pkg/server/server.go index 8887fb82..90f96e12 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -61,7 +61,7 @@ type Server struct { allowLister authz.WalletAllowLister authenticator *authn.XmtpAuthentication grpc *api.Server - MLSStore *mlsstore.Store + mlsDB *bun.DB } // Create a new Server @@ -229,27 +229,24 @@ func New(ctx context.Context, log *zap.Logger, options Options) (*Server, error) } s.log.With(logging.MultiAddrs("listen", maddrs...)).Info("got server") - var MLSStore mlsstore.MlsStore - + var MLSStore *mlsstore.Store if options.MLSStore.DbConnectionString != "" { - mlsDb, err := createBunDB(options.MLSStore.DbConnectionString, options.WaitForDB, options.MLSStore.ReadTimeout, options.MLSStore.WriteTimeout, options.MLSStore.MaxOpenConns) - if err != nil { + if s.mlsDB, err = createBunDB(options.MLSStore.DbConnectionString, options.WaitForDB, options.MLSStore.ReadTimeout, options.MLSStore.WriteTimeout, options.MLSStore.MaxOpenConns); err != nil { return nil, errors.Wrap(err, "creating mls db") } - s.MLSStore, err = mlsstore.New(s.ctx, mlsstore.Config{ + s.log.Info("creating mls store") + if MLSStore, err = mlsstore.New(s.ctx, mlsstore.Config{ Log: s.log, - DB: mlsDb, - }) - - if err != nil { + DB: s.mlsDB, + }); err != nil { return nil, errors.Wrap(err, "creating mls store") } } var MLSValidator mlsvalidate.MLSValidationService - if options.MlsValidation.GRPCAddress != "" { - MLSValidator, err = mlsvalidate.NewMlsValidationService(ctx, options.MlsValidation) + if options.MLSValidation.GRPCAddress != "" { + MLSValidator, err = mlsvalidate.NewMlsValidationService(ctx, options.MLSValidation) if err != nil { return nil, errors.Wrap(err, "creating mls validation service") } @@ -306,8 +303,8 @@ func (s *Server) Shutdown() { if s.store != nil { s.store.Close() } - if s.MLSStore != nil { - s.MLSStore.Close() + if s.mlsDB != nil { + s.mlsDB.Close() } // Close metrics server. diff --git a/pkg/store/query_test.go b/pkg/store/query_test.go index 5d084e4a..d3c2c028 100644 --- a/pkg/store/query_test.go +++ b/pkg/store/query_test.go @@ -1,6 +1,7 @@ package store import ( + "context" "testing" "time" @@ -284,3 +285,33 @@ func TestPageSizeOne(t *testing.T) { loops++ } } + +func TestMlsMessagePublish(t *testing.T) { + store, cleanup, _ := createAndFillDb(t) + defer cleanup() + + message := []byte{1, 2, 3} + contentTopic := "foo" + ctx := context.Background() + + env, err := store.InsertMLSMessage(ctx, contentTopic, message) + require.NoError(t, err) + + require.Equal(t, env.ContentTopic, contentTopic) + require.Equal(t, env.Message, message) + + response, err := store.Query(&messagev1.QueryRequest{ + ContentTopics: []string{contentTopic}, + }) + require.NoError(t, err) + require.Len(t, response.Envelopes, 1) + require.Equal(t, response.Envelopes[0].Message, message) + require.Equal(t, response.Envelopes[0].ContentTopic, contentTopic) + require.NotNil(t, response.Envelopes[0].TimestampNs) + + parsedTime := time.Unix(0, int64(response.Envelopes[0].TimestampNs)) + // Sanity check to ensure that the timestamps are reasonable + require.True(t, time.Since(parsedTime) < 10*time.Second || time.Since(parsedTime) > -10*time.Second) + + require.Equal(t, env.TimestampNs, response.Envelopes[0].TimestampNs) +} diff --git a/pkg/store/store.go b/pkg/store/store.go index 71e17d9a..4a309044 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -2,6 +2,7 @@ package store import ( "context" + "fmt" "strings" "sync" "time" @@ -20,6 +21,22 @@ import ( const maxPageSize = 100 +const timestampGeneratorSql = `( + ( + EXTRACT( + EPOCH + FROM + clock_timestamp() + ) :: bigint * 1000000000 + ) + ( + EXTRACT( + MICROSECONDS + FROM + clock_timestamp() + ) :: bigint * 1000 + ) +)` + type Store struct { config *Config ctx context.Context @@ -127,6 +144,61 @@ func (s *Store) InsertMessage(env *messagev1.Envelope) (bool, error) { return stored, err } +func (s *Store) InsertMLSMessage(ctx context.Context, contentTopic string, data []byte) (*messagev1.Envelope, error) { + tmpEnvelope := &messagev1.Envelope{ + ContentTopic: contentTopic, + Message: data, + } + digest := computeDigest(tmpEnvelope) + var envelope messagev1.Envelope + + err := tracing.Wrap(s.ctx, s.log, "storing mls message", func(ctx context.Context, log *zap.Logger, span tracing.Span) error { + tracing.SpanResource(span, "store") + tracing.SpanType(span, "db") + + stmnt := fmt.Sprintf(`INSERT INTO + message ( + id, + receiverTimestamp, + senderTimestamp, + contentTopic, + pubsubTopic, + payload, + version, + should_expire + ) + VALUES + ( + $1, + %s, + %s, + $2, + $3, + $4, + $5, + $6 + ) RETURNING senderTimestamp`, timestampGeneratorSql, timestampGeneratorSql) + + var senderTimestamp uint64 + err := s.config.DB.QueryRowContext(ctx, stmnt, digest, contentTopic, "", data, 0, false).Scan(&senderTimestamp) + if err != nil { + return err + } + envelope = messagev1.Envelope{ + ContentTopic: contentTopic, + TimestampNs: senderTimestamp, + Message: data, + } + return err + }) + + if err != nil { + return nil, err + } + + return &envelope, nil +} + func (s *Store) insertMessage(env *messagev1.Envelope, receiverTimestamp int64) error { digest := computeDigest(env) shouldExpire := !isXMTP(env.ContentTopic) diff --git a/pkg/testing/random.go b/pkg/testing/random.go index e96427c4..508331db 100644 --- a/pkg/testing/random.go +++ b/pkg/testing/random.go @@ -1,6 +1,7 @@ package testing import ( + cryptoRand "crypto/rand" "math/rand" "strings" ) @@ -18,3 +19,9 @@ func RandomString(n int) string { func RandomStringLower(n int) string { return strings.ToLower(RandomString(n)) } + +func RandomBytes(n int) []byte { + b := make([]byte, n) + _, _ = cryptoRand.Read(b) + return b +} diff --git a/pkg/testing/store.go b/pkg/testing/store.go index f9a2266c..3727fe27 100644 --- a/pkg/testing/store.go +++ b/pkg/testing/store.go @@ -50,7 +50,7 @@ func NewAuthzDB(t *testing.T) (*bun.DB, string, func()) { return bunDB, dsn, cleanup } -func NewMlsDB(t *testing.T) (*bun.DB, string, func()) { +func NewMLSDB(t *testing.T) (*bun.DB, string, func()) { db, dsn, cleanup := NewDB(t) bunDB := bun.NewDB(db, pgdialect.New()) diff --git a/pkg/topic/topic.go b/pkg/topic/topic.go index 0bc16df0..f0192bbf 100644 --- a/pkg/topic/topic.go +++ b/pkg/topic/topic.go @@ -1,6 +1,9 @@ package topic -import "strings" +import ( + "fmt" + "strings" +) var topicCategoryByPrefix = map[string]string{ "test": "test", @@ -35,3 +38,11 @@ func Category(contentTopic string) string { } return "invalid" } + +func BuildGroupTopic(groupId string) string { + return fmt.Sprintf("/xmtp/3/g-%s/proto", groupId) +} + +func BuildWelcomeTopic(installationId []byte) string { + return fmt.Sprintf("/xmtp/3/w-%x/proto", installationId) +} From a9fae2f5fcd900582066f7dab93fa223dcb0f114 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Sat, 28 Oct 2023 16:55:26 -0700 Subject: [PATCH 03/20] Fix migrations --- pkg/mlsstore/store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/mlsstore/store.go b/pkg/mlsstore/store.go index df2f392a..41e74b41 100644 --- a/pkg/mlsstore/store.go +++ b/pkg/mlsstore/store.go @@ -11,7 +11,7 @@ import ( "github.com/uptrace/bun" "github.com/uptrace/bun/migrate" - "github.com/xmtp/xmtp-node-go/pkg/migrations/messages" + mlsMigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" "go.uber.org/zap" ) @@ -196,7 +196,7 @@ func extractIds(keyPackages []*KeyPackage) []string { } func (s *Store) migrate(ctx context.Context) error { - migrator := migrate.NewMigrator(s.db, messages.Migrations) + migrator := migrate.NewMigrator(s.db, mlsMigrations.Migrations) err := migrator.Init(ctx) if err != nil { return err From 79d1e5595c8a6b748d8567566d4f09a9bbd7d4d1 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Mon, 1 Jan 2024 16:42:43 -0800 Subject: [PATCH 04/20] refactor: walletaddress->accountaddress (#325) Settling on consistent terminology as discussed --- go.mod | 2 +- pkg/api/message/v3/service.go | 16 +++++++-------- pkg/api/message/v3/service_test.go | 32 +++++++++++++++--------------- pkg/mlsvalidate/service.go | 4 ++-- pkg/mlsvalidate/service_test.go | 4 ++-- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index e40e63bf..a19af8f3 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.32.1-0.20231026053711-5efc208e3135 + github.com/xmtp/proto/v3 v3.36.1-0.20231219054634-2ff03b7d5090 github.com/yoheimuta/protolint v0.39.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 diff --git a/pkg/api/message/v3/service.go b/pkg/api/message/v3/service.go index e3d4140d..3c1a6154 100644 --- a/pkg/api/message/v3/service.go +++ b/pkg/api/message/v3/service.go @@ -54,10 +54,10 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterI } installationId := results[0].InstallationId - walletAddress := results[0].WalletAddress + accountAddress := results[0].AccountAddress credentialIdentity := results[0].CredentialIdentity - if err = s.mlsStore.CreateInstallation(ctx, installationId, walletAddress, req.LastResortKeyPackage.KeyPackageTlsSerialized, credentialIdentity); err != nil { + if err = s.mlsStore.CreateInstallation(ctx, installationId, accountAddress, req.LastResortKeyPackage.KeyPackageTlsSerialized, credentialIdentity); err != nil { return nil, err } @@ -203,15 +203,15 @@ func (s *Service) GetIdentityUpdates(ctx context.Context, req *proto.GetIdentity return nil, err } - walletAddresses := req.WalletAddresses - updates, err := s.mlsStore.GetIdentityUpdates(ctx, req.WalletAddresses, int64(req.StartTimeNs)) + accountAddresses := req.AccountAddresses + updates, err := s.mlsStore.GetIdentityUpdates(ctx, req.AccountAddresses, int64(req.StartTimeNs)) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get identity updates: %s", err) } - resUpdates := make([]*proto.GetIdentityUpdatesResponse_WalletUpdates, len(walletAddresses)) - for i, walletAddress := range walletAddresses { - walletUpdates := updates[walletAddress] + resUpdates := make([]*proto.GetIdentityUpdatesResponse_WalletUpdates, len(accountAddresses)) + for i, accountAddress := range accountAddresses { + walletUpdates := updates[accountAddress] resUpdates[i] = &proto.GetIdentityUpdatesResponse_WalletUpdates{ Updates: []*proto.GetIdentityUpdatesResponse_Update{}, @@ -289,7 +289,7 @@ func validateUploadKeyPackagesRequest(req *proto.UploadKeyPackagesRequest) error } func validateGetIdentityUpdatesRequest(req *proto.GetIdentityUpdatesRequest) error { - if req == nil || len(req.WalletAddresses) == 0 { + if req == nil || len(req.AccountAddresses) == 0 { return status.Errorf(codes.InvalidArgument, "no wallet addresses to get updates for") } return nil diff --git a/pkg/api/message/v3/service_test.go b/pkg/api/message/v3/service_test.go index a2d61679..ec068399 100644 --- a/pkg/api/message/v3/service_test.go +++ b/pkg/api/message/v3/service_test.go @@ -43,11 +43,11 @@ func newMockedValidationService() *mockedMLSValidationService { return new(mockedMLSValidationService) } -func (m *mockedMLSValidationService) mockValidateKeyPackages(installationId []byte, walletAddress string) *mock.Call { +func (m *mockedMLSValidationService) mockValidateKeyPackages(installationId []byte, accountAddress string) *mock.Call { return m.On("ValidateKeyPackages", mock.Anything, mock.Anything).Return([]mlsvalidate.IdentityValidationResult{ { InstallationId: installationId, - WalletAddress: walletAddress, + AccountAddress: accountAddress, CredentialIdentity: []byte("test"), }, }, nil) @@ -97,9 +97,9 @@ func TestRegisterInstallation(t *testing.T) { defer cleanup() installationId := test.RandomBytes(32) - walletAddress := test.RandomString(32) + accountAddress := test.RandomString(32) - mlsValidationService.mockValidateKeyPackages(installationId, walletAddress) + mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ LastResortKeyPackage: &proto.KeyPackageUpload{ @@ -115,7 +115,7 @@ func TestRegisterInstallation(t *testing.T) { require.NoError(t, err) require.Len(t, installations, 1) - require.Equal(t, walletAddress, installations[0].WalletAddress) + require.Equal(t, accountAddress, installations[0].WalletAddress) } func TestRegisterInstallationError(t *testing.T) { @@ -140,9 +140,9 @@ func TestUploadKeyPackages(t *testing.T) { defer cleanup() installationId := test.RandomBytes(32) - walletAddress := test.RandomString(32) + accountAddress := test.RandomString(32) - mlsValidationService.mockValidateKeyPackages(installationId, walletAddress) + mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ LastResortKeyPackage: &proto.KeyPackageUpload{ @@ -172,9 +172,9 @@ func TestConsumeKeyPackages(t *testing.T) { defer cleanup() installationId1 := test.RandomBytes(32) - walletAddress1 := test.RandomString(32) + accountAddress1 := test.RandomString(32) - mockCall := mlsValidationService.mockValidateKeyPackages(installationId1, walletAddress1) + mockCall := mlsValidationService.mockValidateKeyPackages(installationId1, accountAddress1) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ LastResortKeyPackage: &proto.KeyPackageUpload{ @@ -186,10 +186,10 @@ func TestConsumeKeyPackages(t *testing.T) { // Add a second key package installationId2 := test.RandomBytes(32) - walletAddress2 := test.RandomString(32) + accountAddress2 := test.RandomString(32) // Unset the original mock so we can set a new one mockCall.Unset() - mlsValidationService.mockValidateKeyPackages(installationId2, walletAddress2) + mlsValidationService.mockValidateKeyPackages(installationId2, accountAddress2) res, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ LastResortKeyPackage: &proto.KeyPackageUpload{ @@ -268,9 +268,9 @@ func TestGetIdentityUpdates(t *testing.T) { defer cleanup() installationId := test.RandomBytes(32) - walletAddress := test.RandomString(32) + accountAddress := test.RandomString(32) - mockCall := mlsValidationService.mockValidateKeyPackages(installationId, walletAddress) + mockCall := mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) _, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ LastResortKeyPackage: &proto.KeyPackageUpload{ @@ -280,7 +280,7 @@ func TestGetIdentityUpdates(t *testing.T) { require.NoError(t, err) identityUpdates, err := svc.GetIdentityUpdates(ctx, &proto.GetIdentityUpdatesRequest{ - WalletAddresses: []string{walletAddress}, + AccountAddresses: []string{accountAddress}, }) require.NoError(t, err) require.NotNil(t, identityUpdates) @@ -295,7 +295,7 @@ func TestGetIdentityUpdates(t *testing.T) { } mockCall.Unset() - mlsValidationService.mockValidateKeyPackages(test.RandomBytes(32), walletAddress) + mlsValidationService.mockValidateKeyPackages(test.RandomBytes(32), accountAddress) _, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ LastResortKeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), @@ -304,7 +304,7 @@ func TestGetIdentityUpdates(t *testing.T) { require.NoError(t, err) identityUpdates, err = svc.GetIdentityUpdates(ctx, &proto.GetIdentityUpdatesRequest{ - WalletAddresses: []string{walletAddress}, + AccountAddresses: []string{accountAddress}, }) require.NoError(t, err) require.Len(t, identityUpdates.Updates, 1) diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go index 686e533e..bdf0679b 100644 --- a/pkg/mlsvalidate/service.go +++ b/pkg/mlsvalidate/service.go @@ -10,7 +10,7 @@ import ( ) type IdentityValidationResult struct { - WalletAddress string + AccountAddress string InstallationId []byte CredentialIdentity []byte } @@ -55,7 +55,7 @@ func (s *MLSValidationServiceImpl) ValidateKeyPackages(ctx context.Context, keyP return nil, fmt.Errorf("validation failed with error %s", response.ErrorMessage) } out[i] = IdentityValidationResult{ - WalletAddress: response.WalletAddress, + AccountAddress: response.AccountAddress, InstallationId: response.InstallationId, CredentialIdentity: response.CredentialIdentityBytes, } diff --git a/pkg/mlsvalidate/service_test.go b/pkg/mlsvalidate/service_test.go index 9613eb98..33b5cb95 100644 --- a/pkg/mlsvalidate/service_test.go +++ b/pkg/mlsvalidate/service_test.go @@ -42,7 +42,7 @@ func TestValidateKeyPackages(t *testing.T) { firstResponse := svc.ValidateKeyPackagesResponse_ValidationResponse{ IsOk: true, - WalletAddress: "0x123", + AccountAddress: "0x123", InstallationId: []byte("123"), CredentialIdentityBytes: []byte("456"), ErrorMessage: "", @@ -55,7 +55,7 @@ func TestValidateKeyPackages(t *testing.T) { res, err := service.ValidateKeyPackages(ctx, nil) assert.NoError(t, err) assert.Equal(t, 1, len(res)) - assert.Equal(t, "0x123", res[0].WalletAddress) + assert.Equal(t, "0x123", res[0].AccountAddress) assert.Equal(t, []byte("123"), res[0].InstallationId) assert.Equal(t, []byte("456"), res[0].CredentialIdentity) } From 08533116ea816f31b3ad4ad2a0f4cb7b5c302977 Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Mon, 8 Jan 2024 16:19:17 -0500 Subject: [PATCH 05/20] go mod tidy --- go.sum | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/go.sum b/go.sum index 71df1b4f..f71cdb51 100644 --- a/go.sum +++ b/go.sum @@ -94,7 +94,6 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -299,7 +298,6 @@ github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= @@ -635,19 +633,16 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= @@ -810,7 +805,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -842,7 +836,6 @@ github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/n github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= @@ -974,7 +967,6 @@ github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1 github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= @@ -1154,8 +1146,8 @@ github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 h1:wzUffJGCTBGXIDyNU+1UBu1fn2Nzo+OQzM1pLrheh58= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3/go.mod h1:bJREWk+NDnZYjgLQdAi8SUWuq/5pkMme4GqiffEhUF4= -github.com/xmtp/proto/v3 v3.30.0 h1:x6LGCWpO2HTQNhUiTXfE0l+u2HSL3Z35p41xhgy6hlw= -github.com/xmtp/proto/v3 v3.30.0/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= +github.com/xmtp/proto/v3 v3.36.1-0.20231219054634-2ff03b7d5090 h1:+0KTgQiUfu5UxgLjP18VL4BtG6hJMJYL0n1mVXtf3Ss= +github.com/xmtp/proto/v3 v3.36.1-0.20231219054634-2ff03b7d5090/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yoheimuta/go-protoparser/v4 v4.6.0 h1:uvz1e9/5Ihsm4Ku8AJeDImTpirKmIxubZdSn0QJNdnw= github.com/yoheimuta/go-protoparser/v4 v4.6.0/go.mod h1:AHNNnSWnb0UoL4QgHPiOAg2BniQceFscPI5X/BZNHl8= From 02109364318435ebcb8d7e91414a9c4af81bcb23 Mon Sep 17 00:00:00 2001 From: Brendan McMillion Date: Tue, 9 Jan 2024 11:23:42 -0800 Subject: [PATCH 06/20] Assume KeyPackages are always last resort. (#329) * Assume KeyPackages are always last resort. * Missing KeyPackages don't cause entire request to fail. * Update go.mod * UpdateKeyPackage returns an error if installation is unknown. --- go.mod | 2 +- go.sum | 4 +- pkg/api/message/v3/service.go | 54 ++++---- pkg/api/message/v3/service_test.go | 44 +++--- pkg/authn/authn.pb.go | 6 +- .../mls/20231023050806_init-schema.down.sql | 3 - .../mls/20231023050806_init-schema.up.sql | 29 +--- pkg/mlsstore/models.go | 14 +- pkg/mlsstore/store.go | 131 ++++++------------ pkg/mlsstore/store_test.go | 111 +++------------ pkg/mlsvalidate/service.go | 2 + 11 files changed, 124 insertions(+), 276 deletions(-) diff --git a/go.mod b/go.mod index a19af8f3..e8439dcf 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.36.1-0.20231219054634-2ff03b7d5090 + github.com/xmtp/proto/v3 v3.36.1 github.com/yoheimuta/protolint v0.39.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 diff --git a/go.sum b/go.sum index f71cdb51..4000f59d 100644 --- a/go.sum +++ b/go.sum @@ -1146,8 +1146,8 @@ github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 h1:wzUffJGCTBGXIDyNU+1UBu1fn2Nzo+OQzM1pLrheh58= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3/go.mod h1:bJREWk+NDnZYjgLQdAi8SUWuq/5pkMme4GqiffEhUF4= -github.com/xmtp/proto/v3 v3.36.1-0.20231219054634-2ff03b7d5090 h1:+0KTgQiUfu5UxgLjP18VL4BtG6hJMJYL0n1mVXtf3Ss= -github.com/xmtp/proto/v3 v3.36.1-0.20231219054634-2ff03b7d5090/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= +github.com/xmtp/proto/v3 v3.36.1 h1:eBUsWlA/jbfhxfbDtbAofBpi8Q+TIXPMz84e64o1XTE= +github.com/xmtp/proto/v3 v3.36.1/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yoheimuta/go-protoparser/v4 v4.6.0 h1:uvz1e9/5Ihsm4Ku8AJeDImTpirKmIxubZdSn0QJNdnw= github.com/yoheimuta/go-protoparser/v4 v4.6.0/go.mod h1:AHNNnSWnb0UoL4QgHPiOAg2BniQceFscPI5X/BZNHl8= diff --git a/pkg/api/message/v3/service.go b/pkg/api/message/v3/service.go index 3c1a6154..dbdb33c7 100644 --- a/pkg/api/message/v3/service.go +++ b/pkg/api/message/v3/service.go @@ -45,7 +45,7 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterI return nil, err } - results, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{req.LastResortKeyPackage.KeyPackageTlsSerialized}) + results, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{req.KeyPackage.KeyPackageTlsSerialized}) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) } @@ -57,7 +57,7 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterI accountAddress := results[0].AccountAddress credentialIdentity := results[0].CredentialIdentity - if err = s.mlsStore.CreateInstallation(ctx, installationId, accountAddress, req.LastResortKeyPackage.KeyPackageTlsSerialized, credentialIdentity); err != nil { + if err = s.mlsStore.CreateInstallation(ctx, installationId, accountAddress, credentialIdentity, req.KeyPackage.KeyPackageTlsSerialized, results[0].Expiration); err != nil { return nil, err } @@ -66,31 +66,31 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterI }, nil } -func (s *Service) ConsumeKeyPackages(ctx context.Context, req *proto.ConsumeKeyPackagesRequest) (*proto.ConsumeKeyPackagesResponse, error) { +func (s *Service) FetchKeyPackages(ctx context.Context, req *proto.FetchKeyPackagesRequest) (*proto.FetchKeyPackagesResponse, error) { ids := req.InstallationIds - keyPackages, err := s.mlsStore.ConsumeKeyPackages(ctx, ids) + installations, err := s.mlsStore.FetchKeyPackages(ctx, ids) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to consume key packages: %s", err) + return nil, status.Errorf(codes.Internal, "failed to fetch key packages: %s", err) } keyPackageMap := make(map[string]int) for idx, id := range ids { keyPackageMap[string(id)] = idx } - resPackages := make([]*proto.ConsumeKeyPackagesResponse_KeyPackage, len(keyPackages)) - for _, keyPackage := range keyPackages { + resPackages := make([]*proto.FetchKeyPackagesResponse_KeyPackage, len(ids)) + for _, installation := range installations { - idx, ok := keyPackageMap[string(keyPackage.InstallationId)] + idx, ok := keyPackageMap[string(installation.ID)] if !ok { return nil, status.Errorf(codes.Internal, "could not find key package for installation") } - resPackages[idx] = &proto.ConsumeKeyPackagesResponse_KeyPackage{ - KeyPackageTlsSerialized: keyPackage.Data, + resPackages[idx] = &proto.FetchKeyPackagesResponse_KeyPackage{ + KeyPackageTlsSerialized: installation.KeyPackage, } } - return &proto.ConsumeKeyPackagesResponse{ + return &proto.FetchKeyPackagesResponse{ KeyPackages: resPackages, }, nil } @@ -166,28 +166,22 @@ func (s *Service) PublishWelcomes(ctx context.Context, req *proto.PublishWelcome return &emptypb.Empty{}, nil } -func (s *Service) UploadKeyPackages(ctx context.Context, req *proto.UploadKeyPackagesRequest) (res *emptypb.Empty, err error) { - if err = validateUploadKeyPackagesRequest(req); err != nil { +func (s *Service) UploadKeyPackage(ctx context.Context, req *proto.UploadKeyPackageRequest) (res *emptypb.Empty, err error) { + if err = validateUploadKeyPackageRequest(req); err != nil { return nil, err } // Extract the key packages from the request - keyPackageBytes := make([][]byte, len(req.KeyPackages)) - for i, keyPackage := range req.KeyPackages { - keyPackageBytes[i] = keyPackage.KeyPackageTlsSerialized - } - validationResults, err := s.validationService.ValidateKeyPackages(ctx, keyPackageBytes) + keyPackageBytes := req.KeyPackage.KeyPackageTlsSerialized + + validationResults, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{keyPackageBytes}) if err != nil { // TODO: Differentiate between validation errors and internal errors return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) } + installationId := validationResults[0].InstallationId + expiration := validationResults[0].Expiration - keyPackageModels := make([]*mlsstore.KeyPackage, len(validationResults)) - for i, validationResult := range validationResults { - kp := mlsstore.NewKeyPackage(validationResult.InstallationId, keyPackageBytes[i], false) - keyPackageModels[i] = kp - } - - if err = s.mlsStore.InsertKeyPackages(ctx, keyPackageModels); err != nil { + if err = s.mlsStore.UpdateKeyPackage(ctx, installationId, keyPackageBytes, expiration); err != nil { return nil, status.Errorf(codes.Internal, "failed to insert key packages: %s", err) } @@ -275,15 +269,15 @@ func validatePublishWelcomesRequest(req *proto.PublishWelcomesRequest) error { } func validateRegisterInstallationRequest(req *proto.RegisterInstallationRequest) error { - if req == nil || req.LastResortKeyPackage == nil { - return status.Errorf(codes.InvalidArgument, "no last resort key package") + if req == nil || req.KeyPackage == nil { + return status.Errorf(codes.InvalidArgument, "no key package") } return nil } -func validateUploadKeyPackagesRequest(req *proto.UploadKeyPackagesRequest) error { - if req == nil || len(req.KeyPackages) == 0 { - return status.Errorf(codes.InvalidArgument, "no key packages to upload") +func validateUploadKeyPackageRequest(req *proto.UploadKeyPackageRequest) error { + if req == nil || req.KeyPackage == nil { + return status.Errorf(codes.InvalidArgument, "no key package") } return nil } diff --git a/pkg/api/message/v3/service_test.go b/pkg/api/message/v3/service_test.go index ec068399..1134af5d 100644 --- a/pkg/api/message/v3/service_test.go +++ b/pkg/api/message/v3/service_test.go @@ -49,6 +49,7 @@ func (m *mockedMLSValidationService) mockValidateKeyPackages(installationId []by InstallationId: installationId, AccountAddress: accountAddress, CredentialIdentity: []byte("test"), + Expiration: 0, }, }, nil) } @@ -102,7 +103,7 @@ func TestRegisterInstallation(t *testing.T) { mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) @@ -126,7 +127,7 @@ func TestRegisterInstallationError(t *testing.T) { mlsValidationService.On("ValidateKeyPackages", ctx, mock.Anything).Return(nil, errors.New("error validating")) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) @@ -134,7 +135,7 @@ func TestRegisterInstallationError(t *testing.T) { require.Nil(t, res) } -func TestUploadKeyPackages(t *testing.T) { +func TestUploadKeyPackage(t *testing.T) { ctx := context.Background() svc, mlsDb, mlsValidationService, cleanup := newTestService(t, ctx) defer cleanup() @@ -145,28 +146,27 @@ func TestUploadKeyPackages(t *testing.T) { mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) require.NoError(t, err) require.NotNil(t, res) - uploadRes, err := svc.UploadKeyPackages(ctx, &proto.UploadKeyPackagesRequest{ - KeyPackages: []*proto.KeyPackageUpload{ - {KeyPackageTlsSerialized: []byte("test2")}, + uploadRes, err := svc.UploadKeyPackage(ctx, &proto.UploadKeyPackageRequest{ + KeyPackage: &proto.KeyPackageUpload{ + KeyPackageTlsSerialized: []byte("test2"), }, }) require.NoError(t, err) require.NotNil(t, uploadRes) - keyPackages := []mlsstore.KeyPackage{} - err = mlsDb.NewSelect().Model(&keyPackages).Where("installation_id = ?", installationId).Scan(ctx) + installation := &mlsstore.Installation{} + err = mlsDb.NewSelect().Model(installation).Where("id = ?", installationId).Scan(ctx) require.NoError(t, err) - require.Len(t, keyPackages, 2) } -func TestConsumeKeyPackages(t *testing.T) { +func TestFetchKeyPackages(t *testing.T) { ctx := context.Background() svc, _, mlsValidationService, cleanup := newTestService(t, ctx) defer cleanup() @@ -177,7 +177,7 @@ func TestConsumeKeyPackages(t *testing.T) { mockCall := mlsValidationService.mockValidateKeyPackages(installationId1, accountAddress1) res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) @@ -192,14 +192,14 @@ func TestConsumeKeyPackages(t *testing.T) { mlsValidationService.mockValidateKeyPackages(installationId2, accountAddress2) res, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test2"), }, }) require.NoError(t, err) require.NotNil(t, res) - consumeRes, err := svc.ConsumeKeyPackages(ctx, &proto.ConsumeKeyPackagesRequest{ + consumeRes, err := svc.FetchKeyPackages(ctx, &proto.FetchKeyPackagesRequest{ InstallationIds: [][]byte{installationId1, installationId2}, }) require.NoError(t, err) @@ -209,7 +209,7 @@ func TestConsumeKeyPackages(t *testing.T) { require.Equal(t, []byte("test2"), consumeRes.KeyPackages[1].KeyPackageTlsSerialized) // Now do it with the installationIds reversed - consumeRes, err = svc.ConsumeKeyPackages(ctx, &proto.ConsumeKeyPackagesRequest{ + consumeRes, err = svc.FetchKeyPackages(ctx, &proto.FetchKeyPackagesRequest{ InstallationIds: [][]byte{installationId2, installationId1}, }) @@ -220,17 +220,17 @@ func TestConsumeKeyPackages(t *testing.T) { require.Equal(t, []byte("test"), consumeRes.KeyPackages[1].KeyPackageTlsSerialized) } -// Trying to consume key packages that don't exist should fail -func TestConsumeKeyPackagesFail(t *testing.T) { +// Trying to fetch key packages that don't exist should return nil +func TestFetchKeyPackagesFail(t *testing.T) { ctx := context.Background() svc, _, _, cleanup := newTestService(t, ctx) defer cleanup() - consumeRes, err := svc.ConsumeKeyPackages(ctx, &proto.ConsumeKeyPackagesRequest{ + consumeRes, err := svc.FetchKeyPackages(ctx, &proto.FetchKeyPackagesRequest{ InstallationIds: [][]byte{test.RandomBytes(32)}, }) - require.Error(t, err) - require.Nil(t, consumeRes) + require.Nil(t, err) + require.Equal(t, []*proto.FetchKeyPackagesResponse_KeyPackage{nil}, consumeRes.KeyPackages) } func TestPublishToGroup(t *testing.T) { @@ -273,7 +273,7 @@ func TestGetIdentityUpdates(t *testing.T) { mockCall := mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) _, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) @@ -297,7 +297,7 @@ func TestGetIdentityUpdates(t *testing.T) { mockCall.Unset() mlsValidationService.mockValidateKeyPackages(test.RandomBytes(32), accountAddress) _, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - LastResortKeyPackage: &proto.KeyPackageUpload{ + KeyPackage: &proto.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) diff --git a/pkg/authn/authn.pb.go b/pkg/authn/authn.pb.go index 5a3d5733..e7e88e3f 100644 --- a/pkg/authn/authn.pb.go +++ b/pkg/authn/authn.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v4.24.3 +// protoc v3.21.8 // source: authn.proto package authn @@ -28,6 +28,7 @@ type Signature struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Union: + // // *Signature_EcdsaCompact Union isSignature_Union `protobuf_oneof:"union"` } @@ -146,6 +147,7 @@ type PublicKey struct { Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3,oneof" json:"signature,omitempty"` // Types that are assignable to Union: + // // *PublicKey_Secp256K1Uncompressed Union isPublicKey_Union `protobuf_oneof:"union"` } @@ -297,6 +299,7 @@ type ClientAuthRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Version: + // // *ClientAuthRequest_V1 Version isClientAuthRequest_Version `protobuf_oneof:"version"` } @@ -418,6 +421,7 @@ type ClientAuthResponse struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Version: + // // *ClientAuthResponse_V1 Version isClientAuthResponse_Version `protobuf_oneof:"version"` } diff --git a/pkg/migrations/mls/20231023050806_init-schema.down.sql b/pkg/migrations/mls/20231023050806_init-schema.down.sql index b1077270..bcbc86f0 100644 --- a/pkg/migrations/mls/20231023050806_init-schema.down.sql +++ b/pkg/migrations/mls/20231023050806_init-schema.down.sql @@ -3,6 +3,3 @@ SET --bun:split DROP TABLE IF EXISTS installations; - ---bun:split -DROP TABLE IF EXISTS key_packages; \ No newline at end of file diff --git a/pkg/migrations/mls/20231023050806_init-schema.up.sql b/pkg/migrations/mls/20231023050806_init-schema.up.sql index e77152e9..a0ebe97c 100644 --- a/pkg/migrations/mls/20231023050806_init-schema.up.sql +++ b/pkg/migrations/mls/20231023050806_init-schema.up.sql @@ -6,21 +6,12 @@ CREATE TABLE installations ( id BYTEA PRIMARY KEY, wallet_address TEXT NOT NULL, created_at BIGINT NOT NULL, + updated_at BIGINT NOT NULL, credential_identity BYTEA NOT NULL, - revoked_at BIGINT -); + revoked_at BIGINT, ---bun:split -CREATE TABLE key_packages ( - id TEXT PRIMARY KEY, - installation_id BYTEA NOT NULL, - created_at BIGINT NOT NULL, - consumed_at BIGINT, - not_consumed BOOLEAN DEFAULT TRUE NOT NULL, - is_last_resort BOOLEAN NOT NULL, - data BYTEA NOT NULL, - -- Add a foreign key constraint to ensure key packages cannot be added for unregistered installations - CONSTRAINT fk_installation_id FOREIGN KEY (installation_id) REFERENCES installations (id) + key_package BYTEA NOT NULL, + expiration BIGINT NOT NULL ); --bun:split @@ -31,15 +22,3 @@ CREATE INDEX idx_installations_created_at ON installations(created_at); --bun:split CREATE INDEX idx_installations_revoked_at ON installations(revoked_at); - ---bun:split --- Adding indexes for the key_packages table -CREATE INDEX idx_key_packages_installation_id_not_consumed_is_last_resort_created_at ON key_packages( - installation_id, - not_consumed, - is_last_resort, - created_at -); - ---bun:split -CREATE INDEX idx_key_packages_is_last_resort_id ON key_packages(is_last_resort, id); \ No newline at end of file diff --git a/pkg/mlsstore/models.go b/pkg/mlsstore/models.go index 226db843..cdfd0da0 100644 --- a/pkg/mlsstore/models.go +++ b/pkg/mlsstore/models.go @@ -8,18 +8,10 @@ type Installation struct { ID []byte `bun:",pk,type:bytea"` WalletAddress string `bun:"wallet_address,notnull"` CreatedAt int64 `bun:"created_at,notnull"` + UpdatedAt int64 `bun:"updated_at,notnull"` RevokedAt *int64 `bun:"revoked_at"` CredentialIdentity []byte `bun:"credential_identity,notnull,type:bytea"` -} - -type KeyPackage struct { - bun.BaseModel `bun:"table:key_packages"` - ID string `bun:",pk"` // ID is the hash of the data field - InstallationId []byte `bun:"installation_id,notnull,type:bytea"` - CreatedAt int64 `bun:"created_at,notnull"` - ConsumedAt *int64 `bun:"consumed_at"` - NotConsumed bool `bun:"not_consumed,default:true"` - IsLastResort bool `bun:"is_last_resort,notnull"` - Data []byte `bun:"data,notnull,type:bytea"` + KeyPackage []byte `bun:"key_package,notnull,type:bytea"` + Expiration uint64 `bun:"expiration,notnull"` } diff --git a/pkg/mlsstore/store.go b/pkg/mlsstore/store.go index 41e74b41..17f17bf2 100644 --- a/pkg/mlsstore/store.go +++ b/pkg/mlsstore/store.go @@ -2,9 +2,6 @@ package mlsstore import ( "context" - "crypto/sha256" - "database/sql" - "encoding/hex" "errors" "sort" "time" @@ -22,9 +19,9 @@ type Store struct { } type MlsStore interface { - CreateInstallation(ctx context.Context, installationId []byte, walletAddress string, lastResortKeyPackage []byte, credentialIdentity []byte) error - InsertKeyPackages(ctx context.Context, keyPackages []*KeyPackage) error - ConsumeKeyPackages(ctx context.Context, installationIds [][]byte) ([]*KeyPackage, error) + CreateInstallation(ctx context.Context, installationId []byte, walletAddress string, credentialIdentity, keyPackage []byte, expiration uint64) error + UpdateKeyPackage(ctx context.Context, installationId, keyPackage []byte, expiration uint64) error + FetchKeyPackages(ctx context.Context, installationIds [][]byte) ([]*Installation, error) GetIdentityUpdates(ctx context.Context, walletAddresses []string, startTimeNs int64) (map[string]IdentityUpdateList, error) } @@ -43,83 +40,67 @@ func New(ctx context.Context, config Config) (*Store, error) { } // Creates the installation and last resort key package -func (s *Store) CreateInstallation(ctx context.Context, installationId []byte, walletAddress string, lastResortKeyPackage []byte, credentialIdentity []byte) error { +func (s *Store) CreateInstallation(ctx context.Context, installationId []byte, walletAddress string, credentialIdentity, keyPackage []byte, expiration uint64) error { createdAt := nowNs() installation := Installation{ ID: installationId, WalletAddress: walletAddress, CreatedAt: createdAt, + UpdatedAt: createdAt, CredentialIdentity: credentialIdentity, - } - - keyPackage := NewKeyPackage(installationId, lastResortKeyPackage, true) - - return s.db.RunInTx(ctx, &sql.TxOptions{}, func(ctx context.Context, tx bun.Tx) error { - _, err := tx.NewInsert(). - Model(&installation). - Ignore(). - Exec(ctx) - - if err != nil { - return err - } - _, err = tx.NewInsert(). - Model(keyPackage). - Ignore(). - Exec(ctx) - - if err != nil { - return err - } - - return nil - }) -} + KeyPackage: keyPackage, + Expiration: expiration, + } -// Insert a batch of key packages, ignoring any that may already exist -func (s *Store) InsertKeyPackages(ctx context.Context, keyPackages []*KeyPackage) error { - _, err := s.db.NewInsert().Model(&keyPackages).Ignore().Exec(ctx) + _, err := s.db.NewInsert(). + Model(&installation). + Ignore(). + Exec(ctx) return err } -func (s *Store) ConsumeKeyPackages(ctx context.Context, installationIds [][]byte) ([]*KeyPackage, error) { - keyPackages := make([]*KeyPackage, 0) - err := s.db.RunInTx(ctx, &sql.TxOptions{}, func(ctx context.Context, tx bun.Tx) error { - err := tx.NewRaw(` - SELECT DISTINCT ON(installation_id) * FROM key_packages - WHERE "installation_id" IN (?) - AND not_consumed = TRUE - ORDER BY installation_id ASC, is_last_resort ASC, created_at ASC - `, - bun.In(installationIds)). - Scan(ctx, &keyPackages) - - if err != nil { - return err - } - - if len(keyPackages) < len(installationIds) { - return errors.New("key packages not found") - } +// Insert a new key package, ignoring any that may already exist +func (s *Store) UpdateKeyPackage(ctx context.Context, installationId, keyPackage []byte, expiration uint64) error { + installation := Installation{ + ID: installationId, + UpdatedAt: nowNs(), - _, err = tx.NewUpdate(). - Table("key_packages"). - Set("consumed_at = ?", nowNs()). - Set("not_consumed = FALSE"). - Where("is_last_resort = FALSE"). - Where("id IN (?)", bun.In(extractIds(keyPackages))). - Exec(ctx) + KeyPackage: keyPackage, + Expiration: expiration, + } + res, err := s.db.NewUpdate(). + Model(&installation). + OmitZero(). + WherePK(). + Exec(ctx) + if err != nil { return err - }) + } + rows, err := res.RowsAffected() + if err != nil { + return err + } + if rows == 0 { + return errors.New("installation id unknown") + } + return nil +} +func (s *Store) FetchKeyPackages(ctx context.Context, installationIds [][]byte) ([]*Installation, error) { + installations := make([]*Installation, 0) + + err := s.db.NewSelect(). + Model(&installations). + Where("ID IN (?)", bun.In(installationIds)). + Scan(ctx, &installations) if err != nil { return nil, err } - return keyPackages, nil + return installations, nil } func (s *Store) GetIdentityUpdates(ctx context.Context, walletAddresses []string, startTimeNs int64) (map[string]IdentityUpdateList, error) { @@ -176,25 +157,6 @@ func (s *Store) RevokeInstallation(ctx context.Context, installationId []byte) e return err } -func NewKeyPackage(installationId []byte, data []byte, isLastResort bool) *KeyPackage { - return &KeyPackage{ - ID: buildKeyPackageId(data), - InstallationId: installationId, - CreatedAt: nowNs(), - IsLastResort: isLastResort, - NotConsumed: true, - Data: data, - } -} - -func extractIds(keyPackages []*KeyPackage) []string { - out := make([]string, len(keyPackages)) - for i, keyPackage := range keyPackages { - out[i] = keyPackage.ID - } - return out -} - func (s *Store) migrate(ctx context.Context) error { migrator := migrate.NewMigrator(s.db, mlsMigrations.Migrations) err := migrator.Init(ctx) @@ -218,11 +180,6 @@ func nowNs() int64 { return time.Now().UTC().UnixNano() } -func buildKeyPackageId(keyPackageData []byte) string { - digest := sha256.Sum256(keyPackageData) - return hex.EncodeToString(digest[:]) -} - type IdentityUpdateKind int const ( diff --git a/pkg/mlsstore/store_test.go b/pkg/mlsstore/store_test.go index 50673cec..95c21fb9 100644 --- a/pkg/mlsstore/store_test.go +++ b/pkg/mlsstore/store_test.go @@ -32,19 +32,15 @@ func TestCreateInstallation(t *testing.T) { installationId := test.RandomBytes(32) walletAddress := test.RandomString(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, test.RandomBytes(32), test.RandomBytes(32)) + err := store.CreateInstallation(ctx, installationId, walletAddress, test.RandomBytes(32), test.RandomBytes(32), 0) require.NoError(t, err) installationFromDb := &Installation{} require.NoError(t, store.db.NewSelect().Model(installationFromDb).Where("id = ?", installationId).Scan(ctx)) require.Equal(t, walletAddress, installationFromDb.WalletAddress) - - keyPackageFromDB := &KeyPackage{} - require.NoError(t, store.db.NewSelect().Model(keyPackageFromDB).Where("installation_id = ?", installationId).Scan(ctx)) - require.Equal(t, installationId, keyPackageFromDB.InstallationId) } -func TestCreateInstallationIdempotent(t *testing.T) { +func TestUpdateKeyPackage(t *testing.T) { store, cleanup := NewTestStore(t) defer cleanup() @@ -53,57 +49,18 @@ func TestCreateInstallationIdempotent(t *testing.T) { walletAddress := test.RandomString(32) keyPackage := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) - require.NoError(t, err) - err = store.CreateInstallation(ctx, installationId, walletAddress, test.RandomBytes(32), test.RandomBytes(32)) - require.NoError(t, err) - - keyPackageFromDb := &KeyPackage{} - require.NoError(t, store.db.NewSelect().Model(keyPackageFromDb).Where("installation_id = ?", installationId).Scan(ctx)) - require.Equal(t, keyPackage, keyPackageFromDb.Data) -} - -func TestInsertKeyPackages(t *testing.T) { - store, cleanup := NewTestStore(t) - defer cleanup() - - ctx := context.Background() - installationId := test.RandomBytes(32) - walletAddress := test.RandomString(32) - keyPackage := test.RandomBytes(32) - - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage, 0) require.NoError(t, err) keyPackage2 := test.RandomBytes(32) - err = store.InsertKeyPackages(ctx, []*KeyPackage{{ - ID: buildKeyPackageId(keyPackage2), - InstallationId: installationId, - CreatedAt: nowNs(), - IsLastResort: false, - Data: keyPackage2, - }}) + err = store.UpdateKeyPackage(ctx, installationId, keyPackage2, 1) require.NoError(t, err) - keyPackagesFromDb := []*KeyPackage{} - require.NoError(t, store.db.NewSelect().Model(&keyPackagesFromDb).Where("installation_id = ?", installationId).Scan(ctx)) - require.Len(t, keyPackagesFromDb, 2) - - hasLastResort := false - hasRegular := false - for _, keyPackageFromDb := range keyPackagesFromDb { - require.Equal(t, installationId, keyPackageFromDb.InstallationId) - if keyPackageFromDb.IsLastResort { - hasLastResort = true - } - if !keyPackageFromDb.IsLastResort { - hasRegular = true - require.Equal(t, keyPackage2, keyPackageFromDb.Data) - } - } + installationFromDb := &Installation{} + require.NoError(t, store.db.NewSelect().Model(installationFromDb).Where("id = ?", installationId).Scan(ctx)) - require.True(t, hasLastResort) - require.True(t, hasRegular) + require.Equal(t, keyPackage2, installationFromDb.KeyPackage) + require.Equal(t, uint64(1), installationFromDb.Expiration) } func TestConsumeLastResortKeyPackage(t *testing.T) { @@ -115,48 +72,14 @@ func TestConsumeLastResortKeyPackage(t *testing.T) { walletAddress := test.RandomString(32) keyPackage := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) - require.NoError(t, err) - - consumeResult, err := store.ConsumeKeyPackages(ctx, [][]byte{installationId}) - require.NoError(t, err) - require.Len(t, consumeResult, 1) - require.Equal(t, keyPackage, consumeResult[0].Data) - require.Equal(t, installationId, consumeResult[0].InstallationId) -} - -func TestConsumeMultipleKeyPackages(t *testing.T) { - store, cleanup := NewTestStore(t) - defer cleanup() - - ctx := context.Background() - installationId := test.RandomBytes(32) - walletAddress := test.RandomString(32) - keyPackage := test.RandomBytes(32) - - err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage) - require.NoError(t, err) - - keyPackage2 := test.RandomBytes(32) - require.NoError(t, store.InsertKeyPackages(ctx, []*KeyPackage{{ - ID: buildKeyPackageId(keyPackage2), - InstallationId: installationId, - CreatedAt: nowNs(), - IsLastResort: false, - Data: keyPackage2, - }})) - - consumeResult, err := store.ConsumeKeyPackages(ctx, [][]byte{installationId}) + err := store.CreateInstallation(ctx, installationId, walletAddress, keyPackage, keyPackage, 0) require.NoError(t, err) - require.Len(t, consumeResult, 1) - require.Equal(t, keyPackage2, consumeResult[0].Data) - require.Equal(t, installationId, consumeResult[0].InstallationId) - consumeResult, err = store.ConsumeKeyPackages(ctx, [][]byte{installationId}) + fetchResult, err := store.FetchKeyPackages(ctx, [][]byte{installationId}) require.NoError(t, err) - require.Len(t, consumeResult, 1) - // Now we are out of regular key packages. Expect to consume the last resort - require.Equal(t, keyPackage, consumeResult[0].Data) + require.Len(t, fetchResult, 1) + require.Equal(t, keyPackage, fetchResult[0].KeyPackage) + require.Equal(t, installationId, fetchResult[0].ID) } func TestGetIdentityUpdates(t *testing.T) { @@ -169,13 +92,13 @@ func TestGetIdentityUpdates(t *testing.T) { installationId1 := test.RandomBytes(32) keyPackage1 := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId1, walletAddress, keyPackage1, keyPackage1) + err := store.CreateInstallation(ctx, installationId1, walletAddress, keyPackage1, keyPackage1, 0) require.NoError(t, err) installationId2 := test.RandomBytes(32) keyPackage2 := test.RandomBytes(32) - err = store.CreateInstallation(ctx, installationId2, walletAddress, keyPackage2, keyPackage2) + err = store.CreateInstallation(ctx, installationId2, walletAddress, keyPackage2, keyPackage2, 0) require.NoError(t, err) identityUpdates, err := store.GetIdentityUpdates(ctx, []string{walletAddress}, 0) @@ -200,14 +123,14 @@ func TestGetIdentityUpdatesMultipleWallets(t *testing.T) { installationId1 := test.RandomBytes(32) keyPackage1 := test.RandomBytes(32) - err := store.CreateInstallation(ctx, installationId1, walletAddress1, keyPackage1, keyPackage1) + err := store.CreateInstallation(ctx, installationId1, walletAddress1, keyPackage1, keyPackage1, 0) require.NoError(t, err) walletAddress2 := test.RandomString(32) installationId2 := test.RandomBytes(32) keyPackage2 := test.RandomBytes(32) - err = store.CreateInstallation(ctx, installationId2, walletAddress2, keyPackage2, keyPackage2) + err = store.CreateInstallation(ctx, installationId2, walletAddress2, keyPackage2, keyPackage2, 0) require.NoError(t, err) identityUpdates, err := store.GetIdentityUpdates(ctx, []string{walletAddress1, walletAddress2}, 0) diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go index bdf0679b..0391abb1 100644 --- a/pkg/mlsvalidate/service.go +++ b/pkg/mlsvalidate/service.go @@ -13,6 +13,7 @@ type IdentityValidationResult struct { AccountAddress string InstallationId []byte CredentialIdentity []byte + Expiration uint64 } type GroupMessageValidationResult struct { @@ -58,6 +59,7 @@ func (s *MLSValidationServiceImpl) ValidateKeyPackages(ctx context.Context, keyP AccountAddress: response.AccountAddress, InstallationId: response.InstallationId, CredentialIdentity: response.CredentialIdentityBytes, + Expiration: response.Expiration, } } return out, nil From b4e6195e93ef06a5ae3684b5b3839048f389d3bb Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Thu, 11 Jan 2024 17:19:56 -0500 Subject: [PATCH 07/20] refactor: move api/message/v3 to mls/api/v1 (#332) * refactor: move message_api/v3 to mls/api/v1 * refactor: move pkg/mlsstore to pkg/mls/store * Rename mls build/push workflow --- .github/workflows/push-mls.yml | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/api/authentication_test.go | 10 +++++----- pkg/api/config.go | 6 +++--- pkg/api/interceptor.go | 6 +++--- pkg/api/server.go | 12 ++++++------ pkg/{api/message/v3 => mls/api/v1}/service.go | 6 +++--- pkg/{api/message/v3 => mls/api/v1}/service_test.go | 6 +++--- pkg/{mlsstore => mls/store}/config.go | 2 +- pkg/{mlsstore => mls/store}/models.go | 2 +- pkg/{mlsstore => mls/store}/store.go | 2 +- pkg/{mlsstore => mls/store}/store_test.go | 2 +- pkg/server/options.go | 2 +- pkg/server/server.go | 2 +- pkg/topic/topic.go | 4 ++-- 16 files changed, 35 insertions(+), 35 deletions(-) rename pkg/{api/message/v3 => mls/api/v1}/service.go (98%) rename pkg/{api/message/v3 => mls/api/v1}/service_test.go (98%) rename pkg/{mlsstore => mls/store}/config.go (97%) rename pkg/{mlsstore => mls/store}/models.go (96%) rename pkg/{mlsstore => mls/store}/store.go (99%) rename pkg/{mlsstore => mls/store}/store_test.go (99%) diff --git a/.github/workflows/push-mls.yml b/.github/workflows/push-mls.yml index 8ad7f1e5..d55e127c 100644 --- a/.github/workflows/push-mls.yml +++ b/.github/workflows/push-mls.yml @@ -1,4 +1,4 @@ -name: Deploy Nodes +name: Push MLS Container on: push: branches: diff --git a/go.mod b/go.mod index e8439dcf..ba8eb007 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.36.1 + github.com/xmtp/proto/v3 v3.36.3-0.20240111132545-4e1d2b1b2399 github.com/yoheimuta/protolint v0.39.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 diff --git a/go.sum b/go.sum index 4000f59d..b6aef526 100644 --- a/go.sum +++ b/go.sum @@ -1146,8 +1146,8 @@ github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 h1:wzUffJGCTBGXIDyNU+1UBu1fn2Nzo+OQzM1pLrheh58= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3/go.mod h1:bJREWk+NDnZYjgLQdAi8SUWuq/5pkMme4GqiffEhUF4= -github.com/xmtp/proto/v3 v3.36.1 h1:eBUsWlA/jbfhxfbDtbAofBpi8Q+TIXPMz84e64o1XTE= -github.com/xmtp/proto/v3 v3.36.1/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= +github.com/xmtp/proto/v3 v3.36.3-0.20240111132545-4e1d2b1b2399 h1:i5qynxHZRn7mIXQPt8M7c6ac0NBb+MEn2g2qKzvRTyM= +github.com/xmtp/proto/v3 v3.36.3-0.20240111132545-4e1d2b1b2399/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yoheimuta/go-protoparser/v4 v4.6.0 h1:uvz1e9/5Ihsm4Ku8AJeDImTpirKmIxubZdSn0QJNdnw= github.com/yoheimuta/go-protoparser/v4 v4.6.0/go.mod h1:AHNNnSWnb0UoL4QgHPiOAg2BniQceFscPI5X/BZNHl8= diff --git a/pkg/api/authentication_test.go b/pkg/api/authentication_test.go index 7e48af66..bd86e232 100644 --- a/pkg/api/authentication_test.go +++ b/pkg/api/authentication_test.go @@ -19,7 +19,7 @@ func Test_AuthnNoToken(t *testing.T) { }) } -func Test_AuthnNoTokenNonV3(t *testing.T) { +func Test_AuthnNoTokenNonMLS(t *testing.T) { ctx := context.Background() testGRPCAndHTTP(t, ctx, func(t *testing.T, client messageclient.Client, server *Server) { _, err := client.Publish(ctx, &messageV1.PublishRequest{ @@ -36,13 +36,13 @@ func Test_AuthnNoTokenNonV3(t *testing.T) { }) } -func Test_AuthnNoTokenV3(t *testing.T) { +func Test_AuthnNoTokenMLS(t *testing.T) { ctx := context.Background() testGRPCAndHTTP(t, ctx, func(t *testing.T, client messageclient.Client, server *Server) { _, err := client.Publish(ctx, &messageV1.PublishRequest{ Envelopes: []*messageV1.Envelope{ { - ContentTopic: "/xmtp/3/m-0x1234/proto", + ContentTopic: "/xmtp/mls/1/m-0x1234/proto", TimestampNs: 0, Message: []byte{}, }, @@ -52,7 +52,7 @@ func Test_AuthnNoTokenV3(t *testing.T) { }) } -func Test_AuthnNoTokenMixedV0V3(t *testing.T) { +func Test_AuthnNoTokenMixedV0MLS(t *testing.T) { ctx := context.Background() testGRPCAndHTTP(t, ctx, func(t *testing.T, client messageclient.Client, server *Server) { _, err := client.Publish(ctx, &messageV1.PublishRequest{ @@ -63,7 +63,7 @@ func Test_AuthnNoTokenMixedV0V3(t *testing.T) { Message: []byte{}, }, { - ContentTopic: "/xmtp/3/m-0x1234/proto", + ContentTopic: "/xmtp/mls/1/m-0x1234/proto", TimestampNs: 0, Message: []byte{}, }, diff --git a/pkg/api/config.go b/pkg/api/config.go index 723679bf..daaaa5e2 100644 --- a/pkg/api/config.go +++ b/pkg/api/config.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" wakunode "github.com/waku-org/go-waku/waku/v2/node" "github.com/xmtp/xmtp-node-go/pkg/authz" - "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" "github.com/xmtp/xmtp-node-go/pkg/store" @@ -50,8 +50,8 @@ type AuthnOptions struct { Authenticated requests will be permitted according to the rules of the request type, (i.e. you can't publish into other wallets' contact and private topics). */ - Enable bool `long:"enable" description:"require client authentication via wallet tokens"` - EnableV3 bool `long:"enable-v3" description:"require client authentication for V3"` + Enable bool `long:"enable" description:"require client authentication via wallet tokens"` + EnableMLS bool `long:"enable-mls" description:"require client authentication for MLS"` /* Ratelimits enables request rate limiting. diff --git a/pkg/api/interceptor.go b/pkg/api/interceptor.go index 81d7c2d3..c4860b5b 100644 --- a/pkg/api/interceptor.go +++ b/pkg/api/interceptor.go @@ -87,14 +87,14 @@ func (wa *WalletAuthorizer) Stream() grpc.StreamServerInterceptor { } } -func (wa *WalletAuthorizer) isProtocolVersion3(request *messagev1.PublishRequest) bool { +func (wa *WalletAuthorizer) isProtocolMLS(request *messagev1.PublishRequest) bool { envelopes := request.Envelopes if len(envelopes) == 0 { return false } // If any of the envelopes are not for a v3 topic, then we treat the request as non-v3 for _, envelope := range envelopes { - if !strings.HasPrefix(envelope.ContentTopic, "/xmtp/3/") { + if !strings.HasPrefix(envelope.ContentTopic, "/xmtp/mls/") { return false } } @@ -103,7 +103,7 @@ func (wa *WalletAuthorizer) isProtocolVersion3(request *messagev1.PublishRequest func (wa *WalletAuthorizer) requiresAuthorization(req interface{}) bool { publishRequest, isPublish := req.(*messagev1.PublishRequest) - return isPublish && (!wa.isProtocolVersion3(publishRequest) || wa.AuthnConfig.EnableV3) + return isPublish && (!wa.isProtocolMLS(publishRequest) || wa.AuthnConfig.EnableMLS) } func (wa *WalletAuthorizer) getWallet(ctx context.Context) (types.WalletAddr, error) { diff --git a/pkg/api/server.go b/pkg/api/server.go index 9648c3a1..460a5e41 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -15,7 +15,7 @@ import ( "github.com/pkg/errors" swgui "github.com/swaggest/swgui/v3" proto "github.com/xmtp/proto/v3/go/message_api/v1" - v3Proto "github.com/xmtp/proto/v3/go/message_api/v3" + mlsv1pb "github.com/xmtp/proto/v3/go/mls/api/v1" messagev1openapi "github.com/xmtp/proto/v3/openapi/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" "github.com/xmtp/xmtp-node-go/pkg/tracing" @@ -28,7 +28,7 @@ import ( messagev1 "github.com/xmtp/xmtp-node-go/pkg/api/message/v1" apicontext "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/context" - messagev3 "github.com/xmtp/xmtp-node-go/pkg/api/message/v3" + mlsv1 "github.com/xmtp/xmtp-node-go/pkg/mls/api/v1" ) const ( @@ -45,7 +45,7 @@ type Server struct { grpcListener net.Listener httpListener net.Listener messagev1 *messagev1.Service - messagev3 *messagev3.Service + mlsv1 *mlsv1.Service wg sync.WaitGroup ctx context.Context @@ -131,11 +131,11 @@ func (s *Server) startGRPC() error { // Enable the MLS server if a store is provided if s.Config.MLSStore != nil && s.Config.MLSValidator != nil && s.Config.EnableMls { - s.messagev3, err = messagev3.NewService(s.Waku, s.Log, s.Store, s.Config.MLSStore, s.Config.MLSValidator) + s.mlsv1, err = mlsv1.NewService(s.Waku, s.Log, s.Store, s.Config.MLSStore, s.Config.MLSValidator) if err != nil { return errors.Wrap(err, "creating mls service") } - v3Proto.RegisterMlsApiServer(grpcServer, s.messagev3) + mlsv1pb.RegisterMlsApiServer(grpcServer, s.mlsv1) } prometheus.Register(grpcServer) @@ -184,7 +184,7 @@ func (s *Server) startHTTP() error { } if s.Config.MLSStore != nil && s.Config.EnableMls { - err = v3Proto.RegisterMlsApiHandler(s.ctx, gwmux, conn) + err = mlsv1pb.RegisterMlsApiHandler(s.ctx, gwmux, conn) if err != nil { return errors.Wrap(err, "registering mls handler") } diff --git a/pkg/api/message/v3/service.go b/pkg/mls/api/v1/service.go similarity index 98% rename from pkg/api/message/v3/service.go rename to pkg/mls/api/v1/service.go index dbdb33c7..97731ec9 100644 --- a/pkg/api/message/v3/service.go +++ b/pkg/mls/api/v1/service.go @@ -5,9 +5,9 @@ import ( wakunode "github.com/waku-org/go-waku/waku/v2/node" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" - proto "github.com/xmtp/proto/v3/go/message_api/v3" + proto "github.com/xmtp/proto/v3/go/mls/api/v1" "github.com/xmtp/xmtp-node-go/pkg/metrics" - "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/store" "github.com/xmtp/xmtp-node-go/pkg/topic" @@ -29,7 +29,7 @@ type Service struct { func NewService(node *wakunode.WakuNode, logger *zap.Logger, messageStore *store.Store, mlsStore mlsstore.MlsStore, validationService mlsvalidate.MLSValidationService) (s *Service, err error) { s = &Service{ - log: logger.Named("message/v3"), + log: logger.Named("mls/v1"), waku: node, messageStore: messageStore, mlsStore: mlsStore, diff --git a/pkg/api/message/v3/service_test.go b/pkg/mls/api/v1/service_test.go similarity index 98% rename from pkg/api/message/v3/service_test.go rename to pkg/mls/api/v1/service_test.go index 1134af5d..8ad15ba3 100644 --- a/pkg/api/message/v3/service_test.go +++ b/pkg/mls/api/v1/service_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/require" "github.com/uptrace/bun" v1 "github.com/xmtp/proto/v3/go/message_api/v1" - proto "github.com/xmtp/proto/v3/go/message_api/v3" + proto "github.com/xmtp/proto/v3/go/mls/api/v1" messageContents "github.com/xmtp/proto/v3/go/mls/message_contents" - "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/store" test "github.com/xmtp/xmtp-node-go/pkg/testing" @@ -254,7 +254,7 @@ func TestPublishToGroup(t *testing.T) { require.NoError(t, err) results, err := svc.messageStore.Query(&v1.QueryRequest{ - ContentTopics: []string{fmt.Sprintf("/xmtp/3/g-%s/proto", groupId)}, + ContentTopics: []string{fmt.Sprintf("/xmtp/mls/1/g-%s/proto", groupId)}, }) require.NoError(t, err) require.Len(t, results.Envelopes, 1) diff --git a/pkg/mlsstore/config.go b/pkg/mls/store/config.go similarity index 97% rename from pkg/mlsstore/config.go rename to pkg/mls/store/config.go index 521ec282..6da5323a 100644 --- a/pkg/mlsstore/config.go +++ b/pkg/mls/store/config.go @@ -1,4 +1,4 @@ -package mlsstore +package store import ( "time" diff --git a/pkg/mlsstore/models.go b/pkg/mls/store/models.go similarity index 96% rename from pkg/mlsstore/models.go rename to pkg/mls/store/models.go index cdfd0da0..02ec32cc 100644 --- a/pkg/mlsstore/models.go +++ b/pkg/mls/store/models.go @@ -1,4 +1,4 @@ -package mlsstore +package store import "github.com/uptrace/bun" diff --git a/pkg/mlsstore/store.go b/pkg/mls/store/store.go similarity index 99% rename from pkg/mlsstore/store.go rename to pkg/mls/store/store.go index 17f17bf2..c338fdf3 100644 --- a/pkg/mlsstore/store.go +++ b/pkg/mls/store/store.go @@ -1,4 +1,4 @@ -package mlsstore +package store import ( "context" diff --git a/pkg/mlsstore/store_test.go b/pkg/mls/store/store_test.go similarity index 99% rename from pkg/mlsstore/store_test.go rename to pkg/mls/store/store_test.go index 95c21fb9..703cf9e8 100644 --- a/pkg/mlsstore/store_test.go +++ b/pkg/mls/store/store_test.go @@ -1,4 +1,4 @@ -package mlsstore +package store import ( "context" diff --git a/pkg/server/options.go b/pkg/server/options.go index 477c99e9..73c05726 100644 --- a/pkg/server/options.go +++ b/pkg/server/options.go @@ -4,7 +4,7 @@ import ( "time" "github.com/xmtp/xmtp-node-go/pkg/api" - "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" "github.com/xmtp/xmtp-node-go/pkg/store" ) diff --git a/pkg/server/server.go b/pkg/server/server.go index 90f96e12..13d3e1b9 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -38,7 +38,7 @@ import ( authzmigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/authz" messagemigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/messages" mlsmigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" - "github.com/xmtp/xmtp-node-go/pkg/mlsstore" + mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" xmtpstore "github.com/xmtp/xmtp-node-go/pkg/store" "github.com/xmtp/xmtp-node-go/pkg/tracing" diff --git a/pkg/topic/topic.go b/pkg/topic/topic.go index f0192bbf..21b4f3f5 100644 --- a/pkg/topic/topic.go +++ b/pkg/topic/topic.go @@ -40,9 +40,9 @@ func Category(contentTopic string) string { } func BuildGroupTopic(groupId string) string { - return fmt.Sprintf("/xmtp/3/g-%s/proto", groupId) + return fmt.Sprintf("/xmtp/mls/1/g-%s/proto", groupId) } func BuildWelcomeTopic(installationId []byte) string { - return fmt.Sprintf("/xmtp/3/w-%x/proto", installationId) + return fmt.Sprintf("/xmtp/mls/1/w-%x/proto", installationId) } From 5a2ad342a36b4ec2b72649f7a24307f40d0aff73 Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Fri, 19 Jan 2024 10:51:00 -0500 Subject: [PATCH 08/20] Decouple MLS messages from messagev1 (#333) * Separate MLS messages and implement service methods * fix: group id and installation id are bytes * fix: idempotent send group/welcome messages via uniquness in db * fix: hex decode group id from mls validation service * fix: s/Cursor/IdCursor * fix: pass message data only in send group message request * refactor: add mls {Group,Welcome}MessageInput types for send requests * refactor: s/installation_id/installation_key in mls/api * fix: clean up mls query page size logic * feat: implement mls subscribe group/welcome messages * Hex encode group ID * fix: remove duplicate import * fix: return grpc invalidargument on invalid group id --------- Co-authored-by: Nicholas Molnar <65710+neekolas@users.noreply.github.com> --- dev/generate | 2 + dev/migrate-mls | 4 + dev/run | 2 + dev/up | 2 +- go.mod | 5 +- go.sum | 6 +- pkg/api/authentication_test.go | 18 +- pkg/api/config.go | 3 +- pkg/api/interceptor.go | 18 +- pkg/api/message/v1/service.go | 67 +-- pkg/api/server.go | 65 ++- pkg/authn/authn.pb.go | 2 +- .../mls/20240109001927_add-messages.down.sql | 6 + .../mls/20240109001927_add-messages.up.sql | 37 ++ pkg/mls/api/v1/mock.gen.go | 257 ++++++++++ pkg/mls/api/v1/service.go | 470 +++++++++++++----- pkg/mls/api/v1/service_test.go | 301 ++++++++--- pkg/mls/store/config.go | 2 + pkg/mls/store/models.go | 24 +- pkg/mls/store/store.go | 222 ++++++++- pkg/mls/store/store_test.go | 424 +++++++++++++++- pkg/mlsvalidate/service.go | 13 +- pkg/mlsvalidate/service_test.go | 2 +- pkg/store/query_test.go | 31 -- pkg/store/store.go | 72 --- pkg/topic/mls.go | 28 ++ pkg/topic/topic.go | 9 - tools.go | 2 +- 28 files changed, 1683 insertions(+), 411 deletions(-) create mode 100755 dev/migrate-mls create mode 100644 pkg/migrations/mls/20240109001927_add-messages.down.sql create mode 100644 pkg/migrations/mls/20240109001927_add-messages.up.sql create mode 100644 pkg/mls/api/v1/mock.gen.go create mode 100644 pkg/topic/mls.go diff --git a/dev/generate b/dev/generate index 2cd08848..871f9e74 100755 --- a/dev/generate +++ b/dev/generate @@ -2,3 +2,5 @@ set -e go generate ./... + +mockgen -package api github.com/xmtp/proto/v3/go/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer > pkg/mls/api/v1/mock.gen.go diff --git a/dev/migrate-mls b/dev/migrate-mls new file mode 100755 index 00000000..1af15f75 --- /dev/null +++ b/dev/migrate-mls @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +dev/run --create-mls-migration "$@" diff --git a/dev/run b/dev/run index e90f2126..b108c144 100755 --- a/dev/run +++ b/dev/run @@ -2,6 +2,7 @@ set -e MESSAGE_DB_DSN="postgres://postgres:xmtp@localhost:15432/postgres?sslmode=disable" +MLS_DB_DSN="postgres://postgres:xmtp@localhost:15432/postgres?sslmode=disable" AUTHZ_DB_DSN="postgres://postgres:xmtp@localhost:15432/postgres?sslmode=disable" NODE_KEY="8a30dcb604b0b53627a5adc054dbf434b446628d4bd1eccc681d223f0550ce67" @@ -13,6 +14,7 @@ go run cmd/xmtpd/main.go \ --store.db-connection-string "${MESSAGE_DB_DSN}" \ --store.reader-db-connection-string "${MESSAGE_DB_DSN}" \ --store.metrics-period 5s \ + --mls-store.db-connection-string "${MESSAGE_DB_DSN}" \ --authz-db-connection-string "${AUTHZ_DB_DSN}" \ --go-profiling \ "$@" diff --git a/dev/up b/dev/up index 2f09fa23..5a107cc3 100755 --- a/dev/up +++ b/dev/up @@ -8,7 +8,7 @@ if ! which golangci-lint &>/dev/null; then brew install golangci-lint; fi if ! which shellcheck &>/dev/null; then brew install shellcheck; fi if ! which protoc &>/dev/null; then brew install protobuf; fi if ! which protoc-gen-go &>/dev/null; then go install google.golang.org/protobuf/cmd/protoc-gen-go@latest; fi -if ! which mockgen &>/dev/null; then go install github.com/golang/mock/mockgen@latest; fi +if ! which mockgen &>/dev/null; then go install go.uber.org/mock/mockgen@latest; fi if ! which protolint &>/dev/null; then go install github.com/yoheimuta/protolint/cmd/protolint@latest; fi dev/generate diff --git a/go.mod b/go.mod index ba8eb007..3079b0da 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.20 require ( github.com/ethereum/go-ethereum v1.10.26 - github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 @@ -30,8 +29,9 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.36.3-0.20240111132545-4e1d2b1b2399 + github.com/xmtp/proto/v3 v3.37.1-0.20240112125235-f02fe8d0f1a0 github.com/yoheimuta/protolint v0.39.0 + go.uber.org/mock v0.4.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 google.golang.org/grpc v1.53.0 @@ -75,6 +75,7 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.0.0 // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/gopacket v1.1.19 // indirect diff --git a/go.sum b/go.sum index b6aef526..4c90c10e 100644 --- a/go.sum +++ b/go.sum @@ -1146,8 +1146,8 @@ github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 h1:wzUffJGCTBGXIDyNU+1UBu1fn2Nzo+OQzM1pLrheh58= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3/go.mod h1:bJREWk+NDnZYjgLQdAi8SUWuq/5pkMme4GqiffEhUF4= -github.com/xmtp/proto/v3 v3.36.3-0.20240111132545-4e1d2b1b2399 h1:i5qynxHZRn7mIXQPt8M7c6ac0NBb+MEn2g2qKzvRTyM= -github.com/xmtp/proto/v3 v3.36.3-0.20240111132545-4e1d2b1b2399/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= +github.com/xmtp/proto/v3 v3.37.1-0.20240112125235-f02fe8d0f1a0 h1:eGNiXDTiXcXTf5ne4HACbqbHaQrVlRz2hwcn05E7v8U= +github.com/xmtp/proto/v3 v3.37.1-0.20240112125235-f02fe8d0f1a0/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yoheimuta/go-protoparser/v4 v4.6.0 h1:uvz1e9/5Ihsm4Ku8AJeDImTpirKmIxubZdSn0QJNdnw= github.com/yoheimuta/go-protoparser/v4 v4.6.0/go.mod h1:AHNNnSWnb0UoL4QgHPiOAg2BniQceFscPI5X/BZNHl8= @@ -1182,6 +1182,8 @@ go.uber.org/fx v1.20.0 h1:ZMC/pnRvhsthOZh9MZjMq5U8Or3mA9zBSPaLnzs3ihQ= go.uber.org/fx v1.20.0/go.mod h1:qCUj0btiR3/JnanEr1TYEePfSw6o/4qYJscgvzQ5Ub0= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= diff --git a/pkg/api/authentication_test.go b/pkg/api/authentication_test.go index bd86e232..dd3f04c8 100644 --- a/pkg/api/authentication_test.go +++ b/pkg/api/authentication_test.go @@ -19,7 +19,7 @@ func Test_AuthnNoToken(t *testing.T) { }) } -func Test_AuthnNoTokenNonMLS(t *testing.T) { +func Test_AuthnNoTokenNonV0(t *testing.T) { ctx := context.Background() testGRPCAndHTTP(t, ctx, func(t *testing.T, client messageclient.Client, server *Server) { _, err := client.Publish(ctx, &messageV1.PublishRequest{ @@ -36,22 +36,6 @@ func Test_AuthnNoTokenNonMLS(t *testing.T) { }) } -func Test_AuthnNoTokenMLS(t *testing.T) { - ctx := context.Background() - testGRPCAndHTTP(t, ctx, func(t *testing.T, client messageclient.Client, server *Server) { - _, err := client.Publish(ctx, &messageV1.PublishRequest{ - Envelopes: []*messageV1.Envelope{ - { - ContentTopic: "/xmtp/mls/1/m-0x1234/proto", - TimestampNs: 0, - Message: []byte{}, - }, - }, - }) - require.NoError(t, err) - }) -} - func Test_AuthnNoTokenMixedV0MLS(t *testing.T) { ctx := context.Background() testGRPCAndHTTP(t, ctx, func(t *testing.T, client messageclient.Client, server *Server) { diff --git a/pkg/api/config.go b/pkg/api/config.go index daaaa5e2..880b824a 100644 --- a/pkg/api/config.go +++ b/pkg/api/config.go @@ -50,8 +50,7 @@ type AuthnOptions struct { Authenticated requests will be permitted according to the rules of the request type, (i.e. you can't publish into other wallets' contact and private topics). */ - Enable bool `long:"enable" description:"require client authentication via wallet tokens"` - EnableMLS bool `long:"enable-mls" description:"require client authentication for MLS"` + Enable bool `long:"enable" description:"require client authentication via wallet tokens"` /* Ratelimits enables request rate limiting. diff --git a/pkg/api/interceptor.go b/pkg/api/interceptor.go index c4860b5b..7b6c32c6 100644 --- a/pkg/api/interceptor.go +++ b/pkg/api/interceptor.go @@ -87,23 +87,9 @@ func (wa *WalletAuthorizer) Stream() grpc.StreamServerInterceptor { } } -func (wa *WalletAuthorizer) isProtocolMLS(request *messagev1.PublishRequest) bool { - envelopes := request.Envelopes - if len(envelopes) == 0 { - return false - } - // If any of the envelopes are not for a v3 topic, then we treat the request as non-v3 - for _, envelope := range envelopes { - if !strings.HasPrefix(envelope.ContentTopic, "/xmtp/mls/") { - return false - } - } - return true -} - func (wa *WalletAuthorizer) requiresAuthorization(req interface{}) bool { - publishRequest, isPublish := req.(*messagev1.PublishRequest) - return isPublish && (!wa.isProtocolMLS(publishRequest) || wa.AuthnConfig.EnableMLS) + _, isPublish := req.(*messagev1.PublishRequest) + return isPublish } func (wa *WalletAuthorizer) getWallet(ctx context.Context) (types.WalletAddr, error) { diff --git a/pkg/api/message/v1/service.go b/pkg/api/message/v1/service.go index bb1b256a..984a36a7 100644 --- a/pkg/api/message/v1/service.go +++ b/pkg/api/message/v1/service.go @@ -13,16 +13,13 @@ import ( "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" "github.com/pkg/errors" - wakunode "github.com/waku-org/go-waku/waku/v2/node" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" - wakurelay "github.com/waku-org/go-waku/waku/v2/protocol/relay" proto "github.com/xmtp/proto/v3/go/message_api/v1" apicontext "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/context" "github.com/xmtp/xmtp-node-go/pkg/logging" "github.com/xmtp/xmtp-node-go/pkg/metrics" "github.com/xmtp/xmtp-node-go/pkg/store" "github.com/xmtp/xmtp-node-go/pkg/topic" - "github.com/xmtp/xmtp-node-go/pkg/tracing" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -45,24 +42,24 @@ type Service struct { // Configured as constructor options. log *zap.Logger - waku *wakunode.WakuNode store *store.Store + publishToWakuRelay func(context.Context, *wakupb.WakuMessage) error + // Configured internally. ctx context.Context ctxCancel func() wg sync.WaitGroup - relaySub *wakurelay.Subscription ns *server.Server nc *nats.Conn } -func NewService(node *wakunode.WakuNode, logger *zap.Logger, store *store.Store) (s *Service, err error) { +func NewService(log *zap.Logger, store *store.Store, publishToWakuRelay func(context.Context, *wakupb.WakuMessage) error) (s *Service, err error) { s = &Service{ - waku: node, - log: logger.Named("message/v1"), - store: store, + log: log.Named("message/v1"), + store: store, + publishToWakuRelay: publishToWakuRelay, } s.ctx, s.ctxCancel = context.WithCancel(context.Background()) @@ -82,44 +79,11 @@ func NewService(node *wakunode.WakuNode, logger *zap.Logger, store *store.Store) return nil, err } - // Initialize waku relay subscription. - s.relaySub, err = s.waku.Relay().Subscribe(s.ctx) - if err != nil { - return nil, errors.Wrap(err, "subscribing to relay") - } - tracing.GoPanicWrap(s.ctx, &s.wg, "broadcast", func(ctx context.Context) { - for { - select { - case <-ctx.Done(): - return - case wakuEnv := <-s.relaySub.Ch: - if wakuEnv == nil { - continue - } - env := buildEnvelope(wakuEnv.Message()) - - envB, err := pb.Marshal(env) - if err != nil { - s.log.Error("marshalling envelope", zap.Error(err)) - continue - } - err = s.nc.Publish(buildNatsSubject(env.ContentTopic), envB) - if err != nil { - s.log.Error("publishing envelope to local nats", zap.Error(err)) - continue - } - } - } - }) - return s, nil } func (s *Service) Close() { s.log.Info("closing") - if s.relaySub != nil { - s.relaySub.Unsubscribe() - } if s.ctxCancel != nil { s.ctxCancel() @@ -136,6 +100,22 @@ func (s *Service) Close() { s.log.Info("closed") } +func (s *Service) HandleIncomingWakuRelayMessage(msg *wakupb.WakuMessage) error { + env := buildEnvelope(msg) + + envB, err := pb.Marshal(env) + if err != nil { + return err + } + + err = s.nc.Publish(buildNatsSubject(env.ContentTopic), envB) + if err != nil { + return err + } + + return nil +} + func (s *Service) Publish(ctx context.Context, req *proto.PublishRequest) (*proto.PublishResponse, error) { for _, env := range req.Envelopes { log := s.log.Named("publish").With(zap.String("content_topic", env.ContentTopic)) @@ -156,7 +136,7 @@ func (s *Service) Publish(ctx context.Context, req *proto.PublishRequest) (*prot } } - _, err := s.waku.Relay().Publish(ctx, &wakupb.WakuMessage{ + err := s.publishToWakuRelay(ctx, &wakupb.WakuMessage{ ContentTopic: env.ContentTopic, Timestamp: int64(env.TimestampNs), Payload: env.Message, @@ -164,6 +144,7 @@ func (s *Service) Publish(ctx context.Context, req *proto.PublishRequest) (*prot if err != nil { return nil, status.Errorf(codes.Internal, err.Error()) } + metrics.EmitPublishedEnvelope(ctx, log, env) } return &proto.PublishResponse{}, nil diff --git a/pkg/api/server.go b/pkg/api/server.go index 460a5e41..ea9fabf7 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -14,10 +14,13 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" swgui "github.com/swaggest/swgui/v3" + wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" + wakurelay "github.com/waku-org/go-waku/waku/v2/protocol/relay" proto "github.com/xmtp/proto/v3/go/message_api/v1" mlsv1pb "github.com/xmtp/proto/v3/go/mls/api/v1" messagev1openapi "github.com/xmtp/proto/v3/openapi/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" + "github.com/xmtp/xmtp-node-go/pkg/topic" "github.com/xmtp/xmtp-node-go/pkg/tracing" "google.golang.org/grpc/health" healthgrpc "google.golang.org/grpc/health/grpc_health_v1" @@ -48,6 +51,8 @@ type Server struct { mlsv1 *mlsv1.Service wg sync.WaitGroup ctx context.Context + ctxCancel func() + wakuRelaySub *wakurelay.Subscription authorizer *WalletAuthorizer } @@ -61,7 +66,7 @@ func New(config *Config) (*Server, error) { Config: config, } - s.ctx = context.Background() + s.ctx, s.ctxCancel = context.WithCancel(context.Background()) // Start gRPC services. err := s.startGRPC() @@ -123,7 +128,12 @@ func (s *Server) startGRPC() error { healthcheck := health.NewServer() healthgrpc.RegisterHealthServer(grpcServer, healthcheck) - s.messagev1, err = messagev1.NewService(s.Waku, s.Log, s.Store) + publishToWakuRelay := func(ctx context.Context, msg *wakupb.WakuMessage) error { + _, err := s.Waku.Relay().Publish(ctx, msg) + return err + } + + s.messagev1, err = messagev1.NewService(s.Log, s.Store, publishToWakuRelay) if err != nil { return errors.Wrap(err, "creating message service") } @@ -131,12 +141,49 @@ func (s *Server) startGRPC() error { // Enable the MLS server if a store is provided if s.Config.MLSStore != nil && s.Config.MLSValidator != nil && s.Config.EnableMls { - s.mlsv1, err = mlsv1.NewService(s.Waku, s.Log, s.Store, s.Config.MLSStore, s.Config.MLSValidator) + s.mlsv1, err = mlsv1.NewService(s.Log, s.Config.MLSStore, s.Config.MLSValidator, publishToWakuRelay) if err != nil { return errors.Wrap(err, "creating mls service") } mlsv1pb.RegisterMlsApiServer(grpcServer, s.mlsv1) } + + // Initialize waku relay subscription. + s.wakuRelaySub, err = s.Waku.Relay().Subscribe(s.ctx) + if err != nil { + return errors.Wrap(err, "subscribing to relay") + } + tracing.GoPanicWrap(s.ctx, &s.wg, "broadcast", func(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + case wakuEnv := <-s.wakuRelaySub.Ch: + if wakuEnv == nil || wakuEnv.Message() == nil { + continue + } + wakuMsg := wakuEnv.Message() + + if topic.IsMLSV1(wakuMsg.ContentTopic) { + if s.mlsv1 != nil { + err := s.mlsv1.HandleIncomingWakuRelayMessage(wakuEnv.Message()) + if err != nil { + s.Log.Error("error handling waku relay message by mlsv1 service", zap.Error(err)) + } + } + } else { + if s.messagev1 != nil { + err := s.messagev1.HandleIncomingWakuRelayMessage(wakuEnv.Message()) + if err != nil { + s.Log.Error("error handling waku relay message by messagev1 service", zap.Error(err)) + } + } + } + + } + } + }) + prometheus.Register(grpcServer) tracing.GoPanicWrap(s.ctx, &s.wg, "grpc", func(ctx context.Context) { @@ -215,9 +262,21 @@ func (s *Server) startHTTP() error { func (s *Server) Close() { s.Log.Info("closing") + + if s.ctxCancel != nil { + s.ctxCancel() + } + + if s.wakuRelaySub != nil { + s.wakuRelaySub.Unsubscribe() + } + if s.messagev1 != nil { s.messagev1.Close() } + if s.mlsv1 != nil { + s.mlsv1.Close() + } if s.httpListener != nil { err := s.httpListener.Close() diff --git a/pkg/authn/authn.pb.go b/pkg/authn/authn.pb.go index e7e88e3f..dc370405 100644 --- a/pkg/authn/authn.pb.go +++ b/pkg/authn/authn.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.8 +// protoc v4.25.1 // source: authn.proto package authn diff --git a/pkg/migrations/mls/20240109001927_add-messages.down.sql b/pkg/migrations/mls/20240109001927_add-messages.down.sql new file mode 100644 index 00000000..a64da5e3 --- /dev/null +++ b/pkg/migrations/mls/20240109001927_add-messages.down.sql @@ -0,0 +1,6 @@ +SET statement_timeout = 0; + +--bun:split + +DROP TABLE IF EXISTS messages; + diff --git a/pkg/migrations/mls/20240109001927_add-messages.up.sql b/pkg/migrations/mls/20240109001927_add-messages.up.sql new file mode 100644 index 00000000..6e71eb8b --- /dev/null +++ b/pkg/migrations/mls/20240109001927_add-messages.up.sql @@ -0,0 +1,37 @@ +SET statement_timeout = 0; + +--bun:split + +CREATE TABLE group_messages ( + id BIGSERIAL PRIMARY KEY, + created_at TIMESTAMP NOT NULL DEFAULT NOW(), + group_id BYTEA NOT NULL, + data BYTEA NOT NULL, + group_id_data_hash BYTEA NOT NULL +); + +--bun:split + +CREATE INDEX idx_group_messages_group_id_created_at ON group_messages(group_id, created_at); + +--bun:split + +CREATE UNIQUE INDEX idx_group_messages_group_id_data_hash ON group_messages (group_id_data_hash); + +--bun:split + +CREATE TABLE welcome_messages ( + id BIGSERIAL PRIMARY KEY, + created_at TIMESTAMP NOT NULL DEFAULT NOW(), + installation_key BYTEA NOT NULL, + data BYTEA NOT NULL, + installation_key_data_hash BYTEA NOT NULL +); + +--bun:split + +CREATE INDEX idx_welcome_messages_installation_key_created_at ON welcome_messages(installation_key, created_at); + +--bun:split + +CREATE UNIQUE INDEX idx_welcome_messages_group_key_data_hash ON welcome_messages (installation_key_data_hash); diff --git a/pkg/mls/api/v1/mock.gen.go b/pkg/mls/api/v1/mock.gen.go new file mode 100644 index 00000000..846dbf10 --- /dev/null +++ b/pkg/mls/api/v1/mock.gen.go @@ -0,0 +1,257 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/xmtp/proto/v3/go/mls/api/v1 (interfaces: MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer) +// +// Generated by this command: +// +// mockgen -package api github.com/xmtp/proto/v3/go/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer +// + +// Package api is a generated GoMock package. +package api + +import ( + context "context" + reflect "reflect" + + v1 "github.com/xmtp/proto/v3/go/mls/api/v1" + gomock "go.uber.org/mock/gomock" + metadata "google.golang.org/grpc/metadata" +) + +// MockMlsApi_SubscribeGroupMessagesServer is a mock of MlsApi_SubscribeGroupMessagesServer interface. +type MockMlsApi_SubscribeGroupMessagesServer struct { + ctrl *gomock.Controller + recorder *MockMlsApi_SubscribeGroupMessagesServerMockRecorder +} + +// MockMlsApi_SubscribeGroupMessagesServerMockRecorder is the mock recorder for MockMlsApi_SubscribeGroupMessagesServer. +type MockMlsApi_SubscribeGroupMessagesServerMockRecorder struct { + mock *MockMlsApi_SubscribeGroupMessagesServer +} + +// NewMockMlsApi_SubscribeGroupMessagesServer creates a new mock instance. +func NewMockMlsApi_SubscribeGroupMessagesServer(ctrl *gomock.Controller) *MockMlsApi_SubscribeGroupMessagesServer { + mock := &MockMlsApi_SubscribeGroupMessagesServer{ctrl: ctrl} + mock.recorder = &MockMlsApi_SubscribeGroupMessagesServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMlsApi_SubscribeGroupMessagesServer) EXPECT() *MockMlsApi_SubscribeGroupMessagesServerMockRecorder { + return m.recorder +} + +// Context mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).Context)) +} + +// RecvMsg mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) RecvMsg(arg0 any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RecvMsg", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) RecvMsg(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).RecvMsg), arg0) +} + +// Send mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) Send(arg0 *v1.GroupMessage) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Send", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Send indicates an expected call of Send. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) Send(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).Send), arg0) +} + +// SendHeader mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) SendHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendHeader indicates an expected call of SendHeader. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) SendHeader(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).SendHeader), arg0) +} + +// SendMsg mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) SendMsg(arg0 any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendMsg", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) SendMsg(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).SendMsg), arg0) +} + +// SetHeader mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) SetHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetHeader indicates an expected call of SetHeader. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) SetHeader(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).SetHeader), arg0) +} + +// SetTrailer mocks base method. +func (m *MockMlsApi_SubscribeGroupMessagesServer) SetTrailer(arg0 metadata.MD) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetTrailer", arg0) +} + +// SetTrailer indicates an expected call of SetTrailer. +func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) SetTrailer(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockMlsApi_SubscribeGroupMessagesServer)(nil).SetTrailer), arg0) +} + +// MockMlsApi_SubscribeWelcomeMessagesServer is a mock of MlsApi_SubscribeWelcomeMessagesServer interface. +type MockMlsApi_SubscribeWelcomeMessagesServer struct { + ctrl *gomock.Controller + recorder *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder +} + +// MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder is the mock recorder for MockMlsApi_SubscribeWelcomeMessagesServer. +type MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder struct { + mock *MockMlsApi_SubscribeWelcomeMessagesServer +} + +// NewMockMlsApi_SubscribeWelcomeMessagesServer creates a new mock instance. +func NewMockMlsApi_SubscribeWelcomeMessagesServer(ctrl *gomock.Controller) *MockMlsApi_SubscribeWelcomeMessagesServer { + mock := &MockMlsApi_SubscribeWelcomeMessagesServer{ctrl: ctrl} + mock.recorder = &MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) EXPECT() *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder { + return m.recorder +} + +// Context mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).Context)) +} + +// RecvMsg mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) RecvMsg(arg0 any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RecvMsg", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) RecvMsg(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).RecvMsg), arg0) +} + +// Send mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) Send(arg0 *v1.WelcomeMessage) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Send", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Send indicates an expected call of Send. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) Send(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).Send), arg0) +} + +// SendHeader mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) SendHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendHeader indicates an expected call of SendHeader. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) SendHeader(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).SendHeader), arg0) +} + +// SendMsg mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) SendMsg(arg0 any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendMsg", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) SendMsg(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).SendMsg), arg0) +} + +// SetHeader mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) SetHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetHeader indicates an expected call of SetHeader. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) SetHeader(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).SetHeader), arg0) +} + +// SetTrailer mocks base method. +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) SetTrailer(arg0 metadata.MD) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetTrailer", arg0) +} + +// SetTrailer indicates an expected call of SetTrailer. +func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) SetTrailer(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockMlsApi_SubscribeWelcomeMessagesServer)(nil).SetTrailer), arg0) +} diff --git a/pkg/mls/api/v1/service.go b/pkg/mls/api/v1/service.go index 97731ec9..7695cb88 100644 --- a/pkg/mls/api/v1/service.go +++ b/pkg/mls/api/v1/service.go @@ -2,45 +2,125 @@ package api import ( "context" - - wakunode "github.com/waku-org/go-waku/waku/v2/node" + "encoding/hex" + "errors" + "fmt" + "hash/fnv" + "sync" + "time" + + "github.com/nats-io/nats-server/v2/server" + "github.com/nats-io/nats.go" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" - proto "github.com/xmtp/proto/v3/go/mls/api/v1" - "github.com/xmtp/xmtp-node-go/pkg/metrics" + mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" - "github.com/xmtp/xmtp-node-go/pkg/store" "github.com/xmtp/xmtp-node-go/pkg/topic" "go.uber.org/zap" "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + pb "google.golang.org/protobuf/proto" emptypb "google.golang.org/protobuf/types/known/emptypb" ) type Service struct { - proto.UnimplementedMlsApiServer + mlsv1.UnimplementedMlsApiServer log *zap.Logger - waku *wakunode.WakuNode - messageStore *store.Store - mlsStore mlsstore.MlsStore + store mlsstore.MlsStore validationService mlsvalidate.MLSValidationService + + publishToWakuRelay func(context.Context, *wakupb.WakuMessage) error + + ns *server.Server + nc *nats.Conn + + ctx context.Context + ctxCancel func() } -func NewService(node *wakunode.WakuNode, logger *zap.Logger, messageStore *store.Store, mlsStore mlsstore.MlsStore, validationService mlsvalidate.MLSValidationService) (s *Service, err error) { +func NewService(log *zap.Logger, store mlsstore.MlsStore, validationService mlsvalidate.MLSValidationService, publishToWakuRelay func(context.Context, *wakupb.WakuMessage) error) (s *Service, err error) { s = &Service{ - log: logger.Named("mls/v1"), - waku: node, - messageStore: messageStore, - mlsStore: mlsStore, - validationService: validationService, + log: log.Named("mls/v1"), + store: store, + validationService: validationService, + publishToWakuRelay: publishToWakuRelay, + } + s.ctx, s.ctxCancel = context.WithCancel(context.Background()) + + // Initialize nats for subscriptions. + s.ns, err = server.NewServer(&server.Options{ + Port: server.RANDOM_PORT, + }) + if err != nil { + return nil, err + } + go s.ns.Start() + if !s.ns.ReadyForConnections(4 * time.Second) { + return nil, errors.New("nats not ready") + } + s.nc, err = nats.Connect(s.ns.ClientURL()) + if err != nil { + return nil, err } s.log.Info("Starting MLS service") return s, nil } -func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterInstallationRequest) (*proto.RegisterInstallationResponse, error) { +func (s *Service) Close() { + s.log.Info("closing") + + if s.ctxCancel != nil { + s.ctxCancel() + } + + if s.nc != nil { + s.nc.Close() + } + if s.ns != nil { + s.ns.Shutdown() + } + + s.log.Info("closed") +} + +func (s *Service) HandleIncomingWakuRelayMessage(wakuMsg *wakupb.WakuMessage) error { + if topic.IsMLSV1Group(wakuMsg.ContentTopic) { + var msg mlsv1.GroupMessage + err := pb.Unmarshal(wakuMsg.Payload, &msg) + if err != nil { + return err + } + if msg.GetV1() == nil { + return nil + } + err = s.nc.Publish(buildNatsSubjectForGroupMessages(msg.GetV1().GroupId), wakuMsg.Payload) + if err != nil { + return err + } + } else if topic.IsMLSV1Welcome(wakuMsg.ContentTopic) { + var msg mlsv1.WelcomeMessage + err := pb.Unmarshal(wakuMsg.Payload, &msg) + if err != nil { + return err + } + if msg.GetV1() == nil { + return nil + } + err = s.nc.Publish(buildNatsSubjectForWelcomeMessages(msg.GetV1().InstallationKey), wakuMsg.Payload) + if err != nil { + return err + } + } else { + s.log.Info("received unknown mls message type from waku relay", zap.String("topic", wakuMsg.ContentTopic)) + } + + return nil +} + +func (s *Service) RegisterInstallation(ctx context.Context, req *mlsv1.RegisterInstallationRequest) (*mlsv1.RegisterInstallationResponse, error) { if err := validateRegisterInstallationRequest(req); err != nil { return nil, err } @@ -53,22 +133,22 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *proto.RegisterI return nil, status.Errorf(codes.Internal, "unexpected number of results: %d", len(results)) } - installationId := results[0].InstallationId + installationId := results[0].InstallationKey accountAddress := results[0].AccountAddress credentialIdentity := results[0].CredentialIdentity - if err = s.mlsStore.CreateInstallation(ctx, installationId, accountAddress, credentialIdentity, req.KeyPackage.KeyPackageTlsSerialized, results[0].Expiration); err != nil { + if err = s.store.CreateInstallation(ctx, installationId, accountAddress, credentialIdentity, req.KeyPackage.KeyPackageTlsSerialized, results[0].Expiration); err != nil { return nil, err } - return &proto.RegisterInstallationResponse{ - InstallationId: installationId, + return &mlsv1.RegisterInstallationResponse{ + InstallationKey: installationId, }, nil } -func (s *Service) FetchKeyPackages(ctx context.Context, req *proto.FetchKeyPackagesRequest) (*proto.FetchKeyPackagesResponse, error) { - ids := req.InstallationIds - installations, err := s.mlsStore.FetchKeyPackages(ctx, ids) +func (s *Service) FetchKeyPackages(ctx context.Context, req *mlsv1.FetchKeyPackagesRequest) (*mlsv1.FetchKeyPackagesResponse, error) { + ids := req.InstallationKeys + installations, err := s.store.FetchKeyPackages(ctx, ids) if err != nil { return nil, status.Errorf(codes.Internal, "failed to fetch key packages: %s", err) } @@ -77,7 +157,7 @@ func (s *Service) FetchKeyPackages(ctx context.Context, req *proto.FetchKeyPacka keyPackageMap[string(id)] = idx } - resPackages := make([]*proto.FetchKeyPackagesResponse_KeyPackage, len(ids)) + resPackages := make([]*mlsv1.FetchKeyPackagesResponse_KeyPackage, len(ids)) for _, installation := range installations { idx, ok := keyPackageMap[string(installation.ID)] @@ -85,158 +165,292 @@ func (s *Service) FetchKeyPackages(ctx context.Context, req *proto.FetchKeyPacka return nil, status.Errorf(codes.Internal, "could not find key package for installation") } - resPackages[idx] = &proto.FetchKeyPackagesResponse_KeyPackage{ + resPackages[idx] = &mlsv1.FetchKeyPackagesResponse_KeyPackage{ KeyPackageTlsSerialized: installation.KeyPackage, } } - return &proto.FetchKeyPackagesResponse{ + return &mlsv1.FetchKeyPackagesResponse{ KeyPackages: resPackages, }, nil } -func (s *Service) PublishToGroup(ctx context.Context, req *proto.PublishToGroupRequest) (res *emptypb.Empty, err error) { - if err = validatePublishToGroupRequest(req); err != nil { +func (s *Service) UploadKeyPackage(ctx context.Context, req *mlsv1.UploadKeyPackageRequest) (res *emptypb.Empty, err error) { + if err = validateUploadKeyPackageRequest(req); err != nil { return nil, err } + // Extract the key packages from the request + keyPackageBytes := req.KeyPackage.KeyPackageTlsSerialized + + validationResults, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{keyPackageBytes}) + if err != nil { + // TODO: Differentiate between validation errors and internal errors + return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) + } + installationId := validationResults[0].InstallationKey + expiration := validationResults[0].Expiration - messages := make([][]byte, len(req.Messages)) - for i, message := range req.Messages { - v1 := message.GetV1() - if v1 == nil { - return nil, status.Errorf(codes.InvalidArgument, "message must be v1") - } - messages[i] = v1.MlsMessageTlsSerialized + if err = s.store.UpdateKeyPackage(ctx, installationId, keyPackageBytes, expiration); err != nil { + return nil, status.Errorf(codes.Internal, "failed to insert key packages: %s", err) + } + + return &emptypb.Empty{}, nil +} + +func (s *Service) RevokeInstallation(ctx context.Context, req *mlsv1.RevokeInstallationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "unimplemented") +} + +func (s *Service) GetIdentityUpdates(ctx context.Context, req *mlsv1.GetIdentityUpdatesRequest) (res *mlsv1.GetIdentityUpdatesResponse, err error) { + if err = validateGetIdentityUpdatesRequest(req); err != nil { + return nil, err } - validationResults, err := s.validationService.ValidateGroupMessages(ctx, messages) + accountAddresses := req.AccountAddresses + updates, err := s.store.GetIdentityUpdates(ctx, req.AccountAddresses, int64(req.StartTimeNs)) if err != nil { - // TODO: Separate validation errors from internal errors - return nil, status.Errorf(codes.InvalidArgument, "invalid group message: %s", err) + return nil, status.Errorf(codes.Internal, "failed to get identity updates: %s", err) } - for i, result := range validationResults { - message := messages[i] + resUpdates := make([]*mlsv1.GetIdentityUpdatesResponse_WalletUpdates, len(accountAddresses)) + for i, accountAddress := range accountAddresses { + walletUpdates := updates[accountAddress] - if err = requireReadyToSend(result.GroupId, message); err != nil { - return nil, err + resUpdates[i] = &mlsv1.GetIdentityUpdatesResponse_WalletUpdates{ + Updates: []*mlsv1.GetIdentityUpdatesResponse_Update{}, } - // TODO: Wrap this in a transaction so publishing is all or nothing - if err = s.publishMessage(ctx, topic.BuildGroupTopic(result.GroupId), message); err != nil { - return nil, status.Errorf(codes.Internal, "failed to publish message: %s", err) + for _, walletUpdate := range walletUpdates { + resUpdates[i].Updates = append(resUpdates[i].Updates, buildIdentityUpdate(walletUpdate)) } } - return &emptypb.Empty{}, nil + return &mlsv1.GetIdentityUpdatesResponse{ + Updates: resUpdates, + }, nil } -func (s *Service) publishMessage(ctx context.Context, contentTopic string, message []byte) error { - log := s.log.Named("publish-mls").With(zap.String("content_topic", contentTopic)) - env, err := s.messageStore.InsertMLSMessage(ctx, contentTopic, message) - if err != nil { - return status.Errorf(codes.Internal, "failed to insert message: %s", err) +func (s *Service) SendGroupMessages(ctx context.Context, req *mlsv1.SendGroupMessagesRequest) (res *emptypb.Empty, err error) { + if err = validateSendGroupMessagesRequest(req); err != nil { + return nil, err } - if _, err = s.waku.Relay().Publish(ctx, &wakupb.WakuMessage{ - ContentTopic: contentTopic, - Timestamp: int64(env.TimestampNs), - Payload: message, - }); err != nil { - return status.Errorf(codes.Internal, "failed to publish message: %s", err) + validationResults, err := s.validationService.ValidateGroupMessages(ctx, req.Messages) + if err != nil { + // TODO: Separate validation errors from internal errors + return nil, status.Errorf(codes.InvalidArgument, "invalid group message: %s", err) } - metrics.EmitPublishedEnvelope(ctx, log, env) + for i, result := range validationResults { + input := req.Messages[i] - return nil -} + if err = requireReadyToSend(result.GroupId, input.GetV1().Data); err != nil { + return nil, err + } -func (s *Service) PublishWelcomes(ctx context.Context, req *proto.PublishWelcomesRequest) (res *emptypb.Empty, err error) { - if err = validatePublishWelcomesRequest(req); err != nil { - return nil, err - } + // TODO: Wrap this in a transaction so publishing is all or nothing + decodedGroupId, err := hex.DecodeString(result.GroupId) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid group id") + } + msg, err := s.store.InsertGroupMessage(ctx, decodedGroupId, input.GetV1().Data) + if err != nil { + if mlsstore.IsAlreadyExistsError(err) { + continue + } + return nil, status.Errorf(codes.Internal, "failed to insert message: %s", err) + } - // TODO: Wrap this in a transaction so publishing is all or nothing - for _, welcome := range req.WelcomeMessages { - contentTopic := topic.BuildWelcomeTopic(welcome.InstallationId) - if err = s.publishMessage(ctx, contentTopic, welcome.WelcomeMessage.GetV1().WelcomeMessageTlsSerialized); err != nil { - return nil, status.Errorf(codes.Internal, "failed to publish welcome message: %s", err) + msgB, err := pb.Marshal(&mlsv1.GroupMessage{ + Version: &mlsv1.GroupMessage_V1_{ + V1: &mlsv1.GroupMessage_V1{ + Id: msg.Id, + CreatedNs: uint64(msg.CreatedAt.UnixNano()), + GroupId: msg.GroupId, + Data: msg.Data, + }, + }, + }) + if err != nil { + return nil, err + } + + err = s.publishToWakuRelay(ctx, &wakupb.WakuMessage{ + ContentTopic: topic.BuildMLSV1GroupTopic(decodedGroupId), + Timestamp: msg.CreatedAt.UnixNano(), + Payload: msgB, + }) + if err != nil { + return nil, err } } + return &emptypb.Empty{}, nil } -func (s *Service) UploadKeyPackage(ctx context.Context, req *proto.UploadKeyPackageRequest) (res *emptypb.Empty, err error) { - if err = validateUploadKeyPackageRequest(req); err != nil { +func (s *Service) SendWelcomeMessages(ctx context.Context, req *mlsv1.SendWelcomeMessagesRequest) (res *emptypb.Empty, err error) { + if err = validateSendWelcomeMessagesRequest(req); err != nil { return nil, err } - // Extract the key packages from the request - keyPackageBytes := req.KeyPackage.KeyPackageTlsSerialized - validationResults, err := s.validationService.ValidateKeyPackages(ctx, [][]byte{keyPackageBytes}) - if err != nil { - // TODO: Differentiate between validation errors and internal errors - return nil, status.Errorf(codes.InvalidArgument, "invalid identity: %s", err) - } - installationId := validationResults[0].InstallationId - expiration := validationResults[0].Expiration + // TODO: Wrap this in a transaction so publishing is all or nothing + for _, input := range req.Messages { + msg, err := s.store.InsertWelcomeMessage(ctx, input.GetV1().InstallationKey, input.GetV1().Data) + if err != nil { + if mlsstore.IsAlreadyExistsError(err) { + continue + } + return nil, status.Errorf(codes.Internal, "failed to insert message: %s", err) + } - if err = s.mlsStore.UpdateKeyPackage(ctx, installationId, keyPackageBytes, expiration); err != nil { - return nil, status.Errorf(codes.Internal, "failed to insert key packages: %s", err) - } + msgB, err := pb.Marshal(&mlsv1.WelcomeMessage{ + Version: &mlsv1.WelcomeMessage_V1_{ + V1: &mlsv1.WelcomeMessage_V1{ + Id: msg.Id, + CreatedNs: uint64(msg.CreatedAt.UnixNano()), + InstallationKey: msg.InstallationKey, + Data: msg.Data, + }, + }, + }) + if err != nil { + return nil, err + } + err = s.publishToWakuRelay(ctx, &wakupb.WakuMessage{ + ContentTopic: topic.BuildMLSV1WelcomeTopic(input.GetV1().InstallationKey), + Timestamp: msg.CreatedAt.UnixNano(), + Payload: msgB, + }) + if err != nil { + return nil, err + } + } return &emptypb.Empty{}, nil } -func (s *Service) RevokeInstallation(ctx context.Context, req *proto.RevokeInstallationRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "unimplemented") +func (s *Service) QueryGroupMessages(ctx context.Context, req *mlsv1.QueryGroupMessagesRequest) (*mlsv1.QueryGroupMessagesResponse, error) { + return s.store.QueryGroupMessagesV1(ctx, req) } -func (s *Service) GetIdentityUpdates(ctx context.Context, req *proto.GetIdentityUpdatesRequest) (res *proto.GetIdentityUpdatesResponse, err error) { - if err = validateGetIdentityUpdatesRequest(req); err != nil { - return nil, err - } +func (s *Service) QueryWelcomeMessages(ctx context.Context, req *mlsv1.QueryWelcomeMessagesRequest) (*mlsv1.QueryWelcomeMessagesResponse, error) { + return s.store.QueryWelcomeMessagesV1(ctx, req) +} - accountAddresses := req.AccountAddresses - updates, err := s.mlsStore.GetIdentityUpdates(ctx, req.AccountAddresses, int64(req.StartTimeNs)) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get identity updates: %s", err) +func (s *Service) SubscribeGroupMessages(req *mlsv1.SubscribeGroupMessagesRequest, stream mlsv1.MlsApi_SubscribeGroupMessagesServer) error { + log := s.log.Named("subscribe-group-messages").With(zap.Int("filters", len(req.Filters))) + + // Send a header (any header) to fix an issue with Tonic based GRPC clients. + // See: https://github.com/xmtp/libxmtp/pull/58 + _ = stream.SendHeader(metadata.Pairs("subscribed", "true")) + + var streamLock sync.Mutex + for _, filter := range req.Filters { + natsSubject := buildNatsSubjectForGroupMessages(filter.GroupId) + sub, err := s.nc.Subscribe(natsSubject, func(natsMsg *nats.Msg) { + var msg mlsv1.GroupMessage + err := pb.Unmarshal(natsMsg.Data, &msg) + if err != nil { + log.Error("parsing group message from bytes", zap.Error(err)) + return + } + func() { + streamLock.Lock() + defer streamLock.Unlock() + err := stream.Send(&msg) + if err != nil { + log.Error("sending group message to subscribe", zap.Error(err)) + } + }() + }) + if err != nil { + log.Error("error subscribing to group messages", zap.Error(err)) + return err + } + defer func() { + _ = sub.Unsubscribe() + }() } - resUpdates := make([]*proto.GetIdentityUpdatesResponse_WalletUpdates, len(accountAddresses)) - for i, accountAddress := range accountAddresses { - walletUpdates := updates[accountAddress] + select { + case <-stream.Context().Done(): + return nil + case <-s.ctx.Done(): + return nil + } +} - resUpdates[i] = &proto.GetIdentityUpdatesResponse_WalletUpdates{ - Updates: []*proto.GetIdentityUpdatesResponse_Update{}, +func (s *Service) SubscribeWelcomeMessages(req *mlsv1.SubscribeWelcomeMessagesRequest, stream mlsv1.MlsApi_SubscribeWelcomeMessagesServer) error { + log := s.log.Named("subscribe-welcome-messages").With(zap.Int("filters", len(req.Filters))) + + // Send a header (any header) to fix an issue with Tonic based GRPC clients. + // See: https://github.com/xmtp/libxmtp/pull/58 + _ = stream.SendHeader(metadata.Pairs("subscribed", "true")) + + var streamLock sync.Mutex + for _, filter := range req.Filters { + natsSubject := buildNatsSubjectForWelcomeMessages(filter.InstallationKey) + sub, err := s.nc.Subscribe(natsSubject, func(natsMsg *nats.Msg) { + var msg mlsv1.WelcomeMessage + err := pb.Unmarshal(natsMsg.Data, &msg) + if err != nil { + log.Error("parsing welcome message from bytes", zap.Error(err)) + return + } + func() { + streamLock.Lock() + defer streamLock.Unlock() + err := stream.Send(&msg) + if err != nil { + log.Error("sending welcome message to subscribe", zap.Error(err)) + } + }() + }) + if err != nil { + log.Error("error subscribing to welcome messages", zap.Error(err)) + return err } + defer func() { + _ = sub.Unsubscribe() + }() + } - for _, walletUpdate := range walletUpdates { - resUpdates[i].Updates = append(resUpdates[i].Updates, buildIdentityUpdate(walletUpdate)) - } + select { + case <-stream.Context().Done(): + return nil + case <-s.ctx.Done(): + return nil } +} - return &proto.GetIdentityUpdatesResponse{ - Updates: resUpdates, - }, nil +func buildNatsSubjectForGroupMessages(groupId []byte) string { + hasher := fnv.New64a() + hasher.Write(groupId) + return fmt.Sprintf("gm-%x", hasher.Sum64()) } -func buildIdentityUpdate(update mlsstore.IdentityUpdate) *proto.GetIdentityUpdatesResponse_Update { - base := proto.GetIdentityUpdatesResponse_Update{ +func buildNatsSubjectForWelcomeMessages(installationId []byte) string { + hasher := fnv.New64a() + hasher.Write(installationId) + return fmt.Sprintf("wm-%x", hasher.Sum64()) +} + +func buildIdentityUpdate(update mlsstore.IdentityUpdate) *mlsv1.GetIdentityUpdatesResponse_Update { + base := mlsv1.GetIdentityUpdatesResponse_Update{ TimestampNs: update.TimestampNs, } switch update.Kind { case mlsstore.Create: - base.Kind = &proto.GetIdentityUpdatesResponse_Update_NewInstallation{ - NewInstallation: &proto.GetIdentityUpdatesResponse_NewInstallationUpdate{ - InstallationId: update.InstallationId, + base.Kind = &mlsv1.GetIdentityUpdatesResponse_Update_NewInstallation{ + NewInstallation: &mlsv1.GetIdentityUpdatesResponse_NewInstallationUpdate{ + InstallationKey: update.InstallationKey, CredentialIdentity: update.CredentialIdentity, }, } case mlsstore.Revoke: - base.Kind = &proto.GetIdentityUpdatesResponse_Update_RevokedInstallation{ - RevokedInstallation: &proto.GetIdentityUpdatesResponse_RevokedInstallationUpdate{ - InstallationId: update.InstallationId, + base.Kind = &mlsv1.GetIdentityUpdatesResponse_Update_RevokedInstallation{ + RevokedInstallation: &mlsv1.GetIdentityUpdatesResponse_RevokedInstallationUpdate{ + InstallationKey: update.InstallationKey, }, } } @@ -244,45 +458,45 @@ func buildIdentityUpdate(update mlsstore.IdentityUpdate) *proto.GetIdentityUpdat return &base } -func validatePublishToGroupRequest(req *proto.PublishToGroupRequest) error { +func validateSendGroupMessagesRequest(req *mlsv1.SendGroupMessagesRequest) error { if req == nil || len(req.Messages) == 0 { - return status.Errorf(codes.InvalidArgument, "no messages to publish") + return status.Errorf(codes.InvalidArgument, "no group messages to send") + } + for _, input := range req.Messages { + if input == nil || input.GetV1() == nil { + return status.Errorf(codes.InvalidArgument, "invalid group message") + } } return nil } -func validatePublishWelcomesRequest(req *proto.PublishWelcomesRequest) error { - if req == nil || len(req.WelcomeMessages) == 0 { - return status.Errorf(codes.InvalidArgument, "no welcome messages to publish") +func validateSendWelcomeMessagesRequest(req *mlsv1.SendWelcomeMessagesRequest) error { + if req == nil || len(req.Messages) == 0 { + return status.Errorf(codes.InvalidArgument, "no welcome messages to send") } - for _, welcome := range req.WelcomeMessages { - if welcome == nil || welcome.WelcomeMessage == nil { - return status.Errorf(codes.InvalidArgument, "invalid welcome message") - } - - v1 := welcome.WelcomeMessage.GetV1() - if v1 == nil || len(v1.WelcomeMessageTlsSerialized) == 0 { + for _, input := range req.Messages { + if input == nil || input.GetV1() == nil { return status.Errorf(codes.InvalidArgument, "invalid welcome message") } } return nil } -func validateRegisterInstallationRequest(req *proto.RegisterInstallationRequest) error { +func validateRegisterInstallationRequest(req *mlsv1.RegisterInstallationRequest) error { if req == nil || req.KeyPackage == nil { return status.Errorf(codes.InvalidArgument, "no key package") } return nil } -func validateUploadKeyPackageRequest(req *proto.UploadKeyPackageRequest) error { +func validateUploadKeyPackageRequest(req *mlsv1.UploadKeyPackageRequest) error { if req == nil || req.KeyPackage == nil { return status.Errorf(codes.InvalidArgument, "no key package") } return nil } -func validateGetIdentityUpdatesRequest(req *proto.GetIdentityUpdatesRequest) error { +func validateGetIdentityUpdatesRequest(req *mlsv1.GetIdentityUpdatesRequest) error { if req == nil || len(req.AccountAddresses) == 0 { return status.Errorf(codes.InvalidArgument, "no wallet addresses to get updates for") } @@ -290,7 +504,7 @@ func validateGetIdentityUpdatesRequest(req *proto.GetIdentityUpdatesRequest) err } func requireReadyToSend(groupId string, message []byte) error { - if groupId == "" { + if len(groupId) == 0 { return status.Errorf(codes.InvalidArgument, "group id is empty") } if len(message) == 0 { diff --git a/pkg/mls/api/v1/service_test.go b/pkg/mls/api/v1/service_test.go index 8ad15ba3..d725318b 100644 --- a/pkg/mls/api/v1/service_test.go +++ b/pkg/mls/api/v1/service_test.go @@ -5,17 +5,19 @@ import ( "errors" "fmt" "testing" + "time" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/uptrace/bun" - v1 "github.com/xmtp/proto/v3/go/message_api/v1" - proto "github.com/xmtp/proto/v3/go/mls/api/v1" - messageContents "github.com/xmtp/proto/v3/go/mls/message_contents" + wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" + mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" - "github.com/xmtp/xmtp-node-go/pkg/store" test "github.com/xmtp/xmtp-node-go/pkg/testing" + "github.com/xmtp/xmtp-node-go/pkg/topic" + "go.uber.org/mock/gomock" + "google.golang.org/protobuf/proto" ) type mockedMLSValidationService struct { @@ -33,7 +35,7 @@ func (m *mockedMLSValidationService) ValidateKeyPackages(ctx context.Context, ke return response.([]mlsvalidate.IdentityValidationResult), args.Error(1) } -func (m *mockedMLSValidationService) ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]mlsvalidate.GroupMessageValidationResult, error) { +func (m *mockedMLSValidationService) ValidateGroupMessages(ctx context.Context, groupMessages []*mlsv1.GroupMessageInput) ([]mlsvalidate.GroupMessageValidationResult, error) { args := m.Called(ctx, groupMessages) return args.Get(0).([]mlsvalidate.GroupMessageValidationResult), args.Error(1) @@ -46,7 +48,7 @@ func newMockedValidationService() *mockedMLSValidationService { func (m *mockedMLSValidationService) mockValidateKeyPackages(installationId []byte, accountAddress string) *mock.Call { return m.On("ValidateKeyPackages", mock.Anything, mock.Anything).Return([]mlsvalidate.IdentityValidationResult{ { - InstallationId: installationId, + InstallationKey: installationId, AccountAddress: accountAddress, CredentialIdentity: []byte("test"), Expiration: 0, @@ -54,41 +56,32 @@ func (m *mockedMLSValidationService) mockValidateKeyPackages(installationId []by }, nil) } -func (m *mockedMLSValidationService) mockValidateGroupMessages(groupId string) *mock.Call { +func (m *mockedMLSValidationService) mockValidateGroupMessages(groupId []byte) *mock.Call { return m.On("ValidateGroupMessages", mock.Anything, mock.Anything).Return([]mlsvalidate.GroupMessageValidationResult{ { - GroupId: groupId, + GroupId: fmt.Sprintf("%x", groupId), }, }, nil) } func newTestService(t *testing.T, ctx context.Context) (*Service, *bun.DB, *mockedMLSValidationService, func()) { log := test.NewLog(t) - mlsDb, _, mlsDbCleanup := test.NewMLSDB(t) - mlsStore, err := mlsstore.New(ctx, mlsstore.Config{ + db, _, mlsDbCleanup := test.NewMLSDB(t) + store, err := mlsstore.New(ctx, mlsstore.Config{ Log: log, - DB: mlsDb, + DB: db, }) require.NoError(t, err) - messageDb, _, messageDbCleanup := test.NewDB(t) - messageStore, err := store.New(&store.Config{ - Log: log, - DB: messageDb, - ReaderDB: messageDb, - CleanerDB: messageDb, - }) - require.NoError(t, err) - node, nodeCleanup := test.NewNode(t) mlsValidationService := newMockedValidationService() - svc, err := NewService(node, log, messageStore, mlsStore, mlsValidationService) + svc, err := NewService(log, store, mlsValidationService, func(ctx context.Context, wm *wakupb.WakuMessage) error { + return nil + }) require.NoError(t, err) - return svc, mlsDb, mlsValidationService, func() { - messageStore.Close() + return svc, db, mlsValidationService, func() { + svc.Close() mlsDbCleanup() - messageDbCleanup() - nodeCleanup() } } @@ -102,14 +95,14 @@ func TestRegisterInstallation(t *testing.T) { mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) - res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + res, err := svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) require.NoError(t, err) - require.Equal(t, installationId, res.InstallationId) + require.Equal(t, installationId, res.InstallationKey) installations := []mlsstore.Installation{} err = mlsDb.NewSelect().Model(&installations).Where("id = ?", installationId).Scan(ctx) @@ -126,8 +119,8 @@ func TestRegisterInstallationError(t *testing.T) { mlsValidationService.On("ValidateKeyPackages", ctx, mock.Anything).Return(nil, errors.New("error validating")) - res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + res, err := svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) @@ -145,16 +138,16 @@ func TestUploadKeyPackage(t *testing.T) { mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) - res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + res, err := svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) require.NoError(t, err) require.NotNil(t, res) - uploadRes, err := svc.UploadKeyPackage(ctx, &proto.UploadKeyPackageRequest{ - KeyPackage: &proto.KeyPackageUpload{ + uploadRes, err := svc.UploadKeyPackage(ctx, &mlsv1.UploadKeyPackageRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test2"), }, }) @@ -176,8 +169,8 @@ func TestFetchKeyPackages(t *testing.T) { mockCall := mlsValidationService.mockValidateKeyPackages(installationId1, accountAddress1) - res, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + res, err := svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) @@ -191,16 +184,16 @@ func TestFetchKeyPackages(t *testing.T) { mockCall.Unset() mlsValidationService.mockValidateKeyPackages(installationId2, accountAddress2) - res, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + res, err = svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test2"), }, }) require.NoError(t, err) require.NotNil(t, res) - consumeRes, err := svc.FetchKeyPackages(ctx, &proto.FetchKeyPackagesRequest{ - InstallationIds: [][]byte{installationId1, installationId2}, + consumeRes, err := svc.FetchKeyPackages(ctx, &mlsv1.FetchKeyPackagesRequest{ + InstallationKeys: [][]byte{installationId1, installationId2}, }) require.NoError(t, err) require.NotNil(t, consumeRes) @@ -209,8 +202,8 @@ func TestFetchKeyPackages(t *testing.T) { require.Equal(t, []byte("test2"), consumeRes.KeyPackages[1].KeyPackageTlsSerialized) // Now do it with the installationIds reversed - consumeRes, err = svc.FetchKeyPackages(ctx, &proto.FetchKeyPackagesRequest{ - InstallationIds: [][]byte{installationId2, installationId1}, + consumeRes, err = svc.FetchKeyPackages(ctx, &mlsv1.FetchKeyPackagesRequest{ + InstallationKeys: [][]byte{installationId2, installationId1}, }) require.NoError(t, err) @@ -226,40 +219,72 @@ func TestFetchKeyPackagesFail(t *testing.T) { svc, _, _, cleanup := newTestService(t, ctx) defer cleanup() - consumeRes, err := svc.FetchKeyPackages(ctx, &proto.FetchKeyPackagesRequest{ - InstallationIds: [][]byte{test.RandomBytes(32)}, + consumeRes, err := svc.FetchKeyPackages(ctx, &mlsv1.FetchKeyPackagesRequest{ + InstallationKeys: [][]byte{test.RandomBytes(32)}, }) require.Nil(t, err) - require.Equal(t, []*proto.FetchKeyPackagesResponse_KeyPackage{nil}, consumeRes.KeyPackages) + require.Equal(t, []*mlsv1.FetchKeyPackagesResponse_KeyPackage{nil}, consumeRes.KeyPackages) } -func TestPublishToGroup(t *testing.T) { +func TestSendGroupMessages(t *testing.T) { ctx := context.Background() svc, _, mlsValidationService, cleanup := newTestService(t, ctx) defer cleanup() - groupId := test.RandomString(32) + groupId := []byte(test.RandomString(32)) mlsValidationService.mockValidateGroupMessages(groupId) - _, err := svc.PublishToGroup(ctx, &proto.PublishToGroupRequest{ - Messages: []*messageContents.GroupMessage{{ - Version: &messageContents.GroupMessage_V1_{ - V1: &messageContents.GroupMessage_V1{ - MlsMessageTlsSerialized: []byte("test"), + _, err := svc.SendGroupMessages(ctx, &mlsv1.SendGroupMessagesRequest{ + Messages: []*mlsv1.GroupMessageInput{ + { + Version: &mlsv1.GroupMessageInput_V1_{ + V1: &mlsv1.GroupMessageInput_V1{ + Data: []byte("test"), + }, }, }, - }}, + }, }) require.NoError(t, err) - results, err := svc.messageStore.Query(&v1.QueryRequest{ - ContentTopics: []string{fmt.Sprintf("/xmtp/mls/1/g-%s/proto", groupId)}, + resp, err := svc.store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: groupId, }) require.NoError(t, err) - require.Len(t, results.Envelopes, 1) - require.Equal(t, results.Envelopes[0].Message, []byte("test")) - require.NotNil(t, results.Envelopes[0].TimestampNs) + require.Len(t, resp.Messages, 1) + require.Equal(t, resp.Messages[0].GetV1().Data, []byte("test")) + require.NotEmpty(t, resp.Messages[0].GetV1().CreatedNs) +} + +func TestSendWelcomeMessages(t *testing.T) { + ctx := context.Background() + svc, _, _, cleanup := newTestService(t, ctx) + defer cleanup() + + installationId := []byte(test.RandomString(32)) + + _, err := svc.SendWelcomeMessages(ctx, &mlsv1.SendWelcomeMessagesRequest{ + Messages: []*mlsv1.WelcomeMessageInput{ + { + Version: &mlsv1.WelcomeMessageInput_V1_{ + V1: &mlsv1.WelcomeMessageInput_V1{ + InstallationKey: []byte(installationId), + Data: []byte("test"), + }, + }, + }, + }, + }) + require.NoError(t, err) + + resp, err := svc.store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: installationId, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 1) + require.Equal(t, resp.Messages[0].GetV1().Data, []byte("test")) + require.NotEmpty(t, resp.Messages[0].GetV1().CreatedNs) } func TestGetIdentityUpdates(t *testing.T) { @@ -272,41 +297,185 @@ func TestGetIdentityUpdates(t *testing.T) { mockCall := mlsValidationService.mockValidateKeyPackages(installationId, accountAddress) - _, err := svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + _, err := svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) require.NoError(t, err) - identityUpdates, err := svc.GetIdentityUpdates(ctx, &proto.GetIdentityUpdatesRequest{ + identityUpdates, err := svc.GetIdentityUpdates(ctx, &mlsv1.GetIdentityUpdatesRequest{ AccountAddresses: []string{accountAddress}, }) require.NoError(t, err) require.NotNil(t, identityUpdates) require.Len(t, identityUpdates.Updates, 1) - require.Equal(t, identityUpdates.Updates[0].Updates[0].GetNewInstallation().InstallationId, installationId) + require.Equal(t, identityUpdates.Updates[0].Updates[0].GetNewInstallation().InstallationKey, installationId) require.Equal(t, identityUpdates.Updates[0].Updates[0].GetNewInstallation().CredentialIdentity, []byte("test")) for _, walletUpdate := range identityUpdates.Updates { for _, update := range walletUpdate.Updates { - require.Equal(t, installationId, update.GetNewInstallation().InstallationId) + require.Equal(t, installationId, update.GetNewInstallation().InstallationKey) } } mockCall.Unset() mlsValidationService.mockValidateKeyPackages(test.RandomBytes(32), accountAddress) - _, err = svc.RegisterInstallation(ctx, &proto.RegisterInstallationRequest{ - KeyPackage: &proto.KeyPackageUpload{ + _, err = svc.RegisterInstallation(ctx, &mlsv1.RegisterInstallationRequest{ + KeyPackage: &mlsv1.KeyPackageUpload{ KeyPackageTlsSerialized: []byte("test"), }, }) require.NoError(t, err) - identityUpdates, err = svc.GetIdentityUpdates(ctx, &proto.GetIdentityUpdatesRequest{ + identityUpdates, err = svc.GetIdentityUpdates(ctx, &mlsv1.GetIdentityUpdatesRequest{ AccountAddresses: []string{accountAddress}, }) require.NoError(t, err) require.Len(t, identityUpdates.Updates, 1) require.Len(t, identityUpdates.Updates[0].Updates, 2) } + +func TestSubscribeGroupMessages(t *testing.T) { + ctx := context.Background() + svc, _, _, cleanup := newTestService(t, ctx) + defer cleanup() + + groupId := []byte(test.RandomString(32)) + + msgs := make([]*mlsv1.GroupMessage, 10) + for i := 0; i < 10; i++ { + msgs[i] = &mlsv1.GroupMessage{ + Version: &mlsv1.GroupMessage_V1_{ + V1: &mlsv1.GroupMessage_V1{ + Id: uint64(i + 1), + CreatedNs: uint64(i + 1), + GroupId: groupId, + Data: []byte(fmt.Sprintf("data%d", i+1)), + }, + }, + } + } + + ctrl := gomock.NewController(t) + stream := NewMockMlsApi_SubscribeGroupMessagesServer(ctrl) + stream.EXPECT().SendHeader(map[string][]string{"subscribed": {"true"}}) + for _, msg := range msgs { + stream.EXPECT().Send(newGroupMessageEqualsMatcher(msg)).Return(nil).Times(1) + } + stream.EXPECT().Context().Return(ctx) + + go func() { + err := svc.SubscribeGroupMessages(&mlsv1.SubscribeGroupMessagesRequest{ + Filters: []*mlsv1.SubscribeGroupMessagesRequest_Filter{ + { + GroupId: groupId, + }, + }, + }, stream) + require.NoError(t, err) + }() + time.Sleep(50 * time.Millisecond) + + for _, msg := range msgs { + msgB, err := proto.Marshal(msg) + require.NoError(t, err) + + err = svc.HandleIncomingWakuRelayMessage(&wakupb.WakuMessage{ + ContentTopic: topic.BuildMLSV1GroupTopic(msg.GetV1().GroupId), + Timestamp: int64(msg.GetV1().CreatedNs), + Payload: msgB, + }) + require.NoError(t, err) + } + + require.Eventually(t, ctrl.Satisfied, 5*time.Second, 100*time.Millisecond) +} + +func TestSubscribeWelcomeMessages(t *testing.T) { + ctx := context.Background() + svc, _, _, cleanup := newTestService(t, ctx) + defer cleanup() + + installationKey := []byte(test.RandomString(32)) + + msgs := make([]*mlsv1.WelcomeMessage, 10) + for i := 0; i < 10; i++ { + msgs[i] = &mlsv1.WelcomeMessage{ + Version: &mlsv1.WelcomeMessage_V1_{ + V1: &mlsv1.WelcomeMessage_V1{ + Id: uint64(i + 1), + CreatedNs: uint64(i + 1), + InstallationKey: installationKey, + Data: []byte(fmt.Sprintf("data%d", i+1)), + }, + }, + } + } + + ctrl := gomock.NewController(t) + stream := NewMockMlsApi_SubscribeWelcomeMessagesServer(ctrl) + stream.EXPECT().SendHeader(map[string][]string{"subscribed": {"true"}}) + for _, msg := range msgs { + stream.EXPECT().Send(newWelcomeMessageEqualsMatcher(msg)).Return(nil).Times(1) + } + stream.EXPECT().Context().Return(ctx) + + go func() { + err := svc.SubscribeWelcomeMessages(&mlsv1.SubscribeWelcomeMessagesRequest{ + Filters: []*mlsv1.SubscribeWelcomeMessagesRequest_Filter{ + { + InstallationKey: installationKey, + }, + }, + }, stream) + require.NoError(t, err) + }() + time.Sleep(50 * time.Millisecond) + + for _, msg := range msgs { + msgB, err := proto.Marshal(msg) + require.NoError(t, err) + + err = svc.HandleIncomingWakuRelayMessage(&wakupb.WakuMessage{ + ContentTopic: topic.BuildMLSV1WelcomeTopic(msg.GetV1().InstallationKey), + Timestamp: int64(msg.GetV1().CreatedNs), + Payload: msgB, + }) + require.NoError(t, err) + } + + require.Eventually(t, ctrl.Satisfied, 5*time.Second, 100*time.Millisecond) +} + +type groupMessageEqualsMatcher struct { + obj *mlsv1.GroupMessage +} + +func newGroupMessageEqualsMatcher(obj *mlsv1.GroupMessage) *groupMessageEqualsMatcher { + return &groupMessageEqualsMatcher{obj} +} + +func (m *groupMessageEqualsMatcher) Matches(obj interface{}) bool { + return proto.Equal(m.obj, obj.(*mlsv1.GroupMessage)) +} + +func (m *groupMessageEqualsMatcher) String() string { + return m.obj.String() +} + +type welcomeMessageEqualsMatcher struct { + obj *mlsv1.WelcomeMessage +} + +func newWelcomeMessageEqualsMatcher(obj *mlsv1.WelcomeMessage) *welcomeMessageEqualsMatcher { + return &welcomeMessageEqualsMatcher{obj} +} + +func (m *welcomeMessageEqualsMatcher) Matches(obj interface{}) bool { + return proto.Equal(m.obj, obj.(*mlsv1.WelcomeMessage)) +} + +func (m *welcomeMessageEqualsMatcher) String() string { + return m.obj.String() +} diff --git a/pkg/mls/store/config.go b/pkg/mls/store/config.go index 6da5323a..064767c9 100644 --- a/pkg/mls/store/config.go +++ b/pkg/mls/store/config.go @@ -17,4 +17,6 @@ type StoreOptions struct { type Config struct { Log *zap.Logger DB *bun.DB + + now func() time.Time } diff --git a/pkg/mls/store/models.go b/pkg/mls/store/models.go index 02ec32cc..d9ceccea 100644 --- a/pkg/mls/store/models.go +++ b/pkg/mls/store/models.go @@ -1,6 +1,10 @@ package store -import "github.com/uptrace/bun" +import ( + "time" + + "github.com/uptrace/bun" +) type Installation struct { bun.BaseModel `bun:"table:installations"` @@ -15,3 +19,21 @@ type Installation struct { KeyPackage []byte `bun:"key_package,notnull,type:bytea"` Expiration uint64 `bun:"expiration,notnull"` } + +type GroupMessage struct { + bun.BaseModel `bun:"table:group_messages"` + + Id uint64 `bun:",pk,notnull"` + CreatedAt time.Time `bun:",notnull"` + GroupId []byte `bun:",notnull,type:bytea"` + Data []byte `bun:",notnull,type:bytea"` +} + +type WelcomeMessage struct { + bun.BaseModel `bun:"table:welcome_messages"` + + Id uint64 `bun:",pk,notnull"` + CreatedAt time.Time `bun:",notnull"` + InstallationKey []byte `bun:",notnull,type:bytea"` + Data []byte `bun:",notnull,type:bytea"` +} diff --git a/pkg/mls/store/store.go b/pkg/mls/store/store.go index c338fdf3..8e64318b 100644 --- a/pkg/mls/store/store.go +++ b/pkg/mls/store/store.go @@ -2,16 +2,21 @@ package store import ( "context" + "crypto/sha256" "errors" "sort" + "strings" "time" "github.com/uptrace/bun" "github.com/uptrace/bun/migrate" - mlsMigrations "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" + mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" + migrations "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" "go.uber.org/zap" ) +const maxPageSize = 100 + type Store struct { config Config log *zap.Logger @@ -23,9 +28,18 @@ type MlsStore interface { UpdateKeyPackage(ctx context.Context, installationId, keyPackage []byte, expiration uint64) error FetchKeyPackages(ctx context.Context, installationIds [][]byte) ([]*Installation, error) GetIdentityUpdates(ctx context.Context, walletAddresses []string, startTimeNs int64) (map[string]IdentityUpdateList, error) + InsertGroupMessage(ctx context.Context, groupId []byte, data []byte) (*GroupMessage, error) + InsertWelcomeMessage(ctx context.Context, installationId []byte, data []byte) (*WelcomeMessage, error) + QueryGroupMessagesV1(ctx context.Context, query *mlsv1.QueryGroupMessagesRequest) (*mlsv1.QueryGroupMessagesResponse, error) + QueryWelcomeMessagesV1(ctx context.Context, query *mlsv1.QueryWelcomeMessagesRequest) (*mlsv1.QueryWelcomeMessagesResponse, error) } func New(ctx context.Context, config Config) (*Store, error) { + if config.now == nil { + config.now = func() time.Time { + return time.Now().UTC() + } + } s := &Store{ log: config.Log.Named("mlsstore"), db: config.DB, @@ -125,16 +139,16 @@ func (s *Store) GetIdentityUpdates(ctx context.Context, walletAddresses []string if installation.CreatedAt > startTimeNs { out[installation.WalletAddress] = append(out[installation.WalletAddress], IdentityUpdate{ Kind: Create, - InstallationId: installation.ID, + InstallationKey: installation.ID, CredentialIdentity: installation.CredentialIdentity, TimestampNs: uint64(installation.CreatedAt), }) } if installation.RevokedAt != nil && *installation.RevokedAt > startTimeNs { out[installation.WalletAddress] = append(out[installation.WalletAddress], IdentityUpdate{ - Kind: Revoke, - InstallationId: installation.ID, - TimestampNs: uint64(*installation.RevokedAt), + Kind: Revoke, + InstallationKey: installation.ID, + TimestampNs: uint64(*installation.RevokedAt), }) } } @@ -157,8 +171,185 @@ func (s *Store) RevokeInstallation(ctx context.Context, installationId []byte) e return err } +func (s *Store) InsertGroupMessage(ctx context.Context, groupId []byte, data []byte) (*GroupMessage, error) { + message := GroupMessage{ + Data: data, + } + + var id uint64 + err := s.db.QueryRow("INSERT INTO group_messages (group_id, data, group_id_data_hash) VALUES (?, ?, ?) RETURNING id", groupId, data, sha256.Sum256(append(groupId, data...))).Scan(&id) + if err != nil { + if strings.Contains(err.Error(), "duplicate key value violates unique constraint") { + return nil, NewAlreadyExistsError(err) + } + return nil, err + } + + err = s.db.NewSelect().Model(&message).Where("id = ?", id).Scan(ctx) + if err != nil { + return nil, err + } + + return &message, nil +} + +func (s *Store) InsertWelcomeMessage(ctx context.Context, installationId []byte, data []byte) (*WelcomeMessage, error) { + message := WelcomeMessage{ + Data: data, + } + + var id uint64 + err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash) VALUES (?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...))).Scan(&id) + if err != nil { + if strings.Contains(err.Error(), "duplicate key value violates unique constraint") { + return nil, NewAlreadyExistsError(err) + } + return nil, err + } + + err = s.db.NewSelect().Model(&message).Where("id = ?", id).Scan(ctx) + if err != nil { + return nil, err + } + + return &message, nil +} + +func (s *Store) QueryGroupMessagesV1(ctx context.Context, req *mlsv1.QueryGroupMessagesRequest) (*mlsv1.QueryGroupMessagesResponse, error) { + msgs := make([]*GroupMessage, 0) + + if len(req.GroupId) == 0 { + return nil, errors.New("group is required") + } + + q := s.db.NewSelect(). + Model(&msgs). + Where("group_id = ?", req.GroupId) + + direction := mlsv1.SortDirection_SORT_DIRECTION_DESCENDING + if req.PagingInfo != nil && req.PagingInfo.Direction != mlsv1.SortDirection_SORT_DIRECTION_UNSPECIFIED { + direction = req.PagingInfo.Direction + } + switch direction { + case mlsv1.SortDirection_SORT_DIRECTION_DESCENDING: + q = q.Order("id DESC") + case mlsv1.SortDirection_SORT_DIRECTION_ASCENDING: + q = q.Order("id ASC") + } + + pageSize := maxPageSize + if req.PagingInfo != nil && req.PagingInfo.Limit > 0 && req.PagingInfo.Limit <= maxPageSize { + pageSize = int(req.PagingInfo.Limit) + } + q = q.Limit(pageSize) + + if req.PagingInfo != nil && req.PagingInfo.IdCursor != 0 { + if direction == mlsv1.SortDirection_SORT_DIRECTION_ASCENDING { + q = q.Where("id > ?", req.PagingInfo.IdCursor) + } else { + q = q.Where("id < ?", req.PagingInfo.IdCursor) + } + } + + err := q.Scan(ctx) + if err != nil { + return nil, err + } + + messages := make([]*mlsv1.GroupMessage, 0, len(msgs)) + for _, msg := range msgs { + messages = append(messages, &mlsv1.GroupMessage{ + Version: &mlsv1.GroupMessage_V1_{ + V1: &mlsv1.GroupMessage_V1{ + Id: msg.Id, + CreatedNs: uint64(msg.CreatedAt.UnixNano()), + GroupId: msg.GroupId, + Data: msg.Data, + }, + }, + }) + } + + pagingInfo := &mlsv1.PagingInfo{Limit: uint32(pageSize), IdCursor: 0, Direction: direction} + if len(messages) >= pageSize { + lastMsg := msgs[len(messages)-1] + pagingInfo.IdCursor = lastMsg.Id + } + + return &mlsv1.QueryGroupMessagesResponse{ + Messages: messages, + PagingInfo: pagingInfo, + }, nil +} + +func (s *Store) QueryWelcomeMessagesV1(ctx context.Context, req *mlsv1.QueryWelcomeMessagesRequest) (*mlsv1.QueryWelcomeMessagesResponse, error) { + msgs := make([]*WelcomeMessage, 0) + + if len(req.InstallationKey) == 0 { + return nil, errors.New("installation is required") + } + + q := s.db.NewSelect(). + Model(&msgs). + Where("installation_key = ?", req.InstallationKey) + + direction := mlsv1.SortDirection_SORT_DIRECTION_DESCENDING + if req.PagingInfo != nil && req.PagingInfo.Direction != mlsv1.SortDirection_SORT_DIRECTION_UNSPECIFIED { + direction = req.PagingInfo.Direction + } + switch direction { + case mlsv1.SortDirection_SORT_DIRECTION_DESCENDING: + q = q.Order("id DESC") + case mlsv1.SortDirection_SORT_DIRECTION_ASCENDING: + q = q.Order("id ASC") + } + + pageSize := maxPageSize + if req.PagingInfo != nil && req.PagingInfo.Limit > 0 && req.PagingInfo.Limit <= maxPageSize { + pageSize = int(req.PagingInfo.Limit) + } + q = q.Limit(pageSize) + + if req.PagingInfo != nil && req.PagingInfo.IdCursor != 0 { + if direction == mlsv1.SortDirection_SORT_DIRECTION_ASCENDING { + q = q.Where("id > ?", req.PagingInfo.IdCursor) + } else { + q = q.Where("id < ?", req.PagingInfo.IdCursor) + } + } + + err := q.Scan(ctx) + if err != nil { + return nil, err + } + + messages := make([]*mlsv1.WelcomeMessage, 0, len(msgs)) + for _, msg := range msgs { + messages = append(messages, &mlsv1.WelcomeMessage{ + Version: &mlsv1.WelcomeMessage_V1_{ + V1: &mlsv1.WelcomeMessage_V1{ + Id: msg.Id, + CreatedNs: uint64(msg.CreatedAt.UnixNano()), + Data: msg.Data, + }, + }, + }) + } + + pagingInfo := &mlsv1.PagingInfo{Limit: uint32(pageSize), IdCursor: 0, Direction: direction} + if len(messages) >= pageSize { + lastMsg := msgs[len(messages)-1] + pagingInfo.IdCursor = lastMsg.Id + } + + return &mlsv1.QueryWelcomeMessagesResponse{ + Messages: messages, + PagingInfo: pagingInfo, + }, nil +} + func (s *Store) migrate(ctx context.Context) error { - migrator := migrate.NewMigrator(s.db, mlsMigrations.Migrations) + migrator := migrate.NewMigrator(s.db, migrations.Migrations) err := migrator.Init(ctx) if err != nil { return err @@ -189,7 +380,7 @@ const ( type IdentityUpdate struct { Kind IdentityUpdateKind - InstallationId []byte + InstallationKey []byte CredentialIdentity []byte TimestampNs uint64 } @@ -208,3 +399,20 @@ func (a IdentityUpdateList) Swap(i, j int) { func (a IdentityUpdateList) Less(i, j int) bool { return a[i].TimestampNs < a[j].TimestampNs } + +type AlreadyExistsError struct { + Err error +} + +func (e *AlreadyExistsError) Error() string { + return e.Err.Error() +} + +func NewAlreadyExistsError(err error) *AlreadyExistsError { + return &AlreadyExistsError{err} +} + +func IsAlreadyExistsError(err error) bool { + _, ok := err.(*AlreadyExistsError) + return ok +} diff --git a/pkg/mls/store/store_test.go b/pkg/mls/store/store_test.go index 703cf9e8..569b09c0 100644 --- a/pkg/mls/store/store_test.go +++ b/pkg/mls/store/store_test.go @@ -4,8 +4,10 @@ import ( "context" "sort" "testing" + "time" "github.com/stretchr/testify/require" + mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" test "github.com/xmtp/xmtp-node-go/pkg/testing" ) @@ -104,9 +106,9 @@ func TestGetIdentityUpdates(t *testing.T) { identityUpdates, err := store.GetIdentityUpdates(ctx, []string{walletAddress}, 0) require.NoError(t, err) require.Len(t, identityUpdates[walletAddress], 2) - require.Equal(t, identityUpdates[walletAddress][0].InstallationId, installationId1) + require.Equal(t, identityUpdates[walletAddress][0].InstallationKey, installationId1) require.Equal(t, identityUpdates[walletAddress][0].Kind, Create) - require.Equal(t, identityUpdates[walletAddress][1].InstallationId, installationId2) + require.Equal(t, identityUpdates[walletAddress][1].InstallationKey, installationId2) // Make sure that date filtering works identityUpdates, err = store.GetIdentityUpdates(ctx, []string{walletAddress}, nowNs()+1000000) @@ -171,3 +173,421 @@ func TestIdentityUpdateSort(t *testing.T) { require.Equal(t, updates[1].TimestampNs, uint64(2)) require.Equal(t, updates[2].TimestampNs, uint64(3)) } + +func TestInsertGroupMessage_Single(t *testing.T) { + started := time.Now().UTC().Add(-time.Minute) + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + msg, err := store.InsertGroupMessage(ctx, []byte("group"), []byte("data")) + require.NoError(t, err) + require.NotNil(t, msg) + require.Equal(t, uint64(1), msg.Id) + require.True(t, msg.CreatedAt.Before(time.Now().UTC()) && msg.CreatedAt.After(started)) + require.Equal(t, []byte("group"), msg.GroupId) + require.Equal(t, []byte("data"), msg.Data) + + msgs := make([]*GroupMessage, 0) + err = store.db.NewSelect().Model(&msgs).Scan(ctx) + require.NoError(t, err) + require.Len(t, msgs, 1) + require.Equal(t, msg, msgs[0]) +} + +func TestInsertGroupMessage_Duplicate(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + msg, err := store.InsertGroupMessage(ctx, []byte("group"), []byte("data")) + require.NoError(t, err) + require.NotNil(t, msg) + + msg, err = store.InsertGroupMessage(ctx, []byte("group"), []byte("data")) + require.Nil(t, msg) + require.IsType(t, &AlreadyExistsError{}, err) + require.True(t, IsAlreadyExistsError(err)) +} + +func TestInsertGroupMessage_ManyOrderedByTime(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + _, err := store.InsertGroupMessage(ctx, []byte("group"), []byte("data1")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group"), []byte("data2")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group"), []byte("data3")) + require.NoError(t, err) + + msgs := make([]*GroupMessage, 0) + err = store.db.NewSelect().Model(&msgs).Order("created_at DESC").Scan(ctx) + require.NoError(t, err) + require.Len(t, msgs, 3) + require.Equal(t, []byte("data3"), msgs[0].Data) + require.Equal(t, []byte("data2"), msgs[1].Data) + require.Equal(t, []byte("data1"), msgs[2].Data) +} + +func TestInsertWelcomeMessage_Single(t *testing.T) { + started := time.Now().UTC().Add(-time.Minute) + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + msg, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data")) + require.NoError(t, err) + require.NotNil(t, msg) + require.Equal(t, uint64(1), msg.Id) + require.True(t, msg.CreatedAt.Before(time.Now().UTC()) && msg.CreatedAt.After(started)) + require.Equal(t, []byte("installation"), msg.InstallationKey) + require.Equal(t, []byte("data"), msg.Data) + + msgs := make([]*WelcomeMessage, 0) + err = store.db.NewSelect().Model(&msgs).Scan(ctx) + require.NoError(t, err) + require.Len(t, msgs, 1) + require.Equal(t, msg, msgs[0]) +} + +func TestInsertWelcomeMessage_Duplicate(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + msg, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data")) + require.NoError(t, err) + require.NotNil(t, msg) + + msg, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data")) + require.Nil(t, msg) + require.IsType(t, &AlreadyExistsError{}, err) + require.True(t, IsAlreadyExistsError(err)) +} + +func TestInsertWelcomeMessage_ManyOrderedByTime(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + _, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data1")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data2")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data3")) + require.NoError(t, err) + + msgs := make([]*WelcomeMessage, 0) + err = store.db.NewSelect().Model(&msgs).Order("created_at DESC").Scan(ctx) + require.NoError(t, err) + require.Len(t, msgs, 3) + require.Equal(t, []byte("data3"), msgs[0].Data) + require.Equal(t, []byte("data2"), msgs[1].Data) + require.Equal(t, []byte("data1"), msgs[2].Data) +} + +func TestQueryGroupMessagesV1_MissingGroup(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + + resp, err := store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{}) + require.EqualError(t, err, "group is required") + require.Nil(t, resp) +} + +func TestQueryWelcomeMessagesV1_MissingInstallation(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + + resp, err := store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{}) + require.EqualError(t, err, "installation is required") + require.Nil(t, resp) +} + +func TestQueryGroupMessagesV1_Filter(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + _, err := store.InsertGroupMessage(ctx, []byte("group1"), []byte("data1")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group2"), []byte("data2")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group1"), []byte("data3")) + require.NoError(t, err) + + resp, err := store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("unknown"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 0) + + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("data3"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("data1"), resp.Messages[1].GetV1().Data) + + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group2"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 1) + require.Equal(t, []byte("data2"), resp.Messages[0].GetV1().Data) + + // Sort ascending + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + PagingInfo: &mlsv1.PagingInfo{ + Direction: mlsv1.SortDirection_SORT_DIRECTION_ASCENDING, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("data1"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("data3"), resp.Messages[1].GetV1().Data) +} + +func TestQueryWelcomeMessagesV1_Filter(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + _, err := store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("data1")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("data2")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("data3")) + require.NoError(t, err) + + resp, err := store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("unknown"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 0) + + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("data3"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("data1"), resp.Messages[1].GetV1().Data) + + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation2"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 1) + require.Equal(t, []byte("data2"), resp.Messages[0].GetV1().Data) + + // Sort ascending + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + PagingInfo: &mlsv1.PagingInfo{ + Direction: mlsv1.SortDirection_SORT_DIRECTION_ASCENDING, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("data1"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("data3"), resp.Messages[1].GetV1().Data) +} + +func TestQueryGroupMessagesV1_Paginate(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + _, err := store.InsertGroupMessage(ctx, []byte("group1"), []byte("content1")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group2"), []byte("content2")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group1"), []byte("content3")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group2"), []byte("content4")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group1"), []byte("content5")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group1"), []byte("content6")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group1"), []byte("content7")) + require.NoError(t, err) + _, err = store.InsertGroupMessage(ctx, []byte("group1"), []byte("content8")) + require.NoError(t, err) + + resp, err := store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 6) + require.Equal(t, []byte("content8"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content7"), resp.Messages[1].GetV1().Data) + require.Equal(t, []byte("content6"), resp.Messages[2].GetV1().Data) + require.Equal(t, []byte("content5"), resp.Messages[3].GetV1().Data) + require.Equal(t, []byte("content3"), resp.Messages[4].GetV1().Data) + require.Equal(t, []byte("content1"), resp.Messages[5].GetV1().Data) + + thirdMsg := resp.Messages[2] + fifthMsg := resp.Messages[4] + + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + PagingInfo: &mlsv1.PagingInfo{ + Limit: 2, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content8"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content7"), resp.Messages[1].GetV1().Data) + + // Order descending by default + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + PagingInfo: &mlsv1.PagingInfo{ + Limit: 2, + IdCursor: thirdMsg.GetV1().Id, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content5"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content3"), resp.Messages[1].GetV1().Data) + + // Next page from previous response + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + PagingInfo: resp.PagingInfo, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 1) + require.Equal(t, []byte("content1"), resp.Messages[0].GetV1().Data) + + // Order ascending + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + PagingInfo: &mlsv1.PagingInfo{ + Limit: 2, + Direction: mlsv1.SortDirection_SORT_DIRECTION_ASCENDING, + IdCursor: fifthMsg.GetV1().Id, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content5"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content6"), resp.Messages[1].GetV1().Data) + + // Next page from previous response + resp, err = store.QueryGroupMessagesV1(ctx, &mlsv1.QueryGroupMessagesRequest{ + GroupId: []byte("group1"), + PagingInfo: resp.PagingInfo, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content7"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content8"), resp.Messages[1].GetV1().Data) +} + +func TestQueryWelcomeMessagesV1_Paginate(t *testing.T) { + store, cleanup := NewTestStore(t) + defer cleanup() + + ctx := context.Background() + _, err := store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content1")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("content2")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content3")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("content4")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content5")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content6")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content7")) + require.NoError(t, err) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content8")) + require.NoError(t, err) + + resp, err := store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 6) + require.Equal(t, []byte("content8"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content7"), resp.Messages[1].GetV1().Data) + require.Equal(t, []byte("content6"), resp.Messages[2].GetV1().Data) + require.Equal(t, []byte("content5"), resp.Messages[3].GetV1().Data) + require.Equal(t, []byte("content3"), resp.Messages[4].GetV1().Data) + require.Equal(t, []byte("content1"), resp.Messages[5].GetV1().Data) + + thirdMsg := resp.Messages[2] + fifthMsg := resp.Messages[4] + + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + PagingInfo: &mlsv1.PagingInfo{ + Limit: 2, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content8"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content7"), resp.Messages[1].GetV1().Data) + + // Order descending by default + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + PagingInfo: &mlsv1.PagingInfo{ + Limit: 2, + IdCursor: thirdMsg.GetV1().Id, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content5"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content3"), resp.Messages[1].GetV1().Data) + + // Next page from previous response + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + PagingInfo: resp.PagingInfo, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 1) + require.Equal(t, []byte("content1"), resp.Messages[0].GetV1().Data) + + // Order ascending + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + PagingInfo: &mlsv1.PagingInfo{ + Limit: 2, + Direction: mlsv1.SortDirection_SORT_DIRECTION_ASCENDING, + IdCursor: fifthMsg.GetV1().Id, + }, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content5"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content6"), resp.Messages[1].GetV1().Data) + + // Next page from previous response + resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ + InstallationKey: []byte("installation1"), + PagingInfo: resp.PagingInfo, + }) + require.NoError(t, err) + require.Len(t, resp.Messages, 2) + require.Equal(t, []byte("content7"), resp.Messages[0].GetV1().Data) + require.Equal(t, []byte("content8"), resp.Messages[1].GetV1().Data) +} diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go index 0391abb1..ed9f5b11 100644 --- a/pkg/mlsvalidate/service.go +++ b/pkg/mlsvalidate/service.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" svc "github.com/xmtp/proto/v3/go/mls_validation/v1" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -11,7 +12,7 @@ import ( type IdentityValidationResult struct { AccountAddress string - InstallationId []byte + InstallationKey []byte CredentialIdentity []byte Expiration uint64 } @@ -27,7 +28,7 @@ type IdentityInput struct { type MLSValidationService interface { ValidateKeyPackages(ctx context.Context, keyPackages [][]byte) ([]IdentityValidationResult, error) - ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]GroupMessageValidationResult, error) + ValidateGroupMessages(ctx context.Context, groupMessages []*mlsv1.GroupMessageInput) ([]GroupMessageValidationResult, error) } type MLSValidationServiceImpl struct { @@ -57,7 +58,7 @@ func (s *MLSValidationServiceImpl) ValidateKeyPackages(ctx context.Context, keyP } out[i] = IdentityValidationResult{ AccountAddress: response.AccountAddress, - InstallationId: response.InstallationId, + InstallationKey: response.InstallationId, CredentialIdentity: response.CredentialIdentityBytes, Expiration: response.Expiration, } @@ -77,7 +78,7 @@ func makeValidateKeyPackageRequest(keyPackageBytes [][]byte) *svc.ValidateKeyPac } } -func (s *MLSValidationServiceImpl) ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]GroupMessageValidationResult, error) { +func (s *MLSValidationServiceImpl) ValidateGroupMessages(ctx context.Context, groupMessages []*mlsv1.GroupMessageInput) ([]GroupMessageValidationResult, error) { req := makeValidateGroupMessagesRequest(groupMessages) response, err := s.grpcClient.ValidateGroupMessages(ctx, req) @@ -98,11 +99,11 @@ func (s *MLSValidationServiceImpl) ValidateGroupMessages(ctx context.Context, gr return out, nil } -func makeValidateGroupMessagesRequest(groupMessages [][]byte) *svc.ValidateGroupMessagesRequest { +func makeValidateGroupMessagesRequest(groupMessages []*mlsv1.GroupMessageInput) *svc.ValidateGroupMessagesRequest { groupMessageRequests := make([]*svc.ValidateGroupMessagesRequest_GroupMessage, len(groupMessages)) for i, groupMessage := range groupMessages { groupMessageRequests[i] = &svc.ValidateGroupMessagesRequest_GroupMessage{ - GroupMessageBytesTlsSerialized: groupMessage, + GroupMessageBytesTlsSerialized: groupMessage.GetV1().Data, } } return &svc.ValidateGroupMessagesRequest{ diff --git a/pkg/mlsvalidate/service_test.go b/pkg/mlsvalidate/service_test.go index 33b5cb95..6e0a7332 100644 --- a/pkg/mlsvalidate/service_test.go +++ b/pkg/mlsvalidate/service_test.go @@ -56,7 +56,7 @@ func TestValidateKeyPackages(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 1, len(res)) assert.Equal(t, "0x123", res[0].AccountAddress) - assert.Equal(t, []byte("123"), res[0].InstallationId) + assert.Equal(t, []byte("123"), res[0].InstallationKey) assert.Equal(t, []byte("456"), res[0].CredentialIdentity) } diff --git a/pkg/store/query_test.go b/pkg/store/query_test.go index d3c2c028..5d084e4a 100644 --- a/pkg/store/query_test.go +++ b/pkg/store/query_test.go @@ -1,7 +1,6 @@ package store import ( - "context" "testing" "time" @@ -285,33 +284,3 @@ func TestPageSizeOne(t *testing.T) { loops++ } } - -func TestMlsMessagePublish(t *testing.T) { - store, cleanup, _ := createAndFillDb(t) - defer cleanup() - - message := []byte{1, 2, 3} - contentTopic := "foo" - ctx := context.Background() - - env, err := store.InsertMLSMessage(ctx, contentTopic, message) - require.NoError(t, err) - - require.Equal(t, env.ContentTopic, contentTopic) - require.Equal(t, env.Message, message) - - response, err := store.Query(&messagev1.QueryRequest{ - ContentTopics: []string{contentTopic}, - }) - require.NoError(t, err) - require.Len(t, response.Envelopes, 1) - require.Equal(t, response.Envelopes[0].Message, message) - require.Equal(t, response.Envelopes[0].ContentTopic, contentTopic) - require.NotNil(t, response.Envelopes[0].TimestampNs) - - parsedTime := time.Unix(0, int64(response.Envelopes[0].TimestampNs)) - // Sanity check to ensure that the timestamps are reasonable - require.True(t, time.Since(parsedTime) < 10*time.Second || time.Since(parsedTime) > -10*time.Second) - - require.Equal(t, env.TimestampNs, response.Envelopes[0].TimestampNs) -} diff --git a/pkg/store/store.go b/pkg/store/store.go index 4a309044..71e17d9a 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -2,7 +2,6 @@ package store import ( "context" - "fmt" "strings" "sync" "time" @@ -21,22 +20,6 @@ import ( const maxPageSize = 100 -const timestampGeneratorSql = `( - ( - EXTRACT( - EPOCH - FROM - clock_timestamp() - ) :: bigint * 1000000000 - ) + ( - EXTRACT( - MICROSECONDS - FROM - clock_timestamp() - ) :: bigint * 1000 - ) -)` - type Store struct { config *Config ctx context.Context @@ -144,61 +127,6 @@ func (s *Store) InsertMessage(env *messagev1.Envelope) (bool, error) { return stored, err } -func (s *Store) InsertMLSMessage(ctx context.Context, contentTopic string, data []byte) (*messagev1.Envelope, error) { - tmpEnvelope := &messagev1.Envelope{ - ContentTopic: contentTopic, - Message: data, - } - digest := computeDigest(tmpEnvelope) - var envelope messagev1.Envelope - - err := tracing.Wrap(s.ctx, s.log, "storing mls message", func(ctx context.Context, log *zap.Logger, span tracing.Span) error { - tracing.SpanResource(span, "store") - tracing.SpanType(span, "db") - - stmnt := fmt.Sprintf(`INSERT INTO - message ( - id, - receiverTimestamp, - senderTimestamp, - contentTopic, - pubsubTopic, - payload, - version, - should_expire - ) - VALUES - ( - $1, - %s, - %s, - $2, - $3, - $4, - $5, - $6 - ) RETURNING senderTimestamp`, timestampGeneratorSql, timestampGeneratorSql) - - var senderTimestamp uint64 - err := s.config.DB.QueryRowContext(ctx, stmnt, digest, contentTopic, "", data, 0, false).Scan(&senderTimestamp) - if err != nil { - return err - } - envelope = messagev1.Envelope{ - ContentTopic: contentTopic, - TimestampNs: senderTimestamp, - Message: data, - } - return err - }) - - if err != nil { - return nil, err - } - - return &envelope, nil -} - func (s *Store) insertMessage(env *messagev1.Envelope, receiverTimestamp int64) error { digest := computeDigest(env) shouldExpire := !isXMTP(env.ContentTopic) diff --git a/pkg/topic/mls.go b/pkg/topic/mls.go new file mode 100644 index 00000000..33f3ecbf --- /dev/null +++ b/pkg/topic/mls.go @@ -0,0 +1,28 @@ +package topic + +import ( + "fmt" + "strings" +) + +const mlsv1Prefix = "/xmtp/mls/1/" + +func IsMLSV1(topic string) bool { + return strings.HasPrefix(topic, mlsv1Prefix) +} + +func IsMLSV1Group(topic string) bool { + return strings.HasPrefix(topic, mlsv1Prefix+"g-") +} + +func IsMLSV1Welcome(topic string) bool { + return strings.HasPrefix(topic, mlsv1Prefix+"w-") +} + +func BuildMLSV1GroupTopic(groupId []byte) string { + return fmt.Sprintf("%sg-%x/proto", mlsv1Prefix, groupId) +} + +func BuildMLSV1WelcomeTopic(installationId []byte) string { + return fmt.Sprintf("%sw-%x/proto", mlsv1Prefix, installationId) +} diff --git a/pkg/topic/topic.go b/pkg/topic/topic.go index 21b4f3f5..f2460045 100644 --- a/pkg/topic/topic.go +++ b/pkg/topic/topic.go @@ -1,7 +1,6 @@ package topic import ( - "fmt" "strings" ) @@ -38,11 +37,3 @@ func Category(contentTopic string) string { } return "invalid" } - -func BuildGroupTopic(groupId string) string { - return fmt.Sprintf("/xmtp/mls/1/g-%s/proto", groupId) -} - -func BuildWelcomeTopic(installationId []byte) string { - return fmt.Sprintf("/xmtp/mls/1/w-%x/proto", installationId) -} diff --git a/tools.go b/tools.go index 4f5979a8..5a194c14 100644 --- a/tools.go +++ b/tools.go @@ -4,7 +4,7 @@ package tools import ( - _ "github.com/golang/mock/mockgen" _ "github.com/yoheimuta/protolint/cmd/protolint" + _ "go.uber.org/mock/mockgen" _ "google.golang.org/protobuf/cmd/protoc-gen-go" ) From ab05559c5674831f76009f265042a1e7195ac9ca Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:03:01 -0800 Subject: [PATCH 09/20] Generate protos in repo (#335) * Add buf.gen.yaml * Gen protos * Update build steps --- buf.gen.yaml | 28 + dev/generate | 7 +- go.mod | 1 - pkg/api/authentication.go | 4 +- pkg/api/authentication_test.go | 2 +- pkg/api/interceptor.go | 2 +- pkg/api/message/v1/client/grpc_client.go | 2 +- pkg/api/message/v1/client/grpc_stream.go | 2 +- pkg/api/message/v1/client/http_client.go | 2 +- pkg/api/message/v1/client/http_stream.go | 2 +- pkg/api/message/v1/client/interface.go | 2 +- pkg/api/message/v1/service.go | 2 +- pkg/api/server.go | 6 +- pkg/api/server_test.go | 2 +- pkg/api/setup_test.go | 2 +- pkg/api/token.go | 4 +- pkg/api/utils_test.go | 2 +- pkg/e2e/test_messagev1.go | 2 +- pkg/logging/logging.go | 2 +- pkg/metrics/api.go | 2 +- pkg/mls/api/v1/mock.gen.go | 10 +- pkg/mls/api/v1/service.go | 2 +- pkg/mls/api/v1/service_test.go | 2 +- pkg/mls/store/store.go | 2 +- pkg/mls/store/store_test.go | 2 +- pkg/mlsvalidate/service.go | 4 +- pkg/mlsvalidate/service_test.go | 2 +- pkg/proto/keystore_api/v1/keystore.pb.go | 3730 +++++++++++++++++ pkg/proto/message_api/v1/authn.pb.go | 278 ++ pkg/proto/message_api/v1/message_api.pb.go | 1122 +++++ pkg/proto/message_api/v1/message_api.pb.gw.go | 425 ++ .../message_api/v1/message_api_grpc.pb.go | 399 ++ pkg/proto/message_contents/ciphertext.pb.go | 454 ++ pkg/proto/message_contents/composite.pb.go | 277 ++ pkg/proto/message_contents/contact.pb.go | 352 ++ pkg/proto/message_contents/content.pb.go | 479 +++ .../conversation_reference.pb.go | 199 + pkg/proto/message_contents/ecies.pb.go | 183 + pkg/proto/message_contents/invitation.pb.go | 651 +++ pkg/proto/message_contents/message.pb.go | 688 +++ pkg/proto/message_contents/private_key.pb.go | 925 ++++ .../private_preferences.pb.go | 439 ++ pkg/proto/message_contents/public_key.pb.go | 699 +++ pkg/proto/message_contents/signature.pb.go | 361 ++ .../message_contents/signed_payload.pb.go | 177 + pkg/proto/mls/api/v1/mls.pb.go | 2844 +++++++++++++ pkg/proto/mls/api/v1/mls.pb.gw.go | 887 ++++ pkg/proto/mls/api/v1/mls_grpc.pb.go | 567 +++ pkg/proto/mls/database/intents.pb.go | 983 +++++ .../mls/message_contents/association.pb.go | 389 ++ pkg/proto/mls/message_contents/content.pb.go | 380 ++ .../mls/message_contents/credential.pb.go | 309 ++ .../mls/message_contents/group_metadata.pb.go | 668 +++ .../transcript_messages.pb.go | 304 ++ pkg/proto/mls_validation/v1/service.pb.go | 735 ++++ .../mls_validation/v1/service_grpc.pb.go | 152 + .../keystore_api/v1/keystore.swagger.json | 44 + .../openapi/message_api/v1/authn.swagger.json | 44 + .../message_api/v1/message_api.swagger.json | 400 ++ .../message_contents/ciphertext.swagger.json | 44 + .../message_contents/composite.swagger.json | 44 + .../message_contents/contact.swagger.json | 44 + .../message_contents/content.swagger.json | 44 + .../conversation_reference.swagger.json | 44 + .../message_contents/ecies.swagger.json | 44 + .../message_contents/invitation.swagger.json | 44 + .../message_contents/message.swagger.json | 44 + .../message_contents/private_key.swagger.json | 44 + .../private_preferences.swagger.json | 44 + .../message_contents/public_key.swagger.json | 44 + .../message_contents/signature.swagger.json | 44 + .../signed_payload.swagger.json | 44 + pkg/proto/openapi/mls/api/v1/mls.swagger.json | 925 ++++ .../openapi/mls/database/intents.swagger.json | 44 + .../message_contents/association.swagger.json | 44 + .../mls/message_contents/content.swagger.json | 44 + .../message_contents/credential.swagger.json | 44 + .../group_metadata.swagger.json | 44 + .../transcript_messages.swagger.json | 44 + .../mls_validation/v1/service.swagger.json | 137 + pkg/proto/openapi/openapi.go | 8 + pkg/store/cleaner_test.go | 2 +- pkg/store/query.go | 2 +- pkg/store/query_test.go | 2 +- pkg/store/store.go | 2 +- pkg/store/store_test.go | 2 +- pkg/testing/message.go | 2 +- 87 files changed, 22523 insertions(+), 41 deletions(-) create mode 100644 buf.gen.yaml create mode 100644 pkg/proto/keystore_api/v1/keystore.pb.go create mode 100644 pkg/proto/message_api/v1/authn.pb.go create mode 100644 pkg/proto/message_api/v1/message_api.pb.go create mode 100644 pkg/proto/message_api/v1/message_api.pb.gw.go create mode 100644 pkg/proto/message_api/v1/message_api_grpc.pb.go create mode 100644 pkg/proto/message_contents/ciphertext.pb.go create mode 100644 pkg/proto/message_contents/composite.pb.go create mode 100644 pkg/proto/message_contents/contact.pb.go create mode 100644 pkg/proto/message_contents/content.pb.go create mode 100644 pkg/proto/message_contents/conversation_reference.pb.go create mode 100644 pkg/proto/message_contents/ecies.pb.go create mode 100644 pkg/proto/message_contents/invitation.pb.go create mode 100644 pkg/proto/message_contents/message.pb.go create mode 100644 pkg/proto/message_contents/private_key.pb.go create mode 100644 pkg/proto/message_contents/private_preferences.pb.go create mode 100644 pkg/proto/message_contents/public_key.pb.go create mode 100644 pkg/proto/message_contents/signature.pb.go create mode 100644 pkg/proto/message_contents/signed_payload.pb.go create mode 100644 pkg/proto/mls/api/v1/mls.pb.go create mode 100644 pkg/proto/mls/api/v1/mls.pb.gw.go create mode 100644 pkg/proto/mls/api/v1/mls_grpc.pb.go create mode 100644 pkg/proto/mls/database/intents.pb.go create mode 100644 pkg/proto/mls/message_contents/association.pb.go create mode 100644 pkg/proto/mls/message_contents/content.pb.go create mode 100644 pkg/proto/mls/message_contents/credential.pb.go create mode 100644 pkg/proto/mls/message_contents/group_metadata.pb.go create mode 100644 pkg/proto/mls/message_contents/transcript_messages.pb.go create mode 100644 pkg/proto/mls_validation/v1/service.pb.go create mode 100644 pkg/proto/mls_validation/v1/service_grpc.pb.go create mode 100644 pkg/proto/openapi/keystore_api/v1/keystore.swagger.json create mode 100644 pkg/proto/openapi/message_api/v1/authn.swagger.json create mode 100644 pkg/proto/openapi/message_api/v1/message_api.swagger.json create mode 100644 pkg/proto/openapi/message_contents/ciphertext.swagger.json create mode 100644 pkg/proto/openapi/message_contents/composite.swagger.json create mode 100644 pkg/proto/openapi/message_contents/contact.swagger.json create mode 100644 pkg/proto/openapi/message_contents/content.swagger.json create mode 100644 pkg/proto/openapi/message_contents/conversation_reference.swagger.json create mode 100644 pkg/proto/openapi/message_contents/ecies.swagger.json create mode 100644 pkg/proto/openapi/message_contents/invitation.swagger.json create mode 100644 pkg/proto/openapi/message_contents/message.swagger.json create mode 100644 pkg/proto/openapi/message_contents/private_key.swagger.json create mode 100644 pkg/proto/openapi/message_contents/private_preferences.swagger.json create mode 100644 pkg/proto/openapi/message_contents/public_key.swagger.json create mode 100644 pkg/proto/openapi/message_contents/signature.swagger.json create mode 100644 pkg/proto/openapi/message_contents/signed_payload.swagger.json create mode 100644 pkg/proto/openapi/mls/api/v1/mls.swagger.json create mode 100644 pkg/proto/openapi/mls/database/intents.swagger.json create mode 100644 pkg/proto/openapi/mls/message_contents/association.swagger.json create mode 100644 pkg/proto/openapi/mls/message_contents/content.swagger.json create mode 100644 pkg/proto/openapi/mls/message_contents/credential.swagger.json create mode 100644 pkg/proto/openapi/mls/message_contents/group_metadata.swagger.json create mode 100644 pkg/proto/openapi/mls/message_contents/transcript_messages.swagger.json create mode 100644 pkg/proto/openapi/mls_validation/v1/service.swagger.json create mode 100644 pkg/proto/openapi/openapi.go diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 00000000..b963df66 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,28 @@ +# buf.gen.yaml +version: v1 +managed: + enabled: true + go_package_prefix: + # : name in go.mod + # : where generated code should be output + default: github.com/xmtp/xmtp-node-go/pkg/proto + # Remove `except` field if googleapis is not used + except: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway +plugins: + - plugin: buf.build/grpc-ecosystem/gateway:v2.19.0 + out: pkg/proto + opt: + - paths=source_relative + - plugin: buf.build/grpc/go:v1.3.0 + out: pkg/proto + opt: + - paths=source_relative + # dependencies + - plugin: buf.build/protocolbuffers/go + out: pkg/proto + opt: + - paths=source_relative + - plugin: buf.build/grpc-ecosystem/openapiv2:v2.19.0 + out: pkg/proto/openapi diff --git a/dev/generate b/dev/generate index 871f9e74..77fc43eb 100755 --- a/dev/generate +++ b/dev/generate @@ -3,4 +3,9 @@ set -e go generate ./... -mockgen -package api github.com/xmtp/proto/v3/go/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer > pkg/mls/api/v1/mock.gen.go +mockgen -package api github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer > pkg/mls/api/v1/mock.gen.go +rm -rf pkg/proto/**/*.pb.go pkg/proto/**/*.pb.gw.go pkg/proto/**/*.swagger.json +if ! buf generate https://github.com/xmtp/proto.git#branch=main,subdir=proto; then + echo "Failed to generate protobuf definitions" + exit 1 +fi \ No newline at end of file diff --git a/go.mod b/go.mod index 3079b0da..faead68f 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,6 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.16 github.com/waku-org/go-waku v0.8.0 github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 - github.com/xmtp/proto/v3 v3.37.1-0.20240112125235-f02fe8d0f1a0 github.com/yoheimuta/protolint v0.39.0 go.uber.org/mock v0.4.0 go.uber.org/zap v1.24.0 diff --git a/pkg/api/authentication.go b/pkg/api/authentication.go index ee12d402..cb07aa24 100644 --- a/pkg/api/authentication.go +++ b/pkg/api/authentication.go @@ -7,9 +7,9 @@ import ( "fmt" "time" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" - envelope "github.com/xmtp/proto/v3/go/message_contents" "github.com/xmtp/xmtp-node-go/pkg/crypto" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" + envelope "github.com/xmtp/xmtp-node-go/pkg/proto/message_contents" "github.com/xmtp/xmtp-node-go/pkg/types" "go.uber.org/zap" "google.golang.org/protobuf/proto" diff --git a/pkg/api/authentication_test.go b/pkg/api/authentication_test.go index dd3f04c8..46447578 100644 --- a/pkg/api/authentication_test.go +++ b/pkg/api/authentication_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/stretchr/testify/require" - messageV1 "github.com/xmtp/proto/v3/go/message_api/v1" messageclient "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/client" + messageV1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" ) func Test_AuthnNoToken(t *testing.T) { diff --git a/pkg/api/interceptor.go b/pkg/api/interceptor.go index 7b6c32c6..88af2697 100644 --- a/pkg/api/interceptor.go +++ b/pkg/api/interceptor.go @@ -11,8 +11,8 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/logging" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" "github.com/xmtp/xmtp-node-go/pkg/types" ) diff --git a/pkg/api/message/v1/client/grpc_client.go b/pkg/api/message/v1/client/grpc_client.go index 2c8ff539..016031c2 100644 --- a/pkg/api/message/v1/client/grpc_client.go +++ b/pkg/api/message/v1/client/grpc_client.go @@ -3,7 +3,7 @@ package client import ( "context" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "google.golang.org/grpc" ) diff --git a/pkg/api/message/v1/client/grpc_stream.go b/pkg/api/message/v1/client/grpc_stream.go index a07d6950..238f9454 100644 --- a/pkg/api/message/v1/client/grpc_stream.go +++ b/pkg/api/message/v1/client/grpc_stream.go @@ -5,7 +5,7 @@ import ( "errors" "io" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/pkg/api/message/v1/client/http_client.go b/pkg/api/message/v1/client/http_client.go index 10b93b4d..1ba520cd 100644 --- a/pkg/api/message/v1/client/http_client.go +++ b/pkg/api/message/v1/client/http_client.go @@ -10,7 +10,7 @@ import ( "net/http" "github.com/hashicorp/go-retryablehttp" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "go.uber.org/zap" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/encoding/protojson" diff --git a/pkg/api/message/v1/client/http_stream.go b/pkg/api/message/v1/client/http_stream.go index 0948b0c2..87843c2c 100644 --- a/pkg/api/message/v1/client/http_stream.go +++ b/pkg/api/message/v1/client/http_stream.go @@ -8,7 +8,7 @@ import ( "io" "net/http" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "go.uber.org/zap" "google.golang.org/protobuf/encoding/protojson" ) diff --git a/pkg/api/message/v1/client/interface.go b/pkg/api/message/v1/client/interface.go index c9c609e5..215daf55 100644 --- a/pkg/api/message/v1/client/interface.go +++ b/pkg/api/message/v1/client/interface.go @@ -3,7 +3,7 @@ package client import ( "context" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" ) type Client interface { diff --git a/pkg/api/message/v1/service.go b/pkg/api/message/v1/service.go index 984a36a7..4967d804 100644 --- a/pkg/api/message/v1/service.go +++ b/pkg/api/message/v1/service.go @@ -14,10 +14,10 @@ import ( "github.com/nats-io/nats.go" "github.com/pkg/errors" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" - proto "github.com/xmtp/proto/v3/go/message_api/v1" apicontext "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/context" "github.com/xmtp/xmtp-node-go/pkg/logging" "github.com/xmtp/xmtp-node-go/pkg/metrics" + proto "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/store" "github.com/xmtp/xmtp-node-go/pkg/topic" "go.uber.org/zap" diff --git a/pkg/api/server.go b/pkg/api/server.go index ea9fabf7..267804a2 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -16,9 +16,9 @@ import ( swgui "github.com/swaggest/swgui/v3" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" wakurelay "github.com/waku-org/go-waku/waku/v2/protocol/relay" - proto "github.com/xmtp/proto/v3/go/message_api/v1" - mlsv1pb "github.com/xmtp/proto/v3/go/mls/api/v1" - messagev1openapi "github.com/xmtp/proto/v3/openapi/message_api/v1" + proto "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" + mlsv1pb "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" + messagev1openapi "github.com/xmtp/xmtp-node-go/pkg/proto/openapi" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" "github.com/xmtp/xmtp-node-go/pkg/topic" "github.com/xmtp/xmtp-node-go/pkg/tracing" diff --git a/pkg/api/server_test.go b/pkg/api/server_test.go index df65d0b2..5273ce1e 100644 --- a/pkg/api/server_test.go +++ b/pkg/api/server_test.go @@ -11,9 +11,9 @@ import ( "time" "github.com/stretchr/testify/require" - messageV1 "github.com/xmtp/proto/v3/go/message_api/v1" messagev1api "github.com/xmtp/xmtp-node-go/pkg/api/message/v1" messageclient "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/client" + messageV1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/ratelimiter" test "github.com/xmtp/xmtp-node-go/pkg/testing" "google.golang.org/grpc/codes" diff --git a/pkg/api/setup_test.go b/pkg/api/setup_test.go index 3d73f231..806f9c1d 100644 --- a/pkg/api/setup_test.go +++ b/pkg/api/setup_test.go @@ -6,9 +6,9 @@ import ( "time" "github.com/stretchr/testify/require" - v1 "github.com/xmtp/proto/v3/go/message_api/v1" messageclient "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/client" "github.com/xmtp/xmtp-node-go/pkg/authz" + v1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/store" test "github.com/xmtp/xmtp-node-go/pkg/testing" "go.uber.org/zap" diff --git a/pkg/api/token.go b/pkg/api/token.go index 6f2f9ed5..a6bcb03c 100644 --- a/pkg/api/token.go +++ b/pkg/api/token.go @@ -6,9 +6,9 @@ import ( "time" ethcrypto "github.com/ethereum/go-ethereum/crypto" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" - envelope "github.com/xmtp/proto/v3/go/message_contents" "github.com/xmtp/xmtp-node-go/pkg/crypto" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" + envelope "github.com/xmtp/xmtp-node-go/pkg/proto/message_contents" "google.golang.org/protobuf/proto" ) diff --git a/pkg/api/utils_test.go b/pkg/api/utils_test.go index 5c708145..3cc3f9ad 100644 --- a/pkg/api/utils_test.go +++ b/pkg/api/utils_test.go @@ -9,8 +9,8 @@ import ( "time" "github.com/stretchr/testify/require" - messageV1 "github.com/xmtp/proto/v3/go/message_api/v1" messageclient "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/client" + messageV1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" ) func makeEnvelopes(count int) (envs []*messageV1.Envelope) { diff --git a/pkg/e2e/test_messagev1.go b/pkg/e2e/test_messagev1.go index 25df308f..3fb71cc0 100644 --- a/pkg/e2e/test_messagev1.go +++ b/pkg/e2e/test_messagev1.go @@ -11,8 +11,8 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" messageclient "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/client" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "go.uber.org/zap" "google.golang.org/protobuf/proto" ) diff --git a/pkg/logging/logging.go b/pkg/logging/logging.go index d9b7a076..e5df3e7d 100644 --- a/pkg/logging/logging.go +++ b/pkg/logging/logging.go @@ -10,7 +10,7 @@ import ( "fmt" "github.com/waku-org/go-waku/logging" - proto "github.com/xmtp/proto/v3/go/message_api/v1" + proto "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/types" "go.uber.org/zap" "go.uber.org/zap/zapcore" diff --git a/pkg/metrics/api.go b/pkg/metrics/api.go index ca9907f0..72a78636 100644 --- a/pkg/metrics/api.go +++ b/pkg/metrics/api.go @@ -5,9 +5,9 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" - proto "github.com/xmtp/proto/v3/go/message_api/v1" apicontext "github.com/xmtp/xmtp-node-go/pkg/api/message/v1/context" "github.com/xmtp/xmtp-node-go/pkg/logging" + proto "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/topic" "go.uber.org/zap" "go.uber.org/zap/zapcore" diff --git a/pkg/mls/api/v1/mock.gen.go b/pkg/mls/api/v1/mock.gen.go index 846dbf10..3c23a6ef 100644 --- a/pkg/mls/api/v1/mock.gen.go +++ b/pkg/mls/api/v1/mock.gen.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xmtp/proto/v3/go/mls/api/v1 (interfaces: MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer) +// Source: github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1 (interfaces: MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer) // // Generated by this command: // -// mockgen -package api github.com/xmtp/proto/v3/go/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer +// mockgen -package api github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer // // Package api is a generated GoMock package. @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - v1 "github.com/xmtp/proto/v3/go/mls/api/v1" + apiv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" gomock "go.uber.org/mock/gomock" metadata "google.golang.org/grpc/metadata" ) @@ -70,7 +70,7 @@ func (mr *MockMlsApi_SubscribeGroupMessagesServerMockRecorder) RecvMsg(arg0 any) } // Send mocks base method. -func (m *MockMlsApi_SubscribeGroupMessagesServer) Send(arg0 *v1.GroupMessage) error { +func (m *MockMlsApi_SubscribeGroupMessagesServer) Send(arg0 *apiv1.GroupMessage) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Send", arg0) ret0, _ := ret[0].(error) @@ -189,7 +189,7 @@ func (mr *MockMlsApi_SubscribeWelcomeMessagesServerMockRecorder) RecvMsg(arg0 an } // Send mocks base method. -func (m *MockMlsApi_SubscribeWelcomeMessagesServer) Send(arg0 *v1.WelcomeMessage) error { +func (m *MockMlsApi_SubscribeWelcomeMessagesServer) Send(arg0 *apiv1.WelcomeMessage) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Send", arg0) ret0, _ := ret[0].(error) diff --git a/pkg/mls/api/v1/service.go b/pkg/mls/api/v1/service.go index 7695cb88..348c149c 100644 --- a/pkg/mls/api/v1/service.go +++ b/pkg/mls/api/v1/service.go @@ -12,9 +12,9 @@ import ( "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" - mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" + mlsv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" "github.com/xmtp/xmtp-node-go/pkg/topic" "go.uber.org/zap" "google.golang.org/grpc/codes" diff --git a/pkg/mls/api/v1/service_test.go b/pkg/mls/api/v1/service_test.go index d725318b..a13495ca 100644 --- a/pkg/mls/api/v1/service_test.go +++ b/pkg/mls/api/v1/service_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/require" "github.com/uptrace/bun" wakupb "github.com/waku-org/go-waku/waku/v2/protocol/pb" - mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store" "github.com/xmtp/xmtp-node-go/pkg/mlsvalidate" + mlsv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" test "github.com/xmtp/xmtp-node-go/pkg/testing" "github.com/xmtp/xmtp-node-go/pkg/topic" "go.uber.org/mock/gomock" diff --git a/pkg/mls/store/store.go b/pkg/mls/store/store.go index 8e64318b..34d48207 100644 --- a/pkg/mls/store/store.go +++ b/pkg/mls/store/store.go @@ -10,8 +10,8 @@ import ( "github.com/uptrace/bun" "github.com/uptrace/bun/migrate" - mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" migrations "github.com/xmtp/xmtp-node-go/pkg/migrations/mls" + mlsv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" "go.uber.org/zap" ) diff --git a/pkg/mls/store/store_test.go b/pkg/mls/store/store_test.go index 569b09c0..9f196110 100644 --- a/pkg/mls/store/store_test.go +++ b/pkg/mls/store/store_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/stretchr/testify/require" - mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" + mlsv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" test "github.com/xmtp/xmtp-node-go/pkg/testing" ) diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go index ed9f5b11..a950d159 100644 --- a/pkg/mlsvalidate/service.go +++ b/pkg/mlsvalidate/service.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - mlsv1 "github.com/xmtp/proto/v3/go/mls/api/v1" - svc "github.com/xmtp/proto/v3/go/mls_validation/v1" + mlsv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1" + svc "github.com/xmtp/xmtp-node-go/pkg/proto/mls_validation/v1" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) diff --git a/pkg/mlsvalidate/service_test.go b/pkg/mlsvalidate/service_test.go index 6e0a7332..01857927 100644 --- a/pkg/mlsvalidate/service_test.go +++ b/pkg/mlsvalidate/service_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - svc "github.com/xmtp/proto/v3/go/mls_validation/v1" + svc "github.com/xmtp/xmtp-node-go/pkg/proto/mls_validation/v1" "google.golang.org/grpc" ) diff --git a/pkg/proto/keystore_api/v1/keystore.pb.go b/pkg/proto/keystore_api/v1/keystore.pb.go new file mode 100644 index 00000000..ea798049 --- /dev/null +++ b/pkg/proto/keystore_api/v1/keystore.pb.go @@ -0,0 +1,3730 @@ +// Message content encoding structures + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: keystore_api/v1/keystore.proto + +package keystore_apiv1 + +import ( + message_contents "github.com/xmtp/xmtp-node-go/pkg/proto/message_contents" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Application-specific error codes for the Keystore API. +type ErrorCode int32 + +const ( + ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0 + ErrorCode_ERROR_CODE_INVALID_INPUT ErrorCode = 1 + ErrorCode_ERROR_CODE_NO_MATCHING_PREKEY ErrorCode = 2 +) + +// Enum value maps for ErrorCode. +var ( + ErrorCode_name = map[int32]string{ + 0: "ERROR_CODE_UNSPECIFIED", + 1: "ERROR_CODE_INVALID_INPUT", + 2: "ERROR_CODE_NO_MATCHING_PREKEY", + } + ErrorCode_value = map[string]int32{ + "ERROR_CODE_UNSPECIFIED": 0, + "ERROR_CODE_INVALID_INPUT": 1, + "ERROR_CODE_NO_MATCHING_PREKEY": 2, + } +) + +func (x ErrorCode) Enum() *ErrorCode { + p := new(ErrorCode) + *p = x + return p +} + +func (x ErrorCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ErrorCode) Descriptor() protoreflect.EnumDescriptor { + return file_keystore_api_v1_keystore_proto_enumTypes[0].Descriptor() +} + +func (ErrorCode) Type() protoreflect.EnumType { + return &file_keystore_api_v1_keystore_proto_enumTypes[0] +} + +func (x ErrorCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ErrorCode.Descriptor instead. +func (ErrorCode) EnumDescriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{0} +} + +// JobType is used to specify the type of job the caller would like info on +type JobType int32 + +const ( + JobType_JOB_TYPE_UNSPECIFIED JobType = 0 + JobType_JOB_TYPE_REFRESH_V1 JobType = 1 + JobType_JOB_TYPE_REFRESH_V2 JobType = 2 + JobType_JOB_TYPE_REFRESH_PPPP JobType = 3 +) + +// Enum value maps for JobType. +var ( + JobType_name = map[int32]string{ + 0: "JOB_TYPE_UNSPECIFIED", + 1: "JOB_TYPE_REFRESH_V1", + 2: "JOB_TYPE_REFRESH_V2", + 3: "JOB_TYPE_REFRESH_PPPP", + } + JobType_value = map[string]int32{ + "JOB_TYPE_UNSPECIFIED": 0, + "JOB_TYPE_REFRESH_V1": 1, + "JOB_TYPE_REFRESH_V2": 2, + "JOB_TYPE_REFRESH_PPPP": 3, + } +) + +func (x JobType) Enum() *JobType { + p := new(JobType) + *p = x + return p +} + +func (x JobType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (JobType) Descriptor() protoreflect.EnumDescriptor { + return file_keystore_api_v1_keystore_proto_enumTypes[1].Descriptor() +} + +func (JobType) Type() protoreflect.EnumType { + return &file_keystore_api_v1_keystore_proto_enumTypes[1] +} + +func (x JobType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use JobType.Descriptor instead. +func (JobType) EnumDescriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{1} +} + +// Status of the Keystore for the specified wallet address +type GetKeystoreStatusResponse_KeystoreStatus int32 + +const ( + GetKeystoreStatusResponse_KEYSTORE_STATUS_UNSPECIFIED GetKeystoreStatusResponse_KeystoreStatus = 0 + GetKeystoreStatusResponse_KEYSTORE_STATUS_UNINITIALIZED GetKeystoreStatusResponse_KeystoreStatus = 1 + GetKeystoreStatusResponse_KEYSTORE_STATUS_INITIALIZED GetKeystoreStatusResponse_KeystoreStatus = 2 +) + +// Enum value maps for GetKeystoreStatusResponse_KeystoreStatus. +var ( + GetKeystoreStatusResponse_KeystoreStatus_name = map[int32]string{ + 0: "KEYSTORE_STATUS_UNSPECIFIED", + 1: "KEYSTORE_STATUS_UNINITIALIZED", + 2: "KEYSTORE_STATUS_INITIALIZED", + } + GetKeystoreStatusResponse_KeystoreStatus_value = map[string]int32{ + "KEYSTORE_STATUS_UNSPECIFIED": 0, + "KEYSTORE_STATUS_UNINITIALIZED": 1, + "KEYSTORE_STATUS_INITIALIZED": 2, + } +) + +func (x GetKeystoreStatusResponse_KeystoreStatus) Enum() *GetKeystoreStatusResponse_KeystoreStatus { + p := new(GetKeystoreStatusResponse_KeystoreStatus) + *p = x + return p +} + +func (x GetKeystoreStatusResponse_KeystoreStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GetKeystoreStatusResponse_KeystoreStatus) Descriptor() protoreflect.EnumDescriptor { + return file_keystore_api_v1_keystore_proto_enumTypes[2].Descriptor() +} + +func (GetKeystoreStatusResponse_KeystoreStatus) Type() protoreflect.EnumType { + return &file_keystore_api_v1_keystore_proto_enumTypes[2] +} + +func (x GetKeystoreStatusResponse_KeystoreStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GetKeystoreStatusResponse_KeystoreStatus.Descriptor instead. +func (GetKeystoreStatusResponse_KeystoreStatus) EnumDescriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{20, 0} +} + +// Wrapper class for errors from the Keystore API +type KeystoreError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Code ErrorCode `protobuf:"varint,2,opt,name=code,proto3,enum=xmtp.keystore_api.v1.ErrorCode" json:"code,omitempty"` +} + +func (x *KeystoreError) Reset() { + *x = KeystoreError{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeystoreError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeystoreError) ProtoMessage() {} + +func (x *KeystoreError) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeystoreError.ProtoReflect.Descriptor instead. +func (*KeystoreError) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{0} +} + +func (x *KeystoreError) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *KeystoreError) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_ERROR_CODE_UNSPECIFIED +} + +// Decrypt a batch of messages using X3DH key agreement +type DecryptV1Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*DecryptV1Request_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *DecryptV1Request) Reset() { + *x = DecryptV1Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptV1Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptV1Request) ProtoMessage() {} + +func (x *DecryptV1Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptV1Request.ProtoReflect.Descriptor instead. +func (*DecryptV1Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{1} +} + +func (x *DecryptV1Request) GetRequests() []*DecryptV1Request_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Response type for both V1 and V2 decryption requests +type DecryptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*DecryptResponse_Response `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *DecryptResponse) Reset() { + *x = DecryptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptResponse) ProtoMessage() {} + +func (x *DecryptResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptResponse.ProtoReflect.Descriptor instead. +func (*DecryptResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{2} +} + +func (x *DecryptResponse) GetResponses() []*DecryptResponse_Response { + if x != nil { + return x.Responses + } + return nil +} + +// Decrypt a batch of messages using the appropriate topic keys +type DecryptV2Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*DecryptV2Request_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *DecryptV2Request) Reset() { + *x = DecryptV2Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptV2Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptV2Request) ProtoMessage() {} + +func (x *DecryptV2Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptV2Request.ProtoReflect.Descriptor instead. +func (*DecryptV2Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{3} +} + +func (x *DecryptV2Request) GetRequests() []*DecryptV2Request_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Encrypt a batch of messages using X3DH key agreement +type EncryptV1Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*EncryptV1Request_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *EncryptV1Request) Reset() { + *x = EncryptV1Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptV1Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptV1Request) ProtoMessage() {} + +func (x *EncryptV1Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptV1Request.ProtoReflect.Descriptor instead. +func (*EncryptV1Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{4} +} + +func (x *EncryptV1Request) GetRequests() []*EncryptV1Request_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Response type for both V1 and V2 encryption requests +type EncryptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*EncryptResponse_Response `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *EncryptResponse) Reset() { + *x = EncryptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptResponse) ProtoMessage() {} + +func (x *EncryptResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptResponse.ProtoReflect.Descriptor instead. +func (*EncryptResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{5} +} + +func (x *EncryptResponse) GetResponses() []*EncryptResponse_Response { + if x != nil { + return x.Responses + } + return nil +} + +// Encrypt a batch of messages using the appropriate topic keys +type EncryptV2Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*EncryptV2Request_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *EncryptV2Request) Reset() { + *x = EncryptV2Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptV2Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptV2Request) ProtoMessage() {} + +func (x *EncryptV2Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptV2Request.ProtoReflect.Descriptor instead. +func (*EncryptV2Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{6} +} + +func (x *EncryptV2Request) GetRequests() []*EncryptV2Request_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Encrypt a message for yourself +type SelfEncryptRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*SelfEncryptRequest_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *SelfEncryptRequest) Reset() { + *x = SelfEncryptRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfEncryptRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfEncryptRequest) ProtoMessage() {} + +func (x *SelfEncryptRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfEncryptRequest.ProtoReflect.Descriptor instead. +func (*SelfEncryptRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{7} +} + +func (x *SelfEncryptRequest) GetRequests() []*SelfEncryptRequest_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Response type for SelfEncryptRequest +type SelfEncryptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*SelfEncryptResponse_Response `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *SelfEncryptResponse) Reset() { + *x = SelfEncryptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfEncryptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfEncryptResponse) ProtoMessage() {} + +func (x *SelfEncryptResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfEncryptResponse.ProtoReflect.Descriptor instead. +func (*SelfEncryptResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{8} +} + +func (x *SelfEncryptResponse) GetResponses() []*SelfEncryptResponse_Response { + if x != nil { + return x.Responses + } + return nil +} + +// SelfDecryptRequest +type SelfDecryptRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*SelfDecryptRequest_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *SelfDecryptRequest) Reset() { + *x = SelfDecryptRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfDecryptRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfDecryptRequest) ProtoMessage() {} + +func (x *SelfDecryptRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfDecryptRequest.ProtoReflect.Descriptor instead. +func (*SelfDecryptRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{9} +} + +func (x *SelfDecryptRequest) GetRequests() []*SelfDecryptRequest_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Get the private preferences topic identifier +type GetPrivatePreferencesTopicIdentifierResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (x *GetPrivatePreferencesTopicIdentifierResponse) Reset() { + *x = GetPrivatePreferencesTopicIdentifierResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPrivatePreferencesTopicIdentifierResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPrivatePreferencesTopicIdentifierResponse) ProtoMessage() {} + +func (x *GetPrivatePreferencesTopicIdentifierResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPrivatePreferencesTopicIdentifierResponse.ProtoReflect.Descriptor instead. +func (*GetPrivatePreferencesTopicIdentifierResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{10} +} + +func (x *GetPrivatePreferencesTopicIdentifierResponse) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +// Request to create an invite payload, and store the topic keys in the Keystore +type CreateInviteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Context *message_contents.InvitationV1_Context `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"` + Recipient *message_contents.SignedPublicKeyBundle `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + CreatedNs uint64 `protobuf:"varint,3,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` +} + +func (x *CreateInviteRequest) Reset() { + *x = CreateInviteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInviteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInviteRequest) ProtoMessage() {} + +func (x *CreateInviteRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInviteRequest.ProtoReflect.Descriptor instead. +func (*CreateInviteRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{11} +} + +func (x *CreateInviteRequest) GetContext() *message_contents.InvitationV1_Context { + if x != nil { + return x.Context + } + return nil +} + +func (x *CreateInviteRequest) GetRecipient() *message_contents.SignedPublicKeyBundle { + if x != nil { + return x.Recipient + } + return nil +} + +func (x *CreateInviteRequest) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +// Response to a CreateInviteRequest +type CreateInviteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Conversation *message_contents.ConversationReference `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *CreateInviteResponse) Reset() { + *x = CreateInviteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInviteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInviteResponse) ProtoMessage() {} + +func (x *CreateInviteResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInviteResponse.ProtoReflect.Descriptor instead. +func (*CreateInviteResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{12} +} + +func (x *CreateInviteResponse) GetConversation() *message_contents.ConversationReference { + if x != nil { + return x.Conversation + } + return nil +} + +func (x *CreateInviteResponse) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// Request to save a batch of invite messages to the Keystore +type SaveInvitesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*SaveInvitesRequest_Request `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *SaveInvitesRequest) Reset() { + *x = SaveInvitesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveInvitesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveInvitesRequest) ProtoMessage() {} + +func (x *SaveInvitesRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveInvitesRequest.ProtoReflect.Descriptor instead. +func (*SaveInvitesRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{13} +} + +func (x *SaveInvitesRequest) GetRequests() []*SaveInvitesRequest_Request { + if x != nil { + return x.Requests + } + return nil +} + +// Response to a SaveInvitesRequest +type SaveInvitesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*SaveInvitesResponse_Response `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *SaveInvitesResponse) Reset() { + *x = SaveInvitesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveInvitesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveInvitesResponse) ProtoMessage() {} + +func (x *SaveInvitesResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveInvitesResponse.ProtoReflect.Descriptor instead. +func (*SaveInvitesResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{14} +} + +func (x *SaveInvitesResponse) GetResponses() []*SaveInvitesResponse_Response { + if x != nil { + return x.Responses + } + return nil +} + +// CreateAuthTokenRequest is used to create an auth token for the XMTP API +type CreateAuthTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimestampNs *uint64 `protobuf:"varint,1,opt,name=timestamp_ns,json=timestampNs,proto3,oneof" json:"timestamp_ns,omitempty"` +} + +func (x *CreateAuthTokenRequest) Reset() { + *x = CreateAuthTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAuthTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAuthTokenRequest) ProtoMessage() {} + +func (x *CreateAuthTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAuthTokenRequest.ProtoReflect.Descriptor instead. +func (*CreateAuthTokenRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{15} +} + +func (x *CreateAuthTokenRequest) GetTimestampNs() uint64 { + if x != nil && x.TimestampNs != nil { + return *x.TimestampNs + } + return 0 +} + +// SaveV1ConversationsRequest is used to save a batch of conversations to the +// built in persistence +type SaveV1ConversationsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Conversations []*message_contents.ConversationReference `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations,omitempty"` +} + +func (x *SaveV1ConversationsRequest) Reset() { + *x = SaveV1ConversationsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveV1ConversationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveV1ConversationsRequest) ProtoMessage() {} + +func (x *SaveV1ConversationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveV1ConversationsRequest.ProtoReflect.Descriptor instead. +func (*SaveV1ConversationsRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{16} +} + +func (x *SaveV1ConversationsRequest) GetConversations() []*message_contents.ConversationReference { + if x != nil { + return x.Conversations + } + return nil +} + +// Placeholder response type for SaveV1Conversations +type SaveV1ConversationsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SaveV1ConversationsResponse) Reset() { + *x = SaveV1ConversationsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveV1ConversationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveV1ConversationsResponse) ProtoMessage() {} + +func (x *SaveV1ConversationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveV1ConversationsResponse.ProtoReflect.Descriptor instead. +func (*SaveV1ConversationsResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{17} +} + +// Response for GetV2Conversations +type GetConversationsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Conversations []*message_contents.ConversationReference `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations,omitempty"` +} + +func (x *GetConversationsResponse) Reset() { + *x = GetConversationsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConversationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConversationsResponse) ProtoMessage() {} + +func (x *GetConversationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetConversationsResponse.ProtoReflect.Descriptor instead. +func (*GetConversationsResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{18} +} + +func (x *GetConversationsResponse) GetConversations() []*message_contents.ConversationReference { + if x != nil { + return x.Conversations + } + return nil +} + +// Used to check if the Keystore implementation has been setup for the given +// wallet address Only used for MM Snap Keystore currently +type GetKeystoreStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"` +} + +func (x *GetKeystoreStatusRequest) Reset() { + *x = GetKeystoreStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetKeystoreStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKeystoreStatusRequest) ProtoMessage() {} + +func (x *GetKeystoreStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetKeystoreStatusRequest.ProtoReflect.Descriptor instead. +func (*GetKeystoreStatusRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{19} +} + +func (x *GetKeystoreStatusRequest) GetWalletAddress() string { + if x != nil { + return x.WalletAddress + } + return "" +} + +// Response to GetKeystoreStatusRequest +type GetKeystoreStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status GetKeystoreStatusResponse_KeystoreStatus `protobuf:"varint,1,opt,name=status,proto3,enum=xmtp.keystore_api.v1.GetKeystoreStatusResponse_KeystoreStatus" json:"status,omitempty"` +} + +func (x *GetKeystoreStatusResponse) Reset() { + *x = GetKeystoreStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetKeystoreStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKeystoreStatusResponse) ProtoMessage() {} + +func (x *GetKeystoreStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetKeystoreStatusResponse.ProtoReflect.Descriptor instead. +func (*GetKeystoreStatusResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{20} +} + +func (x *GetKeystoreStatusResponse) GetStatus() GetKeystoreStatusResponse_KeystoreStatus { + if x != nil { + return x.Status + } + return GetKeystoreStatusResponse_KEYSTORE_STATUS_UNSPECIFIED +} + +// Used to initialize the Keystore with a private key bundle retrieved from the +// client +type InitKeystoreRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Bundle: + // + // *InitKeystoreRequest_V1 + Bundle isInitKeystoreRequest_Bundle `protobuf_oneof:"bundle"` +} + +func (x *InitKeystoreRequest) Reset() { + *x = InitKeystoreRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitKeystoreRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitKeystoreRequest) ProtoMessage() {} + +func (x *InitKeystoreRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitKeystoreRequest.ProtoReflect.Descriptor instead. +func (*InitKeystoreRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{21} +} + +func (m *InitKeystoreRequest) GetBundle() isInitKeystoreRequest_Bundle { + if m != nil { + return m.Bundle + } + return nil +} + +func (x *InitKeystoreRequest) GetV1() *message_contents.PrivateKeyBundleV1 { + if x, ok := x.GetBundle().(*InitKeystoreRequest_V1); ok { + return x.V1 + } + return nil +} + +type isInitKeystoreRequest_Bundle interface { + isInitKeystoreRequest_Bundle() +} + +type InitKeystoreRequest_V1 struct { + V1 *message_contents.PrivateKeyBundleV1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*InitKeystoreRequest_V1) isInitKeystoreRequest_Bundle() {} + +// Response to the request to initialize the Keystore +type InitKeystoreResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error *KeystoreError `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *InitKeystoreResponse) Reset() { + *x = InitKeystoreResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitKeystoreResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitKeystoreResponse) ProtoMessage() {} + +func (x *InitKeystoreResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitKeystoreResponse.ProtoReflect.Descriptor instead. +func (*InitKeystoreResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{22} +} + +func (x *InitKeystoreResponse) GetError() *KeystoreError { + if x != nil { + return x.Error + } + return nil +} + +// SignDigestRequest is used to sign a digest with either the identity key +// or a prekey +type SignDigestRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + // Types that are assignable to Signer: + // + // *SignDigestRequest_IdentityKey + // *SignDigestRequest_PrekeyIndex + Signer isSignDigestRequest_Signer `protobuf_oneof:"signer"` +} + +func (x *SignDigestRequest) Reset() { + *x = SignDigestRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignDigestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignDigestRequest) ProtoMessage() {} + +func (x *SignDigestRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignDigestRequest.ProtoReflect.Descriptor instead. +func (*SignDigestRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{23} +} + +func (x *SignDigestRequest) GetDigest() []byte { + if x != nil { + return x.Digest + } + return nil +} + +func (m *SignDigestRequest) GetSigner() isSignDigestRequest_Signer { + if m != nil { + return m.Signer + } + return nil +} + +func (x *SignDigestRequest) GetIdentityKey() bool { + if x, ok := x.GetSigner().(*SignDigestRequest_IdentityKey); ok { + return x.IdentityKey + } + return false +} + +func (x *SignDigestRequest) GetPrekeyIndex() uint32 { + if x, ok := x.GetSigner().(*SignDigestRequest_PrekeyIndex); ok { + return x.PrekeyIndex + } + return 0 +} + +type isSignDigestRequest_Signer interface { + isSignDigestRequest_Signer() +} + +type SignDigestRequest_IdentityKey struct { + IdentityKey bool `protobuf:"varint,2,opt,name=identity_key,json=identityKey,proto3,oneof"` +} + +type SignDigestRequest_PrekeyIndex struct { + PrekeyIndex uint32 `protobuf:"varint,3,opt,name=prekey_index,json=prekeyIndex,proto3,oneof"` +} + +func (*SignDigestRequest_IdentityKey) isSignDigestRequest_Signer() {} + +func (*SignDigestRequest_PrekeyIndex) isSignDigestRequest_Signer() {} + +// GetRefreshJobRequest is used to get the last run time of a refresh job +type GetRefreshJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JobType JobType `protobuf:"varint,1,opt,name=job_type,json=jobType,proto3,enum=xmtp.keystore_api.v1.JobType" json:"job_type,omitempty"` +} + +func (x *GetRefreshJobRequest) Reset() { + *x = GetRefreshJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRefreshJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRefreshJobRequest) ProtoMessage() {} + +func (x *GetRefreshJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRefreshJobRequest.ProtoReflect.Descriptor instead. +func (*GetRefreshJobRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{24} +} + +func (x *GetRefreshJobRequest) GetJobType() JobType { + if x != nil { + return x.JobType + } + return JobType_JOB_TYPE_UNSPECIFIED +} + +// GetRefreshJobResponse is used to return the last run time of a refresh job +type GetRefreshJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastRunNs int64 `protobuf:"varint,1,opt,name=last_run_ns,json=lastRunNs,proto3" json:"last_run_ns,omitempty"` +} + +func (x *GetRefreshJobResponse) Reset() { + *x = GetRefreshJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRefreshJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRefreshJobResponse) ProtoMessage() {} + +func (x *GetRefreshJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRefreshJobResponse.ProtoReflect.Descriptor instead. +func (*GetRefreshJobResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{25} +} + +func (x *GetRefreshJobResponse) GetLastRunNs() int64 { + if x != nil { + return x.LastRunNs + } + return 0 +} + +// SetRefreshJobRequest is used to set the last run time of a refresh job +type SetRefeshJobRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JobType JobType `protobuf:"varint,1,opt,name=job_type,json=jobType,proto3,enum=xmtp.keystore_api.v1.JobType" json:"job_type,omitempty"` + LastRunNs int64 `protobuf:"varint,2,opt,name=last_run_ns,json=lastRunNs,proto3" json:"last_run_ns,omitempty"` +} + +func (x *SetRefeshJobRequest) Reset() { + *x = SetRefeshJobRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetRefeshJobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetRefeshJobRequest) ProtoMessage() {} + +func (x *SetRefeshJobRequest) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetRefeshJobRequest.ProtoReflect.Descriptor instead. +func (*SetRefeshJobRequest) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{26} +} + +func (x *SetRefeshJobRequest) GetJobType() JobType { + if x != nil { + return x.JobType + } + return JobType_JOB_TYPE_UNSPECIFIED +} + +func (x *SetRefeshJobRequest) GetLastRunNs() int64 { + if x != nil { + return x.LastRunNs + } + return 0 +} + +// SetRefreshJobResponse is an empty response type +type SetRefreshJobResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetRefreshJobResponse) Reset() { + *x = SetRefreshJobResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetRefreshJobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetRefreshJobResponse) ProtoMessage() {} + +func (x *SetRefreshJobResponse) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetRefreshJobResponse.ProtoReflect.Descriptor instead. +func (*SetRefreshJobResponse) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{27} +} + +// A mapping of topics to their decrypted invitations +type TopicMap struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Topics map[string]*TopicMap_TopicData `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *TopicMap) Reset() { + *x = TopicMap{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopicMap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicMap) ProtoMessage() {} + +func (x *TopicMap) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicMap.ProtoReflect.Descriptor instead. +func (*TopicMap) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{28} +} + +func (x *TopicMap) GetTopics() map[string]*TopicMap_TopicData { + if x != nil { + return x.Topics + } + return nil +} + +// A single decryption request +type DecryptV1Request_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload *message_contents.Ciphertext `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + PeerKeys *message_contents.PublicKeyBundle `protobuf:"bytes,2,opt,name=peer_keys,json=peerKeys,proto3" json:"peer_keys,omitempty"` + HeaderBytes []byte `protobuf:"bytes,3,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` + IsSender bool `protobuf:"varint,4,opt,name=is_sender,json=isSender,proto3" json:"is_sender,omitempty"` +} + +func (x *DecryptV1Request_Request) Reset() { + *x = DecryptV1Request_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptV1Request_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptV1Request_Request) ProtoMessage() {} + +func (x *DecryptV1Request_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptV1Request_Request.ProtoReflect.Descriptor instead. +func (*DecryptV1Request_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *DecryptV1Request_Request) GetPayload() *message_contents.Ciphertext { + if x != nil { + return x.Payload + } + return nil +} + +func (x *DecryptV1Request_Request) GetPeerKeys() *message_contents.PublicKeyBundle { + if x != nil { + return x.PeerKeys + } + return nil +} + +func (x *DecryptV1Request_Request) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +func (x *DecryptV1Request_Request) GetIsSender() bool { + if x != nil { + return x.IsSender + } + return false +} + +// A single decryption response +type DecryptResponse_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *DecryptResponse_Response_Result + // *DecryptResponse_Response_Error + Response isDecryptResponse_Response_Response `protobuf_oneof:"response"` +} + +func (x *DecryptResponse_Response) Reset() { + *x = DecryptResponse_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptResponse_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptResponse_Response) ProtoMessage() {} + +func (x *DecryptResponse_Response) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptResponse_Response.ProtoReflect.Descriptor instead. +func (*DecryptResponse_Response) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{2, 0} +} + +func (m *DecryptResponse_Response) GetResponse() isDecryptResponse_Response_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *DecryptResponse_Response) GetResult() *DecryptResponse_Response_Success { + if x, ok := x.GetResponse().(*DecryptResponse_Response_Result); ok { + return x.Result + } + return nil +} + +func (x *DecryptResponse_Response) GetError() *KeystoreError { + if x, ok := x.GetResponse().(*DecryptResponse_Response_Error); ok { + return x.Error + } + return nil +} + +type isDecryptResponse_Response_Response interface { + isDecryptResponse_Response_Response() +} + +type DecryptResponse_Response_Result struct { + Result *DecryptResponse_Response_Success `protobuf:"bytes,1,opt,name=result,proto3,oneof"` +} + +type DecryptResponse_Response_Error struct { + Error *KeystoreError `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*DecryptResponse_Response_Result) isDecryptResponse_Response_Response() {} + +func (*DecryptResponse_Response_Error) isDecryptResponse_Response_Response() {} + +// Wrapper object for success response +type DecryptResponse_Response_Success struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Decrypted []byte `protobuf:"bytes,1,opt,name=decrypted,proto3" json:"decrypted,omitempty"` +} + +func (x *DecryptResponse_Response_Success) Reset() { + *x = DecryptResponse_Response_Success{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptResponse_Response_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptResponse_Response_Success) ProtoMessage() {} + +func (x *DecryptResponse_Response_Success) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptResponse_Response_Success.ProtoReflect.Descriptor instead. +func (*DecryptResponse_Response_Success) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{2, 0, 0} +} + +func (x *DecryptResponse_Response_Success) GetDecrypted() []byte { + if x != nil { + return x.Decrypted + } + return nil +} + +// A single decryption request +type DecryptV2Request_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload *message_contents.Ciphertext `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + HeaderBytes []byte `protobuf:"bytes,2,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` + ContentTopic string `protobuf:"bytes,3,opt,name=content_topic,json=contentTopic,proto3" json:"content_topic,omitempty"` +} + +func (x *DecryptV2Request_Request) Reset() { + *x = DecryptV2Request_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptV2Request_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptV2Request_Request) ProtoMessage() {} + +func (x *DecryptV2Request_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptV2Request_Request.ProtoReflect.Descriptor instead. +func (*DecryptV2Request_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *DecryptV2Request_Request) GetPayload() *message_contents.Ciphertext { + if x != nil { + return x.Payload + } + return nil +} + +func (x *DecryptV2Request_Request) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +func (x *DecryptV2Request_Request) GetContentTopic() string { + if x != nil { + return x.ContentTopic + } + return "" +} + +// A single encryption request +type EncryptV1Request_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Recipient *message_contents.PublicKeyBundle `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + HeaderBytes []byte `protobuf:"bytes,3,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` +} + +func (x *EncryptV1Request_Request) Reset() { + *x = EncryptV1Request_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptV1Request_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptV1Request_Request) ProtoMessage() {} + +func (x *EncryptV1Request_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptV1Request_Request.ProtoReflect.Descriptor instead. +func (*EncryptV1Request_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *EncryptV1Request_Request) GetRecipient() *message_contents.PublicKeyBundle { + if x != nil { + return x.Recipient + } + return nil +} + +func (x *EncryptV1Request_Request) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *EncryptV1Request_Request) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +// A single encryption response +type EncryptResponse_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *EncryptResponse_Response_Result + // *EncryptResponse_Response_Error + Response isEncryptResponse_Response_Response `protobuf_oneof:"response"` +} + +func (x *EncryptResponse_Response) Reset() { + *x = EncryptResponse_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptResponse_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptResponse_Response) ProtoMessage() {} + +func (x *EncryptResponse_Response) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptResponse_Response.ProtoReflect.Descriptor instead. +func (*EncryptResponse_Response) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{5, 0} +} + +func (m *EncryptResponse_Response) GetResponse() isEncryptResponse_Response_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *EncryptResponse_Response) GetResult() *EncryptResponse_Response_Success { + if x, ok := x.GetResponse().(*EncryptResponse_Response_Result); ok { + return x.Result + } + return nil +} + +func (x *EncryptResponse_Response) GetError() *KeystoreError { + if x, ok := x.GetResponse().(*EncryptResponse_Response_Error); ok { + return x.Error + } + return nil +} + +type isEncryptResponse_Response_Response interface { + isEncryptResponse_Response_Response() +} + +type EncryptResponse_Response_Result struct { + Result *EncryptResponse_Response_Success `protobuf:"bytes,1,opt,name=result,proto3,oneof"` +} + +type EncryptResponse_Response_Error struct { + Error *KeystoreError `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*EncryptResponse_Response_Result) isEncryptResponse_Response_Response() {} + +func (*EncryptResponse_Response_Error) isEncryptResponse_Response_Response() {} + +// Wrapper object for success response +type EncryptResponse_Response_Success struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Encrypted *message_contents.Ciphertext `protobuf:"bytes,1,opt,name=encrypted,proto3" json:"encrypted,omitempty"` +} + +func (x *EncryptResponse_Response_Success) Reset() { + *x = EncryptResponse_Response_Success{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptResponse_Response_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptResponse_Response_Success) ProtoMessage() {} + +func (x *EncryptResponse_Response_Success) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptResponse_Response_Success.ProtoReflect.Descriptor instead. +func (*EncryptResponse_Response_Success) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{5, 0, 0} +} + +func (x *EncryptResponse_Response_Success) GetEncrypted() *message_contents.Ciphertext { + if x != nil { + return x.Encrypted + } + return nil +} + +// A single encryption request +type EncryptV2Request_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + HeaderBytes []byte `protobuf:"bytes,2,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` + ContentTopic string `protobuf:"bytes,3,opt,name=content_topic,json=contentTopic,proto3" json:"content_topic,omitempty"` +} + +func (x *EncryptV2Request_Request) Reset() { + *x = EncryptV2Request_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptV2Request_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptV2Request_Request) ProtoMessage() {} + +func (x *EncryptV2Request_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptV2Request_Request.ProtoReflect.Descriptor instead. +func (*EncryptV2Request_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *EncryptV2Request_Request) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *EncryptV2Request_Request) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +func (x *EncryptV2Request_Request) GetContentTopic() string { + if x != nil { + return x.ContentTopic + } + return "" +} + +// Request type +type SelfEncryptRequest_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *SelfEncryptRequest_Request) Reset() { + *x = SelfEncryptRequest_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfEncryptRequest_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfEncryptRequest_Request) ProtoMessage() {} + +func (x *SelfEncryptRequest_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfEncryptRequest_Request.ProtoReflect.Descriptor instead. +func (*SelfEncryptRequest_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *SelfEncryptRequest_Request) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// Response type +type SelfEncryptResponse_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *SelfEncryptResponse_Response_Result + // *SelfEncryptResponse_Response_Error + Response isSelfEncryptResponse_Response_Response `protobuf_oneof:"response"` +} + +func (x *SelfEncryptResponse_Response) Reset() { + *x = SelfEncryptResponse_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfEncryptResponse_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfEncryptResponse_Response) ProtoMessage() {} + +func (x *SelfEncryptResponse_Response) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfEncryptResponse_Response.ProtoReflect.Descriptor instead. +func (*SelfEncryptResponse_Response) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{8, 0} +} + +func (m *SelfEncryptResponse_Response) GetResponse() isSelfEncryptResponse_Response_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *SelfEncryptResponse_Response) GetResult() *SelfEncryptResponse_Response_Success { + if x, ok := x.GetResponse().(*SelfEncryptResponse_Response_Result); ok { + return x.Result + } + return nil +} + +func (x *SelfEncryptResponse_Response) GetError() *KeystoreError { + if x, ok := x.GetResponse().(*SelfEncryptResponse_Response_Error); ok { + return x.Error + } + return nil +} + +type isSelfEncryptResponse_Response_Response interface { + isSelfEncryptResponse_Response_Response() +} + +type SelfEncryptResponse_Response_Result struct { + Result *SelfEncryptResponse_Response_Success `protobuf:"bytes,1,opt,name=result,proto3,oneof"` +} + +type SelfEncryptResponse_Response_Error struct { + Error *KeystoreError `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*SelfEncryptResponse_Response_Result) isSelfEncryptResponse_Response_Response() {} + +func (*SelfEncryptResponse_Response_Error) isSelfEncryptResponse_Response_Response() {} + +// Success response +type SelfEncryptResponse_Response_Success struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Encrypted []byte `protobuf:"bytes,1,opt,name=encrypted,proto3" json:"encrypted,omitempty"` +} + +func (x *SelfEncryptResponse_Response_Success) Reset() { + *x = SelfEncryptResponse_Response_Success{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfEncryptResponse_Response_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfEncryptResponse_Response_Success) ProtoMessage() {} + +func (x *SelfEncryptResponse_Response_Success) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfEncryptResponse_Response_Success.ProtoReflect.Descriptor instead. +func (*SelfEncryptResponse_Response_Success) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{8, 0, 0} +} + +func (x *SelfEncryptResponse_Response_Success) GetEncrypted() []byte { + if x != nil { + return x.Encrypted + } + return nil +} + +// Request type +type SelfDecryptRequest_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *SelfDecryptRequest_Request) Reset() { + *x = SelfDecryptRequest_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfDecryptRequest_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfDecryptRequest_Request) ProtoMessage() {} + +func (x *SelfDecryptRequest_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfDecryptRequest_Request.ProtoReflect.Descriptor instead. +func (*SelfDecryptRequest_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *SelfDecryptRequest_Request) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// Mirrors xmtp.envelope schema +type SaveInvitesRequest_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentTopic string `protobuf:"bytes,1,opt,name=content_topic,json=contentTopic,proto3" json:"content_topic,omitempty"` + TimestampNs uint64 `protobuf:"varint,2,opt,name=timestamp_ns,json=timestampNs,proto3" json:"timestamp_ns,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *SaveInvitesRequest_Request) Reset() { + *x = SaveInvitesRequest_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveInvitesRequest_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveInvitesRequest_Request) ProtoMessage() {} + +func (x *SaveInvitesRequest_Request) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveInvitesRequest_Request.ProtoReflect.Descriptor instead. +func (*SaveInvitesRequest_Request) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *SaveInvitesRequest_Request) GetContentTopic() string { + if x != nil { + return x.ContentTopic + } + return "" +} + +func (x *SaveInvitesRequest_Request) GetTimestampNs() uint64 { + if x != nil { + return x.TimestampNs + } + return 0 +} + +func (x *SaveInvitesRequest_Request) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// A single response +type SaveInvitesResponse_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *SaveInvitesResponse_Response_Result + // *SaveInvitesResponse_Response_Error + Response isSaveInvitesResponse_Response_Response `protobuf_oneof:"response"` +} + +func (x *SaveInvitesResponse_Response) Reset() { + *x = SaveInvitesResponse_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveInvitesResponse_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveInvitesResponse_Response) ProtoMessage() {} + +func (x *SaveInvitesResponse_Response) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveInvitesResponse_Response.ProtoReflect.Descriptor instead. +func (*SaveInvitesResponse_Response) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{14, 0} +} + +func (m *SaveInvitesResponse_Response) GetResponse() isSaveInvitesResponse_Response_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *SaveInvitesResponse_Response) GetResult() *SaveInvitesResponse_Response_Success { + if x, ok := x.GetResponse().(*SaveInvitesResponse_Response_Result); ok { + return x.Result + } + return nil +} + +func (x *SaveInvitesResponse_Response) GetError() *KeystoreError { + if x, ok := x.GetResponse().(*SaveInvitesResponse_Response_Error); ok { + return x.Error + } + return nil +} + +type isSaveInvitesResponse_Response_Response interface { + isSaveInvitesResponse_Response_Response() +} + +type SaveInvitesResponse_Response_Result struct { + Result *SaveInvitesResponse_Response_Success `protobuf:"bytes,1,opt,name=result,proto3,oneof"` +} + +type SaveInvitesResponse_Response_Error struct { + Error *KeystoreError `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*SaveInvitesResponse_Response_Result) isSaveInvitesResponse_Response_Response() {} + +func (*SaveInvitesResponse_Response_Error) isSaveInvitesResponse_Response_Response() {} + +// Wrapper object for success response +type SaveInvitesResponse_Response_Success struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Conversation *message_contents.ConversationReference `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"` +} + +func (x *SaveInvitesResponse_Response_Success) Reset() { + *x = SaveInvitesResponse_Response_Success{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveInvitesResponse_Response_Success) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveInvitesResponse_Response_Success) ProtoMessage() {} + +func (x *SaveInvitesResponse_Response_Success) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SaveInvitesResponse_Response_Success.ProtoReflect.Descriptor instead. +func (*SaveInvitesResponse_Response_Success) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{14, 0, 0} +} + +func (x *SaveInvitesResponse_Response_Success) GetConversation() *message_contents.ConversationReference { + if x != nil { + return x.Conversation + } + return nil +} + +// TopicData wraps the invitation and the timestamp it was created +type TopicMap_TopicData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CreatedNs uint64 `protobuf:"varint,1,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + PeerAddress string `protobuf:"bytes,2,opt,name=peer_address,json=peerAddress,proto3" json:"peer_address,omitempty"` + Invitation *message_contents.InvitationV1 `protobuf:"bytes,3,opt,name=invitation,proto3" json:"invitation,omitempty"` +} + +func (x *TopicMap_TopicData) Reset() { + *x = TopicMap_TopicData{} + if protoimpl.UnsafeEnabled { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopicMap_TopicData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopicMap_TopicData) ProtoMessage() {} + +func (x *TopicMap_TopicData) ProtoReflect() protoreflect.Message { + mi := &file_keystore_api_v1_keystore_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TopicMap_TopicData.ProtoReflect.Descriptor instead. +func (*TopicMap_TopicData) Descriptor() ([]byte, []int) { + return file_keystore_api_v1_keystore_proto_rawDescGZIP(), []int{28, 0} +} + +func (x *TopicMap_TopicData) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (x *TopicMap_TopicData) GetPeerAddress() string { + if x != nil { + return x.PeerAddress + } + return "" +} + +func (x *TopicMap_TopicData) GetInvitation() *message_contents.InvitationV1 { + if x != nil { + return x.Invitation + } + return nil +} + +var File_keystore_api_v1_keystore_proto protoreflect.FileDescriptor + +var file_keystore_api_v1_keystore_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x14, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, + 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x5e, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x22, 0xac, 0x02, 0x0a, 0x10, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x56, 0x31, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x56, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x1a, 0xcb, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3b, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, + 0x65, 0x78, 0x74, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x43, 0x0a, 0x09, + 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x4b, 0x65, 0x79, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x22, 0xb0, 0x02, 0x0a, 0x0f, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x1a, 0xce, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x50, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x36, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, + 0x27, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x64, + 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xef, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x08, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x8e, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3b, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x22, 0xed, 0x01, 0x0a, 0x10, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x56, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x08, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x56, 0x31, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x8c, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xd3, 0x02, 0x0a, 0x0f, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0xf1, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, + 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, + 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x4a, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, + 0x3f, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x74, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xcb, 0x01, 0x0a, + 0x10, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x4a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x6b, 0x0a, + 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x22, 0x87, 0x01, 0x0a, 0x12, 0x53, + 0x65, 0x6c, 0x66, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, + 0x23, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xbc, 0x02, 0x0a, 0x13, 0x53, 0x65, 0x6c, 0x66, 0x45, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0xd2, + 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x27, + 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x23, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x4e, 0x0a, + 0x2c, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0xc7, 0x01, + 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4a, 0x0a, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x50, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, + 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xcf, 0x01, 0x0a, + 0x12, 0x53, 0x61, 0x76, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x76, + 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x1a, 0x6b, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x69, + 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x4e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xf0, + 0x02, 0x0a, 0x13, 0x53, 0x61, 0x76, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x61, 0x76, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x86, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x76, + 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, + 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x5b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x51, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x73, + 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x5f, 0x6e, 0x73, 0x22, 0x70, 0x0a, 0x1a, 0x53, 0x61, 0x76, 0x65, 0x56, 0x31, 0x43, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x52, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x53, 0x61, 0x76, 0x65, 0x56, 0x31, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x41, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, + 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, + 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x75, + 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1f, 0x0a, 0x1b, 0x4b, 0x45, 0x59, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x4b, 0x45, 0x59, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, 0x5a, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x4b, 0x45, 0x59, 0x53, 0x54, 0x4f, 0x52, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, + 0x5a, 0x45, 0x44, 0x10, 0x02, 0x22, 0x5c, 0x0a, 0x13, 0x49, 0x6e, 0x69, 0x74, 0x4b, 0x65, 0x79, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x02, + 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, + 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x42, 0x08, 0x0a, 0x06, 0x62, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x22, 0x51, 0x0a, 0x14, 0x49, 0x6e, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x7f, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0b, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x6b, + 0x65, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, + 0x52, 0x0b, 0x70, 0x72, 0x65, 0x6b, 0x65, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x08, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x38, 0x0a, 0x08, 0x6a, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x22, 0x37, 0x0a, 0x15, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x75, 0x6e, + 0x4e, 0x73, 0x22, 0x6f, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x52, 0x65, 0x66, 0x65, 0x73, 0x68, 0x4a, + 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x6a, 0x6f, 0x62, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6a, 0x6f, 0x62, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x5f, + 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x75, + 0x6e, 0x4e, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc8, 0x02, 0x0a, + 0x08, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x70, 0x12, 0x42, 0x0a, 0x06, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x70, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x1a, 0x92, 0x01, + 0x0a, 0x09, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, + 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, + 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0x63, 0x0a, 0x0b, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x4d, + 0x61, 0x70, 0x2e, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x68, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, + 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x21, + 0x0a, 0x1d, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4e, 0x4f, 0x5f, + 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x52, 0x45, 0x4b, 0x45, 0x59, 0x10, + 0x02, 0x2a, 0x70, 0x0a, 0x07, 0x4a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, + 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x5f, 0x56, 0x31, 0x10, 0x01, 0x12, + 0x17, 0x0a, 0x13, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x46, 0x52, + 0x45, 0x53, 0x48, 0x5f, 0x56, 0x32, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x4a, 0x4f, 0x42, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x5f, 0x50, 0x50, 0x50, + 0x50, 0x10, 0x03, 0x42, 0xde, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x42, 0x0d, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, + 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x58, 0x4b, 0x58, 0xaa, 0x02, + 0x13, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, + 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x58, 0x6d, 0x74, + 0x70, 0x5c, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, + 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x70, 0x69, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_keystore_api_v1_keystore_proto_rawDescOnce sync.Once + file_keystore_api_v1_keystore_proto_rawDescData = file_keystore_api_v1_keystore_proto_rawDesc +) + +func file_keystore_api_v1_keystore_proto_rawDescGZIP() []byte { + file_keystore_api_v1_keystore_proto_rawDescOnce.Do(func() { + file_keystore_api_v1_keystore_proto_rawDescData = protoimpl.X.CompressGZIP(file_keystore_api_v1_keystore_proto_rawDescData) + }) + return file_keystore_api_v1_keystore_proto_rawDescData +} + +var file_keystore_api_v1_keystore_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_keystore_api_v1_keystore_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_keystore_api_v1_keystore_proto_goTypes = []interface{}{ + (ErrorCode)(0), // 0: xmtp.keystore_api.v1.ErrorCode + (JobType)(0), // 1: xmtp.keystore_api.v1.JobType + (GetKeystoreStatusResponse_KeystoreStatus)(0), // 2: xmtp.keystore_api.v1.GetKeystoreStatusResponse.KeystoreStatus + (*KeystoreError)(nil), // 3: xmtp.keystore_api.v1.KeystoreError + (*DecryptV1Request)(nil), // 4: xmtp.keystore_api.v1.DecryptV1Request + (*DecryptResponse)(nil), // 5: xmtp.keystore_api.v1.DecryptResponse + (*DecryptV2Request)(nil), // 6: xmtp.keystore_api.v1.DecryptV2Request + (*EncryptV1Request)(nil), // 7: xmtp.keystore_api.v1.EncryptV1Request + (*EncryptResponse)(nil), // 8: xmtp.keystore_api.v1.EncryptResponse + (*EncryptV2Request)(nil), // 9: xmtp.keystore_api.v1.EncryptV2Request + (*SelfEncryptRequest)(nil), // 10: xmtp.keystore_api.v1.SelfEncryptRequest + (*SelfEncryptResponse)(nil), // 11: xmtp.keystore_api.v1.SelfEncryptResponse + (*SelfDecryptRequest)(nil), // 12: xmtp.keystore_api.v1.SelfDecryptRequest + (*GetPrivatePreferencesTopicIdentifierResponse)(nil), // 13: xmtp.keystore_api.v1.GetPrivatePreferencesTopicIdentifierResponse + (*CreateInviteRequest)(nil), // 14: xmtp.keystore_api.v1.CreateInviteRequest + (*CreateInviteResponse)(nil), // 15: xmtp.keystore_api.v1.CreateInviteResponse + (*SaveInvitesRequest)(nil), // 16: xmtp.keystore_api.v1.SaveInvitesRequest + (*SaveInvitesResponse)(nil), // 17: xmtp.keystore_api.v1.SaveInvitesResponse + (*CreateAuthTokenRequest)(nil), // 18: xmtp.keystore_api.v1.CreateAuthTokenRequest + (*SaveV1ConversationsRequest)(nil), // 19: xmtp.keystore_api.v1.SaveV1ConversationsRequest + (*SaveV1ConversationsResponse)(nil), // 20: xmtp.keystore_api.v1.SaveV1ConversationsResponse + (*GetConversationsResponse)(nil), // 21: xmtp.keystore_api.v1.GetConversationsResponse + (*GetKeystoreStatusRequest)(nil), // 22: xmtp.keystore_api.v1.GetKeystoreStatusRequest + (*GetKeystoreStatusResponse)(nil), // 23: xmtp.keystore_api.v1.GetKeystoreStatusResponse + (*InitKeystoreRequest)(nil), // 24: xmtp.keystore_api.v1.InitKeystoreRequest + (*InitKeystoreResponse)(nil), // 25: xmtp.keystore_api.v1.InitKeystoreResponse + (*SignDigestRequest)(nil), // 26: xmtp.keystore_api.v1.SignDigestRequest + (*GetRefreshJobRequest)(nil), // 27: xmtp.keystore_api.v1.GetRefreshJobRequest + (*GetRefreshJobResponse)(nil), // 28: xmtp.keystore_api.v1.GetRefreshJobResponse + (*SetRefeshJobRequest)(nil), // 29: xmtp.keystore_api.v1.SetRefeshJobRequest + (*SetRefreshJobResponse)(nil), // 30: xmtp.keystore_api.v1.SetRefreshJobResponse + (*TopicMap)(nil), // 31: xmtp.keystore_api.v1.TopicMap + (*DecryptV1Request_Request)(nil), // 32: xmtp.keystore_api.v1.DecryptV1Request.Request + (*DecryptResponse_Response)(nil), // 33: xmtp.keystore_api.v1.DecryptResponse.Response + (*DecryptResponse_Response_Success)(nil), // 34: xmtp.keystore_api.v1.DecryptResponse.Response.Success + (*DecryptV2Request_Request)(nil), // 35: xmtp.keystore_api.v1.DecryptV2Request.Request + (*EncryptV1Request_Request)(nil), // 36: xmtp.keystore_api.v1.EncryptV1Request.Request + (*EncryptResponse_Response)(nil), // 37: xmtp.keystore_api.v1.EncryptResponse.Response + (*EncryptResponse_Response_Success)(nil), // 38: xmtp.keystore_api.v1.EncryptResponse.Response.Success + (*EncryptV2Request_Request)(nil), // 39: xmtp.keystore_api.v1.EncryptV2Request.Request + (*SelfEncryptRequest_Request)(nil), // 40: xmtp.keystore_api.v1.SelfEncryptRequest.Request + (*SelfEncryptResponse_Response)(nil), // 41: xmtp.keystore_api.v1.SelfEncryptResponse.Response + (*SelfEncryptResponse_Response_Success)(nil), // 42: xmtp.keystore_api.v1.SelfEncryptResponse.Response.Success + (*SelfDecryptRequest_Request)(nil), // 43: xmtp.keystore_api.v1.SelfDecryptRequest.Request + (*SaveInvitesRequest_Request)(nil), // 44: xmtp.keystore_api.v1.SaveInvitesRequest.Request + (*SaveInvitesResponse_Response)(nil), // 45: xmtp.keystore_api.v1.SaveInvitesResponse.Response + (*SaveInvitesResponse_Response_Success)(nil), // 46: xmtp.keystore_api.v1.SaveInvitesResponse.Response.Success + (*TopicMap_TopicData)(nil), // 47: xmtp.keystore_api.v1.TopicMap.TopicData + nil, // 48: xmtp.keystore_api.v1.TopicMap.TopicsEntry + (*message_contents.InvitationV1_Context)(nil), // 49: xmtp.message_contents.InvitationV1.Context + (*message_contents.SignedPublicKeyBundle)(nil), // 50: xmtp.message_contents.SignedPublicKeyBundle + (*message_contents.ConversationReference)(nil), // 51: xmtp.message_contents.ConversationReference + (*message_contents.PrivateKeyBundleV1)(nil), // 52: xmtp.message_contents.PrivateKeyBundleV1 + (*message_contents.Ciphertext)(nil), // 53: xmtp.message_contents.Ciphertext + (*message_contents.PublicKeyBundle)(nil), // 54: xmtp.message_contents.PublicKeyBundle + (*message_contents.InvitationV1)(nil), // 55: xmtp.message_contents.InvitationV1 +} +var file_keystore_api_v1_keystore_proto_depIdxs = []int32{ + 0, // 0: xmtp.keystore_api.v1.KeystoreError.code:type_name -> xmtp.keystore_api.v1.ErrorCode + 32, // 1: xmtp.keystore_api.v1.DecryptV1Request.requests:type_name -> xmtp.keystore_api.v1.DecryptV1Request.Request + 33, // 2: xmtp.keystore_api.v1.DecryptResponse.responses:type_name -> xmtp.keystore_api.v1.DecryptResponse.Response + 35, // 3: xmtp.keystore_api.v1.DecryptV2Request.requests:type_name -> xmtp.keystore_api.v1.DecryptV2Request.Request + 36, // 4: xmtp.keystore_api.v1.EncryptV1Request.requests:type_name -> xmtp.keystore_api.v1.EncryptV1Request.Request + 37, // 5: xmtp.keystore_api.v1.EncryptResponse.responses:type_name -> xmtp.keystore_api.v1.EncryptResponse.Response + 39, // 6: xmtp.keystore_api.v1.EncryptV2Request.requests:type_name -> xmtp.keystore_api.v1.EncryptV2Request.Request + 40, // 7: xmtp.keystore_api.v1.SelfEncryptRequest.requests:type_name -> xmtp.keystore_api.v1.SelfEncryptRequest.Request + 41, // 8: xmtp.keystore_api.v1.SelfEncryptResponse.responses:type_name -> xmtp.keystore_api.v1.SelfEncryptResponse.Response + 43, // 9: xmtp.keystore_api.v1.SelfDecryptRequest.requests:type_name -> xmtp.keystore_api.v1.SelfDecryptRequest.Request + 49, // 10: xmtp.keystore_api.v1.CreateInviteRequest.context:type_name -> xmtp.message_contents.InvitationV1.Context + 50, // 11: xmtp.keystore_api.v1.CreateInviteRequest.recipient:type_name -> xmtp.message_contents.SignedPublicKeyBundle + 51, // 12: xmtp.keystore_api.v1.CreateInviteResponse.conversation:type_name -> xmtp.message_contents.ConversationReference + 44, // 13: xmtp.keystore_api.v1.SaveInvitesRequest.requests:type_name -> xmtp.keystore_api.v1.SaveInvitesRequest.Request + 45, // 14: xmtp.keystore_api.v1.SaveInvitesResponse.responses:type_name -> xmtp.keystore_api.v1.SaveInvitesResponse.Response + 51, // 15: xmtp.keystore_api.v1.SaveV1ConversationsRequest.conversations:type_name -> xmtp.message_contents.ConversationReference + 51, // 16: xmtp.keystore_api.v1.GetConversationsResponse.conversations:type_name -> xmtp.message_contents.ConversationReference + 2, // 17: xmtp.keystore_api.v1.GetKeystoreStatusResponse.status:type_name -> xmtp.keystore_api.v1.GetKeystoreStatusResponse.KeystoreStatus + 52, // 18: xmtp.keystore_api.v1.InitKeystoreRequest.v1:type_name -> xmtp.message_contents.PrivateKeyBundleV1 + 3, // 19: xmtp.keystore_api.v1.InitKeystoreResponse.error:type_name -> xmtp.keystore_api.v1.KeystoreError + 1, // 20: xmtp.keystore_api.v1.GetRefreshJobRequest.job_type:type_name -> xmtp.keystore_api.v1.JobType + 1, // 21: xmtp.keystore_api.v1.SetRefeshJobRequest.job_type:type_name -> xmtp.keystore_api.v1.JobType + 48, // 22: xmtp.keystore_api.v1.TopicMap.topics:type_name -> xmtp.keystore_api.v1.TopicMap.TopicsEntry + 53, // 23: xmtp.keystore_api.v1.DecryptV1Request.Request.payload:type_name -> xmtp.message_contents.Ciphertext + 54, // 24: xmtp.keystore_api.v1.DecryptV1Request.Request.peer_keys:type_name -> xmtp.message_contents.PublicKeyBundle + 34, // 25: xmtp.keystore_api.v1.DecryptResponse.Response.result:type_name -> xmtp.keystore_api.v1.DecryptResponse.Response.Success + 3, // 26: xmtp.keystore_api.v1.DecryptResponse.Response.error:type_name -> xmtp.keystore_api.v1.KeystoreError + 53, // 27: xmtp.keystore_api.v1.DecryptV2Request.Request.payload:type_name -> xmtp.message_contents.Ciphertext + 54, // 28: xmtp.keystore_api.v1.EncryptV1Request.Request.recipient:type_name -> xmtp.message_contents.PublicKeyBundle + 38, // 29: xmtp.keystore_api.v1.EncryptResponse.Response.result:type_name -> xmtp.keystore_api.v1.EncryptResponse.Response.Success + 3, // 30: xmtp.keystore_api.v1.EncryptResponse.Response.error:type_name -> xmtp.keystore_api.v1.KeystoreError + 53, // 31: xmtp.keystore_api.v1.EncryptResponse.Response.Success.encrypted:type_name -> xmtp.message_contents.Ciphertext + 42, // 32: xmtp.keystore_api.v1.SelfEncryptResponse.Response.result:type_name -> xmtp.keystore_api.v1.SelfEncryptResponse.Response.Success + 3, // 33: xmtp.keystore_api.v1.SelfEncryptResponse.Response.error:type_name -> xmtp.keystore_api.v1.KeystoreError + 46, // 34: xmtp.keystore_api.v1.SaveInvitesResponse.Response.result:type_name -> xmtp.keystore_api.v1.SaveInvitesResponse.Response.Success + 3, // 35: xmtp.keystore_api.v1.SaveInvitesResponse.Response.error:type_name -> xmtp.keystore_api.v1.KeystoreError + 51, // 36: xmtp.keystore_api.v1.SaveInvitesResponse.Response.Success.conversation:type_name -> xmtp.message_contents.ConversationReference + 55, // 37: xmtp.keystore_api.v1.TopicMap.TopicData.invitation:type_name -> xmtp.message_contents.InvitationV1 + 47, // 38: xmtp.keystore_api.v1.TopicMap.TopicsEntry.value:type_name -> xmtp.keystore_api.v1.TopicMap.TopicData + 39, // [39:39] is the sub-list for method output_type + 39, // [39:39] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name +} + +func init() { file_keystore_api_v1_keystore_proto_init() } +func file_keystore_api_v1_keystore_proto_init() { + if File_keystore_api_v1_keystore_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_keystore_api_v1_keystore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeystoreError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptV1Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptV2Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptV1Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptV2Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfEncryptRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfEncryptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfDecryptRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrivatePreferencesTopicIdentifierResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInviteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInviteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveInvitesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveInvitesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAuthTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveV1ConversationsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveV1ConversationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConversationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetKeystoreStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetKeystoreStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitKeystoreRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitKeystoreResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignDigestRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRefreshJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRefreshJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetRefeshJobRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetRefreshJobResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopicMap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptV1Request_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptResponse_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptResponse_Response_Success); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptV2Request_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptV1Request_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptResponse_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptResponse_Response_Success); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptV2Request_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfEncryptRequest_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfEncryptResponse_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfEncryptResponse_Response_Success); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfDecryptRequest_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveInvitesRequest_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveInvitesResponse_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveInvitesResponse_Response_Success); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_keystore_api_v1_keystore_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopicMap_TopicData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_keystore_api_v1_keystore_proto_msgTypes[15].OneofWrappers = []interface{}{} + file_keystore_api_v1_keystore_proto_msgTypes[21].OneofWrappers = []interface{}{ + (*InitKeystoreRequest_V1)(nil), + } + file_keystore_api_v1_keystore_proto_msgTypes[23].OneofWrappers = []interface{}{ + (*SignDigestRequest_IdentityKey)(nil), + (*SignDigestRequest_PrekeyIndex)(nil), + } + file_keystore_api_v1_keystore_proto_msgTypes[30].OneofWrappers = []interface{}{ + (*DecryptResponse_Response_Result)(nil), + (*DecryptResponse_Response_Error)(nil), + } + file_keystore_api_v1_keystore_proto_msgTypes[34].OneofWrappers = []interface{}{ + (*EncryptResponse_Response_Result)(nil), + (*EncryptResponse_Response_Error)(nil), + } + file_keystore_api_v1_keystore_proto_msgTypes[38].OneofWrappers = []interface{}{ + (*SelfEncryptResponse_Response_Result)(nil), + (*SelfEncryptResponse_Response_Error)(nil), + } + file_keystore_api_v1_keystore_proto_msgTypes[42].OneofWrappers = []interface{}{ + (*SaveInvitesResponse_Response_Result)(nil), + (*SaveInvitesResponse_Response_Error)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_keystore_api_v1_keystore_proto_rawDesc, + NumEnums: 3, + NumMessages: 46, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_keystore_api_v1_keystore_proto_goTypes, + DependencyIndexes: file_keystore_api_v1_keystore_proto_depIdxs, + EnumInfos: file_keystore_api_v1_keystore_proto_enumTypes, + MessageInfos: file_keystore_api_v1_keystore_proto_msgTypes, + }.Build() + File_keystore_api_v1_keystore_proto = out.File + file_keystore_api_v1_keystore_proto_rawDesc = nil + file_keystore_api_v1_keystore_proto_goTypes = nil + file_keystore_api_v1_keystore_proto_depIdxs = nil +} diff --git a/pkg/proto/message_api/v1/authn.pb.go b/pkg/proto/message_api/v1/authn.pb.go new file mode 100644 index 00000000..f1fa710c --- /dev/null +++ b/pkg/proto/message_api/v1/authn.pb.go @@ -0,0 +1,278 @@ +// Client authentication protocol + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_api/v1/authn.proto + +package message_apiv1 + +import ( + message_contents "github.com/xmtp/xmtp-node-go/pkg/proto/message_contents" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Token is used by clients to prove to the nodes +// that they are serving a specific wallet. +type Token struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // identity key signed by a wallet + IdentityKey *message_contents.PublicKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // encoded bytes of AuthData + AuthDataBytes []byte `protobuf:"bytes,2,opt,name=auth_data_bytes,json=authDataBytes,proto3" json:"auth_data_bytes,omitempty"` + // identity key signature of AuthData bytes + AuthDataSignature *message_contents.Signature `protobuf:"bytes,3,opt,name=auth_data_signature,json=authDataSignature,proto3" json:"auth_data_signature,omitempty"` +} + +func (x *Token) Reset() { + *x = Token{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_authn_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Token) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Token) ProtoMessage() {} + +func (x *Token) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_authn_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Token.ProtoReflect.Descriptor instead. +func (*Token) Descriptor() ([]byte, []int) { + return file_message_api_v1_authn_proto_rawDescGZIP(), []int{0} +} + +func (x *Token) GetIdentityKey() *message_contents.PublicKey { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *Token) GetAuthDataBytes() []byte { + if x != nil { + return x.AuthDataBytes + } + return nil +} + +func (x *Token) GetAuthDataSignature() *message_contents.Signature { + if x != nil { + return x.AuthDataSignature + } + return nil +} + +// AuthData carries token parameters that are authenticated +// by the identity key signature. +// It is embedded in the Token structure as bytes +// so that the bytes don't need to be reconstructed +// to verify the token signature. +type AuthData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address of the wallet + WalletAddr string `protobuf:"bytes,1,opt,name=wallet_addr,json=walletAddr,proto3" json:"wallet_addr,omitempty"` + // time when the token was generated/signed + CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` +} + +func (x *AuthData) Reset() { + *x = AuthData{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_authn_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthData) ProtoMessage() {} + +func (x *AuthData) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_authn_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthData.ProtoReflect.Descriptor instead. +func (*AuthData) Descriptor() ([]byte, []int) { + return file_message_api_v1_authn_proto_rawDescGZIP(), []int{1} +} + +func (x *AuthData) GetWalletAddr() string { + if x != nil { + return x.WalletAddr + } + return "" +} + +func (x *AuthData) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +var File_message_api_v1_authn_proto protoreflect.FileDescriptor + +var file_message_api_v1_authn_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x43, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, + 0x61, 0x75, 0x74, 0x68, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x50, 0x0a, + 0x13, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x11, 0x61, 0x75, + 0x74, 0x68, 0x44, 0x61, 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0x4a, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x77, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x42, 0xd4, 0x01, 0x0a, 0x17, + 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, + 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, + 0xaa, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, + 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x58, 0x6d, 0x74, + 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x58, 0x6d, + 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_api_v1_authn_proto_rawDescOnce sync.Once + file_message_api_v1_authn_proto_rawDescData = file_message_api_v1_authn_proto_rawDesc +) + +func file_message_api_v1_authn_proto_rawDescGZIP() []byte { + file_message_api_v1_authn_proto_rawDescOnce.Do(func() { + file_message_api_v1_authn_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_api_v1_authn_proto_rawDescData) + }) + return file_message_api_v1_authn_proto_rawDescData +} + +var file_message_api_v1_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_message_api_v1_authn_proto_goTypes = []interface{}{ + (*Token)(nil), // 0: xmtp.message_api.v1.Token + (*AuthData)(nil), // 1: xmtp.message_api.v1.AuthData + (*message_contents.PublicKey)(nil), // 2: xmtp.message_contents.PublicKey + (*message_contents.Signature)(nil), // 3: xmtp.message_contents.Signature +} +var file_message_api_v1_authn_proto_depIdxs = []int32{ + 2, // 0: xmtp.message_api.v1.Token.identity_key:type_name -> xmtp.message_contents.PublicKey + 3, // 1: xmtp.message_api.v1.Token.auth_data_signature:type_name -> xmtp.message_contents.Signature + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_message_api_v1_authn_proto_init() } +func file_message_api_v1_authn_proto_init() { + if File_message_api_v1_authn_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_api_v1_authn_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Token); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_authn_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_api_v1_authn_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_api_v1_authn_proto_goTypes, + DependencyIndexes: file_message_api_v1_authn_proto_depIdxs, + MessageInfos: file_message_api_v1_authn_proto_msgTypes, + }.Build() + File_message_api_v1_authn_proto = out.File + file_message_api_v1_authn_proto_rawDesc = nil + file_message_api_v1_authn_proto_goTypes = nil + file_message_api_v1_authn_proto_depIdxs = nil +} diff --git a/pkg/proto/message_api/v1/message_api.pb.go b/pkg/proto/message_api/v1/message_api.pb.go new file mode 100644 index 00000000..d76ffb9c --- /dev/null +++ b/pkg/proto/message_api/v1/message_api.pb.go @@ -0,0 +1,1122 @@ +// Message API + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_api/v1/message_api.proto + +package message_apiv1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Sort direction +type SortDirection int32 + +const ( + SortDirection_SORT_DIRECTION_UNSPECIFIED SortDirection = 0 + SortDirection_SORT_DIRECTION_ASCENDING SortDirection = 1 + SortDirection_SORT_DIRECTION_DESCENDING SortDirection = 2 +) + +// Enum value maps for SortDirection. +var ( + SortDirection_name = map[int32]string{ + 0: "SORT_DIRECTION_UNSPECIFIED", + 1: "SORT_DIRECTION_ASCENDING", + 2: "SORT_DIRECTION_DESCENDING", + } + SortDirection_value = map[string]int32{ + "SORT_DIRECTION_UNSPECIFIED": 0, + "SORT_DIRECTION_ASCENDING": 1, + "SORT_DIRECTION_DESCENDING": 2, + } +) + +func (x SortDirection) Enum() *SortDirection { + p := new(SortDirection) + *p = x + return p +} + +func (x SortDirection) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SortDirection) Descriptor() protoreflect.EnumDescriptor { + return file_message_api_v1_message_api_proto_enumTypes[0].Descriptor() +} + +func (SortDirection) Type() protoreflect.EnumType { + return &file_message_api_v1_message_api_proto_enumTypes[0] +} + +func (x SortDirection) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SortDirection.Descriptor instead. +func (SortDirection) EnumDescriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{0} +} + +// This is based off of the go-waku Index type, but with the +// receiverTime and pubsubTopic removed for simplicity. +// Both removed fields are optional +type IndexCursor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + SenderTimeNs uint64 `protobuf:"varint,2,opt,name=sender_time_ns,json=senderTimeNs,proto3" json:"sender_time_ns,omitempty"` +} + +func (x *IndexCursor) Reset() { + *x = IndexCursor{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IndexCursor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IndexCursor) ProtoMessage() {} + +func (x *IndexCursor) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IndexCursor.ProtoReflect.Descriptor instead. +func (*IndexCursor) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{0} +} + +func (x *IndexCursor) GetDigest() []byte { + if x != nil { + return x.Digest + } + return nil +} + +func (x *IndexCursor) GetSenderTimeNs() uint64 { + if x != nil { + return x.SenderTimeNs + } + return 0 +} + +// Wrapper for potentially multiple types of cursor +type Cursor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Making the cursor a one-of type, as I would like to change the way we + // handle pagination to use a precomputed sort field. + // This way we can handle both methods + // + // Types that are assignable to Cursor: + // + // *Cursor_Index + Cursor isCursor_Cursor `protobuf_oneof:"cursor"` +} + +func (x *Cursor) Reset() { + *x = Cursor{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cursor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cursor) ProtoMessage() {} + +func (x *Cursor) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cursor.ProtoReflect.Descriptor instead. +func (*Cursor) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{1} +} + +func (m *Cursor) GetCursor() isCursor_Cursor { + if m != nil { + return m.Cursor + } + return nil +} + +func (x *Cursor) GetIndex() *IndexCursor { + if x, ok := x.GetCursor().(*Cursor_Index); ok { + return x.Index + } + return nil +} + +type isCursor_Cursor interface { + isCursor_Cursor() +} + +type Cursor_Index struct { + Index *IndexCursor `protobuf:"bytes,1,opt,name=index,proto3,oneof"` +} + +func (*Cursor_Index) isCursor_Cursor() {} + +// This is based off of the go-waku PagingInfo struct, but with the direction +// changed to our SortDirection enum format +type PagingInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Note: this is a uint32, while go-waku's pageSize is a uint64 + Limit uint32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Cursor *Cursor `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` + Direction SortDirection `protobuf:"varint,3,opt,name=direction,proto3,enum=xmtp.message_api.v1.SortDirection" json:"direction,omitempty"` +} + +func (x *PagingInfo) Reset() { + *x = PagingInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagingInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagingInfo) ProtoMessage() {} + +func (x *PagingInfo) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PagingInfo.ProtoReflect.Descriptor instead. +func (*PagingInfo) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{2} +} + +func (x *PagingInfo) GetLimit() uint32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *PagingInfo) GetCursor() *Cursor { + if x != nil { + return x.Cursor + } + return nil +} + +func (x *PagingInfo) GetDirection() SortDirection { + if x != nil { + return x.Direction + } + return SortDirection_SORT_DIRECTION_UNSPECIFIED +} + +// Envelope encapsulates a message while in transit. +type Envelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The topic the message belongs to, + // If the message includes the topic as well + // it MUST be the same as the topic in the envelope. + ContentTopic string `protobuf:"bytes,1,opt,name=content_topic,json=contentTopic,proto3" json:"content_topic,omitempty"` + // Message creation timestamp + // If the message includes the timestamp as well + // it MUST be equivalent to the timestamp in the envelope. + TimestampNs uint64 `protobuf:"varint,2,opt,name=timestamp_ns,json=timestampNs,proto3" json:"timestamp_ns,omitempty"` + Message []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *Envelope) Reset() { + *x = Envelope{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Envelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Envelope) ProtoMessage() {} + +func (x *Envelope) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Envelope.ProtoReflect.Descriptor instead. +func (*Envelope) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{3} +} + +func (x *Envelope) GetContentTopic() string { + if x != nil { + return x.ContentTopic + } + return "" +} + +func (x *Envelope) GetTimestampNs() uint64 { + if x != nil { + return x.TimestampNs + } + return 0 +} + +func (x *Envelope) GetMessage() []byte { + if x != nil { + return x.Message + } + return nil +} + +// Publish +type PublishRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Envelopes []*Envelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` +} + +func (x *PublishRequest) Reset() { + *x = PublishRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublishRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishRequest) ProtoMessage() {} + +func (x *PublishRequest) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead. +func (*PublishRequest) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{4} +} + +func (x *PublishRequest) GetEnvelopes() []*Envelope { + if x != nil { + return x.Envelopes + } + return nil +} + +// Empty message as a response for Publish +type PublishResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PublishResponse) Reset() { + *x = PublishResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublishResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishResponse) ProtoMessage() {} + +func (x *PublishResponse) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead. +func (*PublishResponse) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{5} +} + +// Subscribe +type SubscribeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentTopics []string `protobuf:"bytes,1,rep,name=content_topics,json=contentTopics,proto3" json:"content_topics,omitempty"` +} + +func (x *SubscribeRequest) Reset() { + *x = SubscribeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeRequest) ProtoMessage() {} + +func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. +func (*SubscribeRequest) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{6} +} + +func (x *SubscribeRequest) GetContentTopics() []string { + if x != nil { + return x.ContentTopics + } + return nil +} + +// SubscribeAll +type SubscribeAllRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SubscribeAllRequest) Reset() { + *x = SubscribeAllRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeAllRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeAllRequest) ProtoMessage() {} + +func (x *SubscribeAllRequest) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeAllRequest.ProtoReflect.Descriptor instead. +func (*SubscribeAllRequest) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{7} +} + +// Query +type QueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentTopics []string `protobuf:"bytes,1,rep,name=content_topics,json=contentTopics,proto3" json:"content_topics,omitempty"` + StartTimeNs uint64 `protobuf:"varint,2,opt,name=start_time_ns,json=startTimeNs,proto3" json:"start_time_ns,omitempty"` + EndTimeNs uint64 `protobuf:"varint,3,opt,name=end_time_ns,json=endTimeNs,proto3" json:"end_time_ns,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,4,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"` +} + +func (x *QueryRequest) Reset() { + *x = QueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequest) ProtoMessage() {} + +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryRequest) GetContentTopics() []string { + if x != nil { + return x.ContentTopics + } + return nil +} + +func (x *QueryRequest) GetStartTimeNs() uint64 { + if x != nil { + return x.StartTimeNs + } + return 0 +} + +func (x *QueryRequest) GetEndTimeNs() uint64 { + if x != nil { + return x.EndTimeNs + } + return 0 +} + +func (x *QueryRequest) GetPagingInfo() *PagingInfo { + if x != nil { + return x.PagingInfo + } + return nil +} + +// The response, containing envelopes, for a query +type QueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Envelopes []*Envelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"` +} + +func (x *QueryResponse) Reset() { + *x = QueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResponse) ProtoMessage() {} + +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryResponse) GetEnvelopes() []*Envelope { + if x != nil { + return x.Envelopes + } + return nil +} + +func (x *QueryResponse) GetPagingInfo() *PagingInfo { + if x != nil { + return x.PagingInfo + } + return nil +} + +// BatchQuery +type BatchQueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Requests []*QueryRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (x *BatchQueryRequest) Reset() { + *x = BatchQueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchQueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchQueryRequest) ProtoMessage() {} + +func (x *BatchQueryRequest) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchQueryRequest.ProtoReflect.Descriptor instead. +func (*BatchQueryRequest) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{10} +} + +func (x *BatchQueryRequest) GetRequests() []*QueryRequest { + if x != nil { + return x.Requests + } + return nil +} + +// Response containing a list of QueryResponse messages +type BatchQueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*QueryResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *BatchQueryResponse) Reset() { + *x = BatchQueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_message_api_v1_message_api_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchQueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchQueryResponse) ProtoMessage() {} + +func (x *BatchQueryResponse) ProtoReflect() protoreflect.Message { + mi := &file_message_api_v1_message_api_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchQueryResponse.ProtoReflect.Descriptor instead. +func (*BatchQueryResponse) Descriptor() ([]byte, []int) { + return file_message_api_v1_message_api_proto_rawDescGZIP(), []int{11} +} + +func (x *BatchQueryResponse) GetResponses() []*QueryResponse { + if x != nil { + return x.Responses + } + return nil +} + +var File_message_api_v1_message_api_proto protoreflect.FileDescriptor + +var file_message_api_v1_message_api_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, + 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x0b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x43, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, + 0x4e, 0x73, 0x22, 0x4c, 0x0a, 0x06, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x48, 0x00, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x08, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, + 0x22, 0x99, 0x01, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x73, + 0x6f, 0x72, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x40, 0x0a, 0x09, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6c, 0x0a, 0x08, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x21, 0x0a, + 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4d, 0x0a, 0x0e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x09, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x0a, 0x10, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xbb, + 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x8e, 0x01, 0x0a, + 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, + 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x52, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x52, 0x0a, + 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x22, 0x56, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x2a, 0x6c, 0x0a, 0x0d, 0x53, 0x6f, 0x72, + 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x4f, + 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x4f, + 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x53, 0x43, + 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x4f, 0x52, 0x54, + 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x45, + 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x32, 0xc6, 0x05, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x12, 0x74, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, + 0x68, 0x12, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x75, 0x0a, 0x09, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, + 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x30, 0x01, 0x12, 0x58, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x32, 0x12, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x7f, 0x0a, + 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x41, 0x6c, 0x6c, 0x12, 0x28, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x41, 0x6c, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, + 0x2a, 0x22, 0x19, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x61, 0x6c, 0x6c, 0x30, 0x01, 0x12, 0x6c, + 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x81, 0x01, 0x0a, + 0x0a, 0x42, 0x61, 0x74, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x26, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2d, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x42, 0xef, 0x01, 0x92, 0x41, 0x13, 0x12, 0x11, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x41, 0x70, 0x69, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x42, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, + 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, + 0xaa, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, + 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x58, 0x6d, 0x74, + 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x58, 0x6d, + 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_api_v1_message_api_proto_rawDescOnce sync.Once + file_message_api_v1_message_api_proto_rawDescData = file_message_api_v1_message_api_proto_rawDesc +) + +func file_message_api_v1_message_api_proto_rawDescGZIP() []byte { + file_message_api_v1_message_api_proto_rawDescOnce.Do(func() { + file_message_api_v1_message_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_api_v1_message_api_proto_rawDescData) + }) + return file_message_api_v1_message_api_proto_rawDescData +} + +var file_message_api_v1_message_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_message_api_v1_message_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_message_api_v1_message_api_proto_goTypes = []interface{}{ + (SortDirection)(0), // 0: xmtp.message_api.v1.SortDirection + (*IndexCursor)(nil), // 1: xmtp.message_api.v1.IndexCursor + (*Cursor)(nil), // 2: xmtp.message_api.v1.Cursor + (*PagingInfo)(nil), // 3: xmtp.message_api.v1.PagingInfo + (*Envelope)(nil), // 4: xmtp.message_api.v1.Envelope + (*PublishRequest)(nil), // 5: xmtp.message_api.v1.PublishRequest + (*PublishResponse)(nil), // 6: xmtp.message_api.v1.PublishResponse + (*SubscribeRequest)(nil), // 7: xmtp.message_api.v1.SubscribeRequest + (*SubscribeAllRequest)(nil), // 8: xmtp.message_api.v1.SubscribeAllRequest + (*QueryRequest)(nil), // 9: xmtp.message_api.v1.QueryRequest + (*QueryResponse)(nil), // 10: xmtp.message_api.v1.QueryResponse + (*BatchQueryRequest)(nil), // 11: xmtp.message_api.v1.BatchQueryRequest + (*BatchQueryResponse)(nil), // 12: xmtp.message_api.v1.BatchQueryResponse +} +var file_message_api_v1_message_api_proto_depIdxs = []int32{ + 1, // 0: xmtp.message_api.v1.Cursor.index:type_name -> xmtp.message_api.v1.IndexCursor + 2, // 1: xmtp.message_api.v1.PagingInfo.cursor:type_name -> xmtp.message_api.v1.Cursor + 0, // 2: xmtp.message_api.v1.PagingInfo.direction:type_name -> xmtp.message_api.v1.SortDirection + 4, // 3: xmtp.message_api.v1.PublishRequest.envelopes:type_name -> xmtp.message_api.v1.Envelope + 3, // 4: xmtp.message_api.v1.QueryRequest.paging_info:type_name -> xmtp.message_api.v1.PagingInfo + 4, // 5: xmtp.message_api.v1.QueryResponse.envelopes:type_name -> xmtp.message_api.v1.Envelope + 3, // 6: xmtp.message_api.v1.QueryResponse.paging_info:type_name -> xmtp.message_api.v1.PagingInfo + 9, // 7: xmtp.message_api.v1.BatchQueryRequest.requests:type_name -> xmtp.message_api.v1.QueryRequest + 10, // 8: xmtp.message_api.v1.BatchQueryResponse.responses:type_name -> xmtp.message_api.v1.QueryResponse + 5, // 9: xmtp.message_api.v1.MessageApi.Publish:input_type -> xmtp.message_api.v1.PublishRequest + 7, // 10: xmtp.message_api.v1.MessageApi.Subscribe:input_type -> xmtp.message_api.v1.SubscribeRequest + 7, // 11: xmtp.message_api.v1.MessageApi.Subscribe2:input_type -> xmtp.message_api.v1.SubscribeRequest + 8, // 12: xmtp.message_api.v1.MessageApi.SubscribeAll:input_type -> xmtp.message_api.v1.SubscribeAllRequest + 9, // 13: xmtp.message_api.v1.MessageApi.Query:input_type -> xmtp.message_api.v1.QueryRequest + 11, // 14: xmtp.message_api.v1.MessageApi.BatchQuery:input_type -> xmtp.message_api.v1.BatchQueryRequest + 6, // 15: xmtp.message_api.v1.MessageApi.Publish:output_type -> xmtp.message_api.v1.PublishResponse + 4, // 16: xmtp.message_api.v1.MessageApi.Subscribe:output_type -> xmtp.message_api.v1.Envelope + 4, // 17: xmtp.message_api.v1.MessageApi.Subscribe2:output_type -> xmtp.message_api.v1.Envelope + 4, // 18: xmtp.message_api.v1.MessageApi.SubscribeAll:output_type -> xmtp.message_api.v1.Envelope + 10, // 19: xmtp.message_api.v1.MessageApi.Query:output_type -> xmtp.message_api.v1.QueryResponse + 12, // 20: xmtp.message_api.v1.MessageApi.BatchQuery:output_type -> xmtp.message_api.v1.BatchQueryResponse + 15, // [15:21] is the sub-list for method output_type + 9, // [9:15] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_message_api_v1_message_api_proto_init() } +func file_message_api_v1_message_api_proto_init() { + if File_message_api_v1_message_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_api_v1_message_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndexCursor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cursor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagingInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Envelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublishRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublishResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeAllRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchQueryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_api_v1_message_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchQueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_api_v1_message_api_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Cursor_Index)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_api_v1_message_api_proto_rawDesc, + NumEnums: 1, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_message_api_v1_message_api_proto_goTypes, + DependencyIndexes: file_message_api_v1_message_api_proto_depIdxs, + EnumInfos: file_message_api_v1_message_api_proto_enumTypes, + MessageInfos: file_message_api_v1_message_api_proto_msgTypes, + }.Build() + File_message_api_v1_message_api_proto = out.File + file_message_api_v1_message_api_proto_rawDesc = nil + file_message_api_v1_message_api_proto_goTypes = nil + file_message_api_v1_message_api_proto_depIdxs = nil +} diff --git a/pkg/proto/message_api/v1/message_api.pb.gw.go b/pkg/proto/message_api/v1/message_api.pb.gw.go new file mode 100644 index 00000000..f2d9da8d --- /dev/null +++ b/pkg/proto/message_api/v1/message_api.pb.gw.go @@ -0,0 +1,425 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: message_api/v1/message_api.proto + +/* +Package message_apiv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package message_apiv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_MessageApi_Publish_0(ctx context.Context, marshaler runtime.Marshaler, client MessageApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Publish(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MessageApi_Publish_0(ctx context.Context, marshaler runtime.Marshaler, server MessageApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Publish(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MessageApi_Subscribe_0(ctx context.Context, marshaler runtime.Marshaler, client MessageApiClient, req *http.Request, pathParams map[string]string) (MessageApi_SubscribeClient, runtime.ServerMetadata, error) { + var protoReq SubscribeRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.Subscribe(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_MessageApi_SubscribeAll_0(ctx context.Context, marshaler runtime.Marshaler, client MessageApiClient, req *http.Request, pathParams map[string]string) (MessageApi_SubscribeAllClient, runtime.ServerMetadata, error) { + var protoReq SubscribeAllRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.SubscribeAll(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_MessageApi_Query_0(ctx context.Context, marshaler runtime.Marshaler, client MessageApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Query(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MessageApi_Query_0(ctx context.Context, marshaler runtime.Marshaler, server MessageApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Query(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MessageApi_BatchQuery_0(ctx context.Context, marshaler runtime.Marshaler, client MessageApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BatchQueryRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BatchQuery(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MessageApi_BatchQuery_0(ctx context.Context, marshaler runtime.Marshaler, server MessageApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BatchQueryRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BatchQuery(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMessageApiHandlerServer registers the http handlers for service MessageApi to "mux". +// UnaryRPC :call MessageApiServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMessageApiHandlerFromEndpoint instead. +func RegisterMessageApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessageApiServer) error { + + mux.Handle("POST", pattern_MessageApi_Publish_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/Publish", runtime.WithHTTPPathPattern("/message/v1/publish")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MessageApi_Publish_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_Publish_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MessageApi_Subscribe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle("POST", pattern_MessageApi_SubscribeAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle("POST", pattern_MessageApi_Query_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/Query", runtime.WithHTTPPathPattern("/message/v1/query")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MessageApi_Query_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_Query_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MessageApi_BatchQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/BatchQuery", runtime.WithHTTPPathPattern("/message/v1/batch-query")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MessageApi_BatchQuery_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_BatchQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMessageApiHandlerFromEndpoint is same as RegisterMessageApiHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMessageApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMessageApiHandler(ctx, mux, conn) +} + +// RegisterMessageApiHandler registers the http handlers for service MessageApi to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMessageApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMessageApiHandlerClient(ctx, mux, NewMessageApiClient(conn)) +} + +// RegisterMessageApiHandlerClient registers the http handlers for service MessageApi +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MessageApiClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MessageApiClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MessageApiClient" to call the correct interceptors. +func RegisterMessageApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessageApiClient) error { + + mux.Handle("POST", pattern_MessageApi_Publish_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/Publish", runtime.WithHTTPPathPattern("/message/v1/publish")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MessageApi_Publish_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_Publish_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MessageApi_Subscribe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/Subscribe", runtime.WithHTTPPathPattern("/message/v1/subscribe")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MessageApi_Subscribe_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_Subscribe_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MessageApi_SubscribeAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/SubscribeAll", runtime.WithHTTPPathPattern("/message/v1/subscribe-all")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MessageApi_SubscribeAll_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_SubscribeAll_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MessageApi_Query_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/Query", runtime.WithHTTPPathPattern("/message/v1/query")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MessageApi_Query_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_Query_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MessageApi_BatchQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.message_api.v1.MessageApi/BatchQuery", runtime.WithHTTPPathPattern("/message/v1/batch-query")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MessageApi_BatchQuery_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MessageApi_BatchQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MessageApi_Publish_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"message", "v1", "publish"}, "")) + + pattern_MessageApi_Subscribe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"message", "v1", "subscribe"}, "")) + + pattern_MessageApi_SubscribeAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"message", "v1", "subscribe-all"}, "")) + + pattern_MessageApi_Query_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"message", "v1", "query"}, "")) + + pattern_MessageApi_BatchQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"message", "v1", "batch-query"}, "")) +) + +var ( + forward_MessageApi_Publish_0 = runtime.ForwardResponseMessage + + forward_MessageApi_Subscribe_0 = runtime.ForwardResponseStream + + forward_MessageApi_SubscribeAll_0 = runtime.ForwardResponseStream + + forward_MessageApi_Query_0 = runtime.ForwardResponseMessage + + forward_MessageApi_BatchQuery_0 = runtime.ForwardResponseMessage +) diff --git a/pkg/proto/message_api/v1/message_api_grpc.pb.go b/pkg/proto/message_api/v1/message_api_grpc.pb.go new file mode 100644 index 00000000..b422aaa9 --- /dev/null +++ b/pkg/proto/message_api/v1/message_api_grpc.pb.go @@ -0,0 +1,399 @@ +// Message API + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: message_api/v1/message_api.proto + +package message_apiv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MessageApi_Publish_FullMethodName = "/xmtp.message_api.v1.MessageApi/Publish" + MessageApi_Subscribe_FullMethodName = "/xmtp.message_api.v1.MessageApi/Subscribe" + MessageApi_Subscribe2_FullMethodName = "/xmtp.message_api.v1.MessageApi/Subscribe2" + MessageApi_SubscribeAll_FullMethodName = "/xmtp.message_api.v1.MessageApi/SubscribeAll" + MessageApi_Query_FullMethodName = "/xmtp.message_api.v1.MessageApi/Query" + MessageApi_BatchQuery_FullMethodName = "/xmtp.message_api.v1.MessageApi/BatchQuery" +) + +// MessageApiClient is the client API for MessageApi service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MessageApiClient interface { + // Publish messages to the network + Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) + // Subscribe to a stream of new envelopes matching a predicate + Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MessageApi_SubscribeClient, error) + // Subscribe to a stream of new envelopes and your subscription using + // bidirectional streaming + // protolint:disable:next RPC_REQUEST_STANDARD_NAME + Subscribe2(ctx context.Context, opts ...grpc.CallOption) (MessageApi_Subscribe2Client, error) + // Subscribe to a stream of all messages + SubscribeAll(ctx context.Context, in *SubscribeAllRequest, opts ...grpc.CallOption) (MessageApi_SubscribeAllClient, error) + // Query the store for messages + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // BatchQuery containing a set of queries to be processed + BatchQuery(ctx context.Context, in *BatchQueryRequest, opts ...grpc.CallOption) (*BatchQueryResponse, error) +} + +type messageApiClient struct { + cc grpc.ClientConnInterface +} + +func NewMessageApiClient(cc grpc.ClientConnInterface) MessageApiClient { + return &messageApiClient{cc} +} + +func (c *messageApiClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) { + out := new(PublishResponse) + err := c.cc.Invoke(ctx, MessageApi_Publish_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageApiClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MessageApi_SubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &MessageApi_ServiceDesc.Streams[0], MessageApi_Subscribe_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &messageApiSubscribeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MessageApi_SubscribeClient interface { + Recv() (*Envelope, error) + grpc.ClientStream +} + +type messageApiSubscribeClient struct { + grpc.ClientStream +} + +func (x *messageApiSubscribeClient) Recv() (*Envelope, error) { + m := new(Envelope) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *messageApiClient) Subscribe2(ctx context.Context, opts ...grpc.CallOption) (MessageApi_Subscribe2Client, error) { + stream, err := c.cc.NewStream(ctx, &MessageApi_ServiceDesc.Streams[1], MessageApi_Subscribe2_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &messageApiSubscribe2Client{stream} + return x, nil +} + +type MessageApi_Subscribe2Client interface { + Send(*SubscribeRequest) error + Recv() (*Envelope, error) + grpc.ClientStream +} + +type messageApiSubscribe2Client struct { + grpc.ClientStream +} + +func (x *messageApiSubscribe2Client) Send(m *SubscribeRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *messageApiSubscribe2Client) Recv() (*Envelope, error) { + m := new(Envelope) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *messageApiClient) SubscribeAll(ctx context.Context, in *SubscribeAllRequest, opts ...grpc.CallOption) (MessageApi_SubscribeAllClient, error) { + stream, err := c.cc.NewStream(ctx, &MessageApi_ServiceDesc.Streams[2], MessageApi_SubscribeAll_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &messageApiSubscribeAllClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MessageApi_SubscribeAllClient interface { + Recv() (*Envelope, error) + grpc.ClientStream +} + +type messageApiSubscribeAllClient struct { + grpc.ClientStream +} + +func (x *messageApiSubscribeAllClient) Recv() (*Envelope, error) { + m := new(Envelope) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *messageApiClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, MessageApi_Query_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageApiClient) BatchQuery(ctx context.Context, in *BatchQueryRequest, opts ...grpc.CallOption) (*BatchQueryResponse, error) { + out := new(BatchQueryResponse) + err := c.cc.Invoke(ctx, MessageApi_BatchQuery_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MessageApiServer is the server API for MessageApi service. +// All implementations must embed UnimplementedMessageApiServer +// for forward compatibility +type MessageApiServer interface { + // Publish messages to the network + Publish(context.Context, *PublishRequest) (*PublishResponse, error) + // Subscribe to a stream of new envelopes matching a predicate + Subscribe(*SubscribeRequest, MessageApi_SubscribeServer) error + // Subscribe to a stream of new envelopes and your subscription using + // bidirectional streaming + // protolint:disable:next RPC_REQUEST_STANDARD_NAME + Subscribe2(MessageApi_Subscribe2Server) error + // Subscribe to a stream of all messages + SubscribeAll(*SubscribeAllRequest, MessageApi_SubscribeAllServer) error + // Query the store for messages + Query(context.Context, *QueryRequest) (*QueryResponse, error) + // BatchQuery containing a set of queries to be processed + BatchQuery(context.Context, *BatchQueryRequest) (*BatchQueryResponse, error) + mustEmbedUnimplementedMessageApiServer() +} + +// UnimplementedMessageApiServer must be embedded to have forward compatible implementations. +type UnimplementedMessageApiServer struct { +} + +func (UnimplementedMessageApiServer) Publish(context.Context, *PublishRequest) (*PublishResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented") +} +func (UnimplementedMessageApiServer) Subscribe(*SubscribeRequest, MessageApi_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedMessageApiServer) Subscribe2(MessageApi_Subscribe2Server) error { + return status.Errorf(codes.Unimplemented, "method Subscribe2 not implemented") +} +func (UnimplementedMessageApiServer) SubscribeAll(*SubscribeAllRequest, MessageApi_SubscribeAllServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeAll not implemented") +} +func (UnimplementedMessageApiServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (UnimplementedMessageApiServer) BatchQuery(context.Context, *BatchQueryRequest) (*BatchQueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchQuery not implemented") +} +func (UnimplementedMessageApiServer) mustEmbedUnimplementedMessageApiServer() {} + +// UnsafeMessageApiServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MessageApiServer will +// result in compilation errors. +type UnsafeMessageApiServer interface { + mustEmbedUnimplementedMessageApiServer() +} + +func RegisterMessageApiServer(s grpc.ServiceRegistrar, srv MessageApiServer) { + s.RegisterService(&MessageApi_ServiceDesc, srv) +} + +func _MessageApi_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageApiServer).Publish(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MessageApi_Publish_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageApiServer).Publish(ctx, req.(*PublishRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageApi_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MessageApiServer).Subscribe(m, &messageApiSubscribeServer{stream}) +} + +type MessageApi_SubscribeServer interface { + Send(*Envelope) error + grpc.ServerStream +} + +type messageApiSubscribeServer struct { + grpc.ServerStream +} + +func (x *messageApiSubscribeServer) Send(m *Envelope) error { + return x.ServerStream.SendMsg(m) +} + +func _MessageApi_Subscribe2_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(MessageApiServer).Subscribe2(&messageApiSubscribe2Server{stream}) +} + +type MessageApi_Subscribe2Server interface { + Send(*Envelope) error + Recv() (*SubscribeRequest, error) + grpc.ServerStream +} + +type messageApiSubscribe2Server struct { + grpc.ServerStream +} + +func (x *messageApiSubscribe2Server) Send(m *Envelope) error { + return x.ServerStream.SendMsg(m) +} + +func (x *messageApiSubscribe2Server) Recv() (*SubscribeRequest, error) { + m := new(SubscribeRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _MessageApi_SubscribeAll_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeAllRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MessageApiServer).SubscribeAll(m, &messageApiSubscribeAllServer{stream}) +} + +type MessageApi_SubscribeAllServer interface { + Send(*Envelope) error + grpc.ServerStream +} + +type messageApiSubscribeAllServer struct { + grpc.ServerStream +} + +func (x *messageApiSubscribeAllServer) Send(m *Envelope) error { + return x.ServerStream.SendMsg(m) +} + +func _MessageApi_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageApiServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MessageApi_Query_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageApiServer).Query(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageApi_BatchQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchQueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageApiServer).BatchQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MessageApi_BatchQuery_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageApiServer).BatchQuery(ctx, req.(*BatchQueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MessageApi_ServiceDesc is the grpc.ServiceDesc for MessageApi service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MessageApi_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "xmtp.message_api.v1.MessageApi", + HandlerType: (*MessageApiServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Publish", + Handler: _MessageApi_Publish_Handler, + }, + { + MethodName: "Query", + Handler: _MessageApi_Query_Handler, + }, + { + MethodName: "BatchQuery", + Handler: _MessageApi_BatchQuery_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Subscribe", + Handler: _MessageApi_Subscribe_Handler, + ServerStreams: true, + }, + { + StreamName: "Subscribe2", + Handler: _MessageApi_Subscribe2_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "SubscribeAll", + Handler: _MessageApi_SubscribeAll_Handler, + ServerStreams: true, + }, + }, + Metadata: "message_api/v1/message_api.proto", +} diff --git a/pkg/proto/message_contents/ciphertext.pb.go b/pkg/proto/message_contents/ciphertext.pb.go new file mode 100644 index 00000000..090ab5d1 --- /dev/null +++ b/pkg/proto/message_contents/ciphertext.pb.go @@ -0,0 +1,454 @@ +// Ciphertext is a generic structure for encrypted payload. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/ciphertext.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Ciphertext represents encrypted payload. +// It is definited as a union to support cryptographic algorithm agility. +// The payload is accompanied by the cryptographic parameters +// required by the chosen encryption scheme. +type Ciphertext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Union: + // + // *Ciphertext_Aes256GcmHkdfSha256 + Union isCiphertext_Union `protobuf_oneof:"union"` +} + +func (x *Ciphertext) Reset() { + *x = Ciphertext{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_ciphertext_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ciphertext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ciphertext) ProtoMessage() {} + +func (x *Ciphertext) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_ciphertext_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ciphertext.ProtoReflect.Descriptor instead. +func (*Ciphertext) Descriptor() ([]byte, []int) { + return file_message_contents_ciphertext_proto_rawDescGZIP(), []int{0} +} + +func (m *Ciphertext) GetUnion() isCiphertext_Union { + if m != nil { + return m.Union + } + return nil +} + +func (x *Ciphertext) GetAes256GcmHkdfSha256() *Ciphertext_Aes256GcmHkdfsha256 { + if x, ok := x.GetUnion().(*Ciphertext_Aes256GcmHkdfSha256); ok { + return x.Aes256GcmHkdfSha256 + } + return nil +} + +type isCiphertext_Union interface { + isCiphertext_Union() +} + +type Ciphertext_Aes256GcmHkdfSha256 struct { + Aes256GcmHkdfSha256 *Ciphertext_Aes256GcmHkdfsha256 `protobuf:"bytes,1,opt,name=aes256_gcm_hkdf_sha256,json=aes256GcmHkdfSha256,proto3,oneof"` +} + +func (*Ciphertext_Aes256GcmHkdfSha256) isCiphertext_Union() {} + +// SignedEciesCiphertext represents an ECIES encrypted payload and a signature +type SignedEciesCiphertext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // serialized Ecies message + EciesBytes []byte `protobuf:"bytes,1,opt,name=ecies_bytes,json=eciesBytes,proto3" json:"ecies_bytes,omitempty"` + // signature of sha256(ecies_bytes) signed with the IdentityKey + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedEciesCiphertext) Reset() { + *x = SignedEciesCiphertext{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_ciphertext_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedEciesCiphertext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedEciesCiphertext) ProtoMessage() {} + +func (x *SignedEciesCiphertext) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_ciphertext_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedEciesCiphertext.ProtoReflect.Descriptor instead. +func (*SignedEciesCiphertext) Descriptor() ([]byte, []int) { + return file_message_contents_ciphertext_proto_rawDescGZIP(), []int{1} +} + +func (x *SignedEciesCiphertext) GetEciesBytes() []byte { + if x != nil { + return x.EciesBytes + } + return nil +} + +func (x *SignedEciesCiphertext) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// Encryption: AES256-GCM +// Key derivation function: HKDF-SHA256 +type Ciphertext_Aes256GcmHkdfsha256 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HkdfSalt []byte `protobuf:"bytes,1,opt,name=hkdf_salt,json=hkdfSalt,proto3" json:"hkdf_salt,omitempty"` // 32 bytes + GcmNonce []byte `protobuf:"bytes,2,opt,name=gcm_nonce,json=gcmNonce,proto3" json:"gcm_nonce,omitempty"` // 12 bytes + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // encrypted payload +} + +func (x *Ciphertext_Aes256GcmHkdfsha256) Reset() { + *x = Ciphertext_Aes256GcmHkdfsha256{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_ciphertext_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ciphertext_Aes256GcmHkdfsha256) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ciphertext_Aes256GcmHkdfsha256) ProtoMessage() {} + +func (x *Ciphertext_Aes256GcmHkdfsha256) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_ciphertext_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ciphertext_Aes256GcmHkdfsha256.ProtoReflect.Descriptor instead. +func (*Ciphertext_Aes256GcmHkdfsha256) Descriptor() ([]byte, []int) { + return file_message_contents_ciphertext_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Ciphertext_Aes256GcmHkdfsha256) GetHkdfSalt() []byte { + if x != nil { + return x.HkdfSalt + } + return nil +} + +func (x *Ciphertext_Aes256GcmHkdfsha256) GetGcmNonce() []byte { + if x != nil { + return x.GcmNonce + } + return nil +} + +func (x *Ciphertext_Aes256GcmHkdfsha256) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// Ecies is ciphertext encrypted using ECIES with a MAC +type SignedEciesCiphertext_Ecies struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EphemeralPublicKey []byte `protobuf:"bytes,1,opt,name=ephemeral_public_key,json=ephemeralPublicKey,proto3" json:"ephemeral_public_key,omitempty"` // 65 bytes + Iv []byte `protobuf:"bytes,2,opt,name=iv,proto3" json:"iv,omitempty"` // 16 bytes + Mac []byte `protobuf:"bytes,3,opt,name=mac,proto3" json:"mac,omitempty"` // 32 bytes + Ciphertext []byte `protobuf:"bytes,4,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` // encrypted payload with block size of 16 +} + +func (x *SignedEciesCiphertext_Ecies) Reset() { + *x = SignedEciesCiphertext_Ecies{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_ciphertext_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedEciesCiphertext_Ecies) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedEciesCiphertext_Ecies) ProtoMessage() {} + +func (x *SignedEciesCiphertext_Ecies) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_ciphertext_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedEciesCiphertext_Ecies.ProtoReflect.Descriptor instead. +func (*SignedEciesCiphertext_Ecies) Descriptor() ([]byte, []int) { + return file_message_contents_ciphertext_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *SignedEciesCiphertext_Ecies) GetEphemeralPublicKey() []byte { + if x != nil { + return x.EphemeralPublicKey + } + return nil +} + +func (x *SignedEciesCiphertext_Ecies) GetIv() []byte { + if x != nil { + return x.Iv + } + return nil +} + +func (x *SignedEciesCiphertext_Ecies) GetMac() []byte { + if x != nil { + return x.Mac + } + return nil +} + +func (x *SignedEciesCiphertext_Ecies) GetCiphertext() []byte { + if x != nil { + return x.Ciphertext + } + return nil +} + +var File_message_contents_ciphertext_proto protoreflect.FileDescriptor + +var file_message_contents_ciphertext_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x20, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x01, 0x0a, + 0x0a, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x6c, 0x0a, 0x16, 0x61, + 0x65, 0x73, 0x32, 0x35, 0x36, 0x5f, 0x67, 0x63, 0x6d, 0x5f, 0x68, 0x6b, 0x64, 0x66, 0x5f, 0x73, + 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x41, + 0x65, 0x73, 0x32, 0x35, 0x36, 0x67, 0x63, 0x6d, 0x48, 0x6b, 0x64, 0x66, 0x73, 0x68, 0x61, 0x32, + 0x35, 0x36, 0x48, 0x00, 0x52, 0x13, 0x61, 0x65, 0x73, 0x32, 0x35, 0x36, 0x47, 0x63, 0x6d, 0x48, + 0x6b, 0x64, 0x66, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x1a, 0x69, 0x0a, 0x13, 0x41, 0x65, 0x73, + 0x32, 0x35, 0x36, 0x67, 0x63, 0x6d, 0x48, 0x6b, 0x64, 0x66, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, + 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6b, 0x64, 0x66, 0x5f, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x6b, 0x64, 0x66, 0x53, 0x61, 0x6c, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x67, 0x63, 0x6d, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x67, 0x63, 0x6d, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x22, 0xf5, 0x01, + 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x45, 0x63, 0x69, 0x65, 0x73, 0x43, 0x69, 0x70, + 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x63, 0x69, 0x65, 0x73, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x65, 0x63, + 0x69, 0x65, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x7b, 0x0a, 0x05, 0x45, 0x63, 0x69, 0x65, + 0x73, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x12, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, 0x72, 0x61, 0x6c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x02, 0x69, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x74, 0x42, 0xd6, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x42, 0x0f, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, + 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, + 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, + 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_ciphertext_proto_rawDescOnce sync.Once + file_message_contents_ciphertext_proto_rawDescData = file_message_contents_ciphertext_proto_rawDesc +) + +func file_message_contents_ciphertext_proto_rawDescGZIP() []byte { + file_message_contents_ciphertext_proto_rawDescOnce.Do(func() { + file_message_contents_ciphertext_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_ciphertext_proto_rawDescData) + }) + return file_message_contents_ciphertext_proto_rawDescData +} + +var file_message_contents_ciphertext_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_message_contents_ciphertext_proto_goTypes = []interface{}{ + (*Ciphertext)(nil), // 0: xmtp.message_contents.Ciphertext + (*SignedEciesCiphertext)(nil), // 1: xmtp.message_contents.SignedEciesCiphertext + (*Ciphertext_Aes256GcmHkdfsha256)(nil), // 2: xmtp.message_contents.Ciphertext.Aes256gcmHkdfsha256 + (*SignedEciesCiphertext_Ecies)(nil), // 3: xmtp.message_contents.SignedEciesCiphertext.Ecies + (*Signature)(nil), // 4: xmtp.message_contents.Signature +} +var file_message_contents_ciphertext_proto_depIdxs = []int32{ + 2, // 0: xmtp.message_contents.Ciphertext.aes256_gcm_hkdf_sha256:type_name -> xmtp.message_contents.Ciphertext.Aes256gcmHkdfsha256 + 4, // 1: xmtp.message_contents.SignedEciesCiphertext.signature:type_name -> xmtp.message_contents.Signature + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_message_contents_ciphertext_proto_init() } +func file_message_contents_ciphertext_proto_init() { + if File_message_contents_ciphertext_proto != nil { + return + } + file_message_contents_signature_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_ciphertext_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ciphertext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_ciphertext_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedEciesCiphertext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_ciphertext_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ciphertext_Aes256GcmHkdfsha256); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_ciphertext_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedEciesCiphertext_Ecies); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_ciphertext_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Ciphertext_Aes256GcmHkdfSha256)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_ciphertext_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_ciphertext_proto_goTypes, + DependencyIndexes: file_message_contents_ciphertext_proto_depIdxs, + MessageInfos: file_message_contents_ciphertext_proto_msgTypes, + }.Build() + File_message_contents_ciphertext_proto = out.File + file_message_contents_ciphertext_proto_rawDesc = nil + file_message_contents_ciphertext_proto_goTypes = nil + file_message_contents_ciphertext_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/composite.pb.go b/pkg/proto/message_contents/composite.pb.go new file mode 100644 index 00000000..fec832a1 --- /dev/null +++ b/pkg/proto/message_contents/composite.pb.go @@ -0,0 +1,277 @@ +// Composite ContentType + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/composite.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Composite is used to implement xmtp.org/composite content type +type Composite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Parts []*Composite_Part `protobuf:"bytes,1,rep,name=parts,proto3" json:"parts,omitempty"` +} + +func (x *Composite) Reset() { + *x = Composite{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_composite_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Composite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Composite) ProtoMessage() {} + +func (x *Composite) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_composite_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Composite.ProtoReflect.Descriptor instead. +func (*Composite) Descriptor() ([]byte, []int) { + return file_message_contents_composite_proto_rawDescGZIP(), []int{0} +} + +func (x *Composite) GetParts() []*Composite_Part { + if x != nil { + return x.Parts + } + return nil +} + +// Part represents one section of a composite message +type Composite_Part struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Element: + // + // *Composite_Part_Part + // *Composite_Part_Composite + Element isComposite_Part_Element `protobuf_oneof:"element"` +} + +func (x *Composite_Part) Reset() { + *x = Composite_Part{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_composite_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Composite_Part) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Composite_Part) ProtoMessage() {} + +func (x *Composite_Part) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_composite_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Composite_Part.ProtoReflect.Descriptor instead. +func (*Composite_Part) Descriptor() ([]byte, []int) { + return file_message_contents_composite_proto_rawDescGZIP(), []int{0, 0} +} + +func (m *Composite_Part) GetElement() isComposite_Part_Element { + if m != nil { + return m.Element + } + return nil +} + +func (x *Composite_Part) GetPart() *EncodedContent { + if x, ok := x.GetElement().(*Composite_Part_Part); ok { + return x.Part + } + return nil +} + +func (x *Composite_Part) GetComposite() *Composite { + if x, ok := x.GetElement().(*Composite_Part_Composite); ok { + return x.Composite + } + return nil +} + +type isComposite_Part_Element interface { + isComposite_Part_Element() +} + +type Composite_Part_Part struct { + Part *EncodedContent `protobuf:"bytes,1,opt,name=part,proto3,oneof"` +} + +type Composite_Part_Composite struct { + Composite *Composite `protobuf:"bytes,2,opt,name=composite,proto3,oneof"` +} + +func (*Composite_Part_Part) isComposite_Part_Element() {} + +func (*Composite_Part_Composite) isComposite_Part_Element() {} + +var File_message_contents_composite_proto protoreflect.FileDescriptor + +var file_message_contents_composite_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x1e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdb, 0x01, 0x0a, 0x09, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, + 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x52, 0x05, 0x70, + 0x61, 0x72, 0x74, 0x73, 0x1a, 0x90, 0x01, 0x0a, 0x04, 0x50, 0x61, 0x72, 0x74, 0x12, 0x3b, 0x0a, + 0x04, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x48, 0x00, 0x52, 0x04, 0x70, 0x61, 0x72, 0x74, 0x12, 0x40, 0x0a, 0x09, 0x63, 0x6f, + 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x48, + 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, + 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0xd5, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, + 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, + 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_composite_proto_rawDescOnce sync.Once + file_message_contents_composite_proto_rawDescData = file_message_contents_composite_proto_rawDesc +) + +func file_message_contents_composite_proto_rawDescGZIP() []byte { + file_message_contents_composite_proto_rawDescOnce.Do(func() { + file_message_contents_composite_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_composite_proto_rawDescData) + }) + return file_message_contents_composite_proto_rawDescData +} + +var file_message_contents_composite_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_message_contents_composite_proto_goTypes = []interface{}{ + (*Composite)(nil), // 0: xmtp.message_contents.Composite + (*Composite_Part)(nil), // 1: xmtp.message_contents.Composite.Part + (*EncodedContent)(nil), // 2: xmtp.message_contents.EncodedContent +} +var file_message_contents_composite_proto_depIdxs = []int32{ + 1, // 0: xmtp.message_contents.Composite.parts:type_name -> xmtp.message_contents.Composite.Part + 2, // 1: xmtp.message_contents.Composite.Part.part:type_name -> xmtp.message_contents.EncodedContent + 0, // 2: xmtp.message_contents.Composite.Part.composite:type_name -> xmtp.message_contents.Composite + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_message_contents_composite_proto_init() } +func file_message_contents_composite_proto_init() { + if File_message_contents_composite_proto != nil { + return + } + file_message_contents_content_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_composite_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Composite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_composite_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Composite_Part); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_composite_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Composite_Part_Part)(nil), + (*Composite_Part_Composite)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_composite_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_composite_proto_goTypes, + DependencyIndexes: file_message_contents_composite_proto_depIdxs, + MessageInfos: file_message_contents_composite_proto_msgTypes, + }.Build() + File_message_contents_composite_proto = out.File + file_message_contents_composite_proto_rawDesc = nil + file_message_contents_composite_proto_goTypes = nil + file_message_contents_composite_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/contact.pb.go b/pkg/proto/message_contents/contact.pb.go new file mode 100644 index 00000000..834a08e2 --- /dev/null +++ b/pkg/proto/message_contents/contact.pb.go @@ -0,0 +1,352 @@ +// Contact Bundles are used to advertise user's public keys on the network. +// They are published in well known topics so that other participants +// can find them when they wish to communicate with the user. +// The public keys are used to sign messages and to derive encryption keys +// for some meta-messages, e.g. invitations. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/contact.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// LEGACY: User key bundle V1 using PublicKeys. +// The PublicKeys MUST be signed. +type ContactBundleV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyBundle *PublicKeyBundle `protobuf:"bytes,1,opt,name=key_bundle,json=keyBundle,proto3" json:"key_bundle,omitempty"` +} + +func (x *ContactBundleV1) Reset() { + *x = ContactBundleV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_contact_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContactBundleV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactBundleV1) ProtoMessage() {} + +func (x *ContactBundleV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_contact_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContactBundleV1.ProtoReflect.Descriptor instead. +func (*ContactBundleV1) Descriptor() ([]byte, []int) { + return file_message_contents_contact_proto_rawDescGZIP(), []int{0} +} + +func (x *ContactBundleV1) GetKeyBundle() *PublicKeyBundle { + if x != nil { + return x.KeyBundle + } + return nil +} + +// User key bundle V2 using SignedPublicKeys. +type ContactBundleV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyBundle *SignedPublicKeyBundle `protobuf:"bytes,1,opt,name=key_bundle,json=keyBundle,proto3" json:"key_bundle,omitempty"` +} + +func (x *ContactBundleV2) Reset() { + *x = ContactBundleV2{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_contact_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContactBundleV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactBundleV2) ProtoMessage() {} + +func (x *ContactBundleV2) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_contact_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContactBundleV2.ProtoReflect.Descriptor instead. +func (*ContactBundleV2) Descriptor() ([]byte, []int) { + return file_message_contents_contact_proto_rawDescGZIP(), []int{1} +} + +func (x *ContactBundleV2) GetKeyBundle() *SignedPublicKeyBundle { + if x != nil { + return x.KeyBundle + } + return nil +} + +// Versioned ContactBundle +type ContactBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *ContactBundle_V1 + // *ContactBundle_V2 + Version isContactBundle_Version `protobuf_oneof:"version"` +} + +func (x *ContactBundle) Reset() { + *x = ContactBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_contact_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContactBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactBundle) ProtoMessage() {} + +func (x *ContactBundle) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_contact_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContactBundle.ProtoReflect.Descriptor instead. +func (*ContactBundle) Descriptor() ([]byte, []int) { + return file_message_contents_contact_proto_rawDescGZIP(), []int{2} +} + +func (m *ContactBundle) GetVersion() isContactBundle_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *ContactBundle) GetV1() *ContactBundleV1 { + if x, ok := x.GetVersion().(*ContactBundle_V1); ok { + return x.V1 + } + return nil +} + +func (x *ContactBundle) GetV2() *ContactBundleV2 { + if x, ok := x.GetVersion().(*ContactBundle_V2); ok { + return x.V2 + } + return nil +} + +type isContactBundle_Version interface { + isContactBundle_Version() +} + +type ContactBundle_V1 struct { + V1 *ContactBundleV1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +type ContactBundle_V2 struct { + V2 *ContactBundleV2 `protobuf:"bytes,2,opt,name=v2,proto3,oneof"` +} + +func (*ContactBundle_V1) isContactBundle_Version() {} + +func (*ContactBundle_V2) isContactBundle_Version() {} + +var File_message_contents_contact_proto protoreflect.FileDescriptor + +var file_message_contents_contact_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x0f, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, 0x12, 0x45, 0x0a, + 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x5e, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x42, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x32, 0x12, 0x4b, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x62, + 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, + 0x12, 0x38, 0x0a, 0x02, 0x76, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x42, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x56, 0x32, 0x48, 0x00, 0x52, 0x02, 0x76, 0x32, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, + 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, + 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, + 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_contact_proto_rawDescOnce sync.Once + file_message_contents_contact_proto_rawDescData = file_message_contents_contact_proto_rawDesc +) + +func file_message_contents_contact_proto_rawDescGZIP() []byte { + file_message_contents_contact_proto_rawDescOnce.Do(func() { + file_message_contents_contact_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_contact_proto_rawDescData) + }) + return file_message_contents_contact_proto_rawDescData +} + +var file_message_contents_contact_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_message_contents_contact_proto_goTypes = []interface{}{ + (*ContactBundleV1)(nil), // 0: xmtp.message_contents.ContactBundleV1 + (*ContactBundleV2)(nil), // 1: xmtp.message_contents.ContactBundleV2 + (*ContactBundle)(nil), // 2: xmtp.message_contents.ContactBundle + (*PublicKeyBundle)(nil), // 3: xmtp.message_contents.PublicKeyBundle + (*SignedPublicKeyBundle)(nil), // 4: xmtp.message_contents.SignedPublicKeyBundle +} +var file_message_contents_contact_proto_depIdxs = []int32{ + 3, // 0: xmtp.message_contents.ContactBundleV1.key_bundle:type_name -> xmtp.message_contents.PublicKeyBundle + 4, // 1: xmtp.message_contents.ContactBundleV2.key_bundle:type_name -> xmtp.message_contents.SignedPublicKeyBundle + 0, // 2: xmtp.message_contents.ContactBundle.v1:type_name -> xmtp.message_contents.ContactBundleV1 + 1, // 3: xmtp.message_contents.ContactBundle.v2:type_name -> xmtp.message_contents.ContactBundleV2 + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_message_contents_contact_proto_init() } +func file_message_contents_contact_proto_init() { + if File_message_contents_contact_proto != nil { + return + } + file_message_contents_public_key_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_contact_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContactBundleV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_contact_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContactBundleV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_contact_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContactBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_contact_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*ContactBundle_V1)(nil), + (*ContactBundle_V2)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_contact_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_contact_proto_goTypes, + DependencyIndexes: file_message_contents_contact_proto_depIdxs, + MessageInfos: file_message_contents_contact_proto_msgTypes, + }.Build() + File_message_contents_contact_proto = out.File + file_message_contents_contact_proto_rawDesc = nil + file_message_contents_contact_proto_goTypes = nil + file_message_contents_contact_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/content.pb.go b/pkg/proto/message_contents/content.pb.go new file mode 100644 index 00000000..d249abe0 --- /dev/null +++ b/pkg/proto/message_contents/content.pb.go @@ -0,0 +1,479 @@ +// Message content encoding structures + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/content.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Recognized compression algorithms +// protolint:disable ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH +type Compression int32 + +const ( + Compression_COMPRESSION_DEFLATE Compression = 0 + Compression_COMPRESSION_GZIP Compression = 1 +) + +// Enum value maps for Compression. +var ( + Compression_name = map[int32]string{ + 0: "COMPRESSION_DEFLATE", + 1: "COMPRESSION_GZIP", + } + Compression_value = map[string]int32{ + "COMPRESSION_DEFLATE": 0, + "COMPRESSION_GZIP": 1, + } +) + +func (x Compression) Enum() *Compression { + p := new(Compression) + *p = x + return p +} + +func (x Compression) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Compression) Descriptor() protoreflect.EnumDescriptor { + return file_message_contents_content_proto_enumTypes[0].Descriptor() +} + +func (Compression) Type() protoreflect.EnumType { + return &file_message_contents_content_proto_enumTypes[0] +} + +func (x Compression) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Compression.Descriptor instead. +func (Compression) EnumDescriptor() ([]byte, []int) { + return file_message_contents_content_proto_rawDescGZIP(), []int{0} +} + +// ContentTypeId is used to identify the type of content stored in a Message. +type ContentTypeId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuthorityId string `protobuf:"bytes,1,opt,name=authority_id,json=authorityId,proto3" json:"authority_id,omitempty"` // authority governing this content type + TypeId string `protobuf:"bytes,2,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` // type identifier + VersionMajor uint32 `protobuf:"varint,3,opt,name=version_major,json=versionMajor,proto3" json:"version_major,omitempty"` // major version of the type + VersionMinor uint32 `protobuf:"varint,4,opt,name=version_minor,json=versionMinor,proto3" json:"version_minor,omitempty"` // minor version of the type +} + +func (x *ContentTypeId) Reset() { + *x = ContentTypeId{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_content_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContentTypeId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContentTypeId) ProtoMessage() {} + +func (x *ContentTypeId) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_content_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContentTypeId.ProtoReflect.Descriptor instead. +func (*ContentTypeId) Descriptor() ([]byte, []int) { + return file_message_contents_content_proto_rawDescGZIP(), []int{0} +} + +func (x *ContentTypeId) GetAuthorityId() string { + if x != nil { + return x.AuthorityId + } + return "" +} + +func (x *ContentTypeId) GetTypeId() string { + if x != nil { + return x.TypeId + } + return "" +} + +func (x *ContentTypeId) GetVersionMajor() uint32 { + if x != nil { + return x.VersionMajor + } + return 0 +} + +func (x *ContentTypeId) GetVersionMinor() uint32 { + if x != nil { + return x.VersionMinor + } + return 0 +} + +// EncodedContent bundles the content with metadata identifying its type +// and parameters required for correct decoding and presentation of the content. +type EncodedContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // content type identifier used to match the payload with + // the correct decoding machinery + Type *ContentTypeId `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // optional encoding parameters required to correctly decode the content + Parameters map[string]string `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // optional fallback description of the content that can be used in case + // the client cannot decode or render the content + Fallback *string `protobuf:"bytes,3,opt,name=fallback,proto3,oneof" json:"fallback,omitempty"` + // optional compression; the value indicates algorithm used to + // compress the encoded content bytes + Compression *Compression `protobuf:"varint,5,opt,name=compression,proto3,enum=xmtp.message_contents.Compression,oneof" json:"compression,omitempty"` + // encoded content itself + Content []byte `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *EncodedContent) Reset() { + *x = EncodedContent{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_content_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncodedContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncodedContent) ProtoMessage() {} + +func (x *EncodedContent) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_content_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncodedContent.ProtoReflect.Descriptor instead. +func (*EncodedContent) Descriptor() ([]byte, []int) { + return file_message_contents_content_proto_rawDescGZIP(), []int{1} +} + +func (x *EncodedContent) GetType() *ContentTypeId { + if x != nil { + return x.Type + } + return nil +} + +func (x *EncodedContent) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *EncodedContent) GetFallback() string { + if x != nil && x.Fallback != nil { + return *x.Fallback + } + return "" +} + +func (x *EncodedContent) GetCompression() Compression { + if x != nil && x.Compression != nil { + return *x.Compression + } + return Compression_COMPRESSION_DEFLATE +} + +func (x *EncodedContent) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +// SignedContent attaches a signature to EncodedContent. +type SignedContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // MUST contain EncodedContent + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Sender *SignedPublicKeyBundle `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // MUST be a signature of a concatenation of + // the message header bytes and the payload bytes, + // signed by the sender's pre-key. + Signature *Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedContent) Reset() { + *x = SignedContent{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_content_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedContent) ProtoMessage() {} + +func (x *SignedContent) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_content_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedContent.ProtoReflect.Descriptor instead. +func (*SignedContent) Descriptor() ([]byte, []int) { + return file_message_contents_content_proto_rawDescGZIP(), []int{2} +} + +func (x *SignedContent) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SignedContent) GetSender() *SignedPublicKeyBundle { + if x != nil { + return x.Sender + } + return nil +} + +func (x *SignedContent) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +var File_message_contents_content_proto protoreflect.FileDescriptor + +var file_message_contents_content_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, + 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x49, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x12, + 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6e, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, + 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x83, 0x03, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x55, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x61, 0x6c, 0x6c, + 0x62, 0x61, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x66, 0x61, + 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x49, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x48, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x3d, + 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0b, 0x0a, + 0x09, 0x5f, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xaf, 0x01, 0x0a, 0x0d, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x44, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2a, 0x3c, 0x0a, 0x0b, + 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x43, + 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x46, 0x4c, 0x41, + 0x54, 0x45, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, + 0x49, 0x4f, 0x4e, 0x5f, 0x47, 0x5a, 0x49, 0x50, 0x10, 0x01, 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, + 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, + 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, + 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, + 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_content_proto_rawDescOnce sync.Once + file_message_contents_content_proto_rawDescData = file_message_contents_content_proto_rawDesc +) + +func file_message_contents_content_proto_rawDescGZIP() []byte { + file_message_contents_content_proto_rawDescOnce.Do(func() { + file_message_contents_content_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_content_proto_rawDescData) + }) + return file_message_contents_content_proto_rawDescData +} + +var file_message_contents_content_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_message_contents_content_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_message_contents_content_proto_goTypes = []interface{}{ + (Compression)(0), // 0: xmtp.message_contents.Compression + (*ContentTypeId)(nil), // 1: xmtp.message_contents.ContentTypeId + (*EncodedContent)(nil), // 2: xmtp.message_contents.EncodedContent + (*SignedContent)(nil), // 3: xmtp.message_contents.SignedContent + nil, // 4: xmtp.message_contents.EncodedContent.ParametersEntry + (*SignedPublicKeyBundle)(nil), // 5: xmtp.message_contents.SignedPublicKeyBundle + (*Signature)(nil), // 6: xmtp.message_contents.Signature +} +var file_message_contents_content_proto_depIdxs = []int32{ + 1, // 0: xmtp.message_contents.EncodedContent.type:type_name -> xmtp.message_contents.ContentTypeId + 4, // 1: xmtp.message_contents.EncodedContent.parameters:type_name -> xmtp.message_contents.EncodedContent.ParametersEntry + 0, // 2: xmtp.message_contents.EncodedContent.compression:type_name -> xmtp.message_contents.Compression + 5, // 3: xmtp.message_contents.SignedContent.sender:type_name -> xmtp.message_contents.SignedPublicKeyBundle + 6, // 4: xmtp.message_contents.SignedContent.signature:type_name -> xmtp.message_contents.Signature + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_message_contents_content_proto_init() } +func file_message_contents_content_proto_init() { + if File_message_contents_content_proto != nil { + return + } + file_message_contents_public_key_proto_init() + file_message_contents_signature_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_content_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContentTypeId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_content_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncodedContent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_content_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedContent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_content_proto_msgTypes[1].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_content_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_content_proto_goTypes, + DependencyIndexes: file_message_contents_content_proto_depIdxs, + EnumInfos: file_message_contents_content_proto_enumTypes, + MessageInfos: file_message_contents_content_proto_msgTypes, + }.Build() + File_message_contents_content_proto = out.File + file_message_contents_content_proto_rawDesc = nil + file_message_contents_content_proto_goTypes = nil + file_message_contents_content_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/conversation_reference.pb.go b/pkg/proto/message_contents/conversation_reference.pb.go new file mode 100644 index 00000000..36821966 --- /dev/null +++ b/pkg/proto/message_contents/conversation_reference.pb.go @@ -0,0 +1,199 @@ +// Holds the ConversationReference + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/conversation_reference.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A light pointer for a conversation that contains no decryption keys +type ConversationReference struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` + PeerAddress string `protobuf:"bytes,2,opt,name=peer_address,json=peerAddress,proto3" json:"peer_address,omitempty"` + CreatedNs uint64 `protobuf:"varint,3,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + Context *InvitationV1_Context `protobuf:"bytes,4,opt,name=context,proto3" json:"context,omitempty"` +} + +func (x *ConversationReference) Reset() { + *x = ConversationReference{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_conversation_reference_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConversationReference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConversationReference) ProtoMessage() {} + +func (x *ConversationReference) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_conversation_reference_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConversationReference.ProtoReflect.Descriptor instead. +func (*ConversationReference) Descriptor() ([]byte, []int) { + return file_message_contents_conversation_reference_proto_rawDescGZIP(), []int{0} +} + +func (x *ConversationReference) GetTopic() string { + if x != nil { + return x.Topic + } + return "" +} + +func (x *ConversationReference) GetPeerAddress() string { + if x != nil { + return x.PeerAddress + } + return "" +} + +func (x *ConversationReference) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (x *ConversationReference) GetContext() *InvitationV1_Context { + if x != nil { + return x.Context + } + return nil +} + +var File_message_contents_conversation_reference_proto protoreflect.FileDescriptor + +var file_message_contents_conversation_reference_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x15, 0x43, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, 0x65, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x45, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x42, 0xe1, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x42, 0x1a, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, + 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, + 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_conversation_reference_proto_rawDescOnce sync.Once + file_message_contents_conversation_reference_proto_rawDescData = file_message_contents_conversation_reference_proto_rawDesc +) + +func file_message_contents_conversation_reference_proto_rawDescGZIP() []byte { + file_message_contents_conversation_reference_proto_rawDescOnce.Do(func() { + file_message_contents_conversation_reference_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_conversation_reference_proto_rawDescData) + }) + return file_message_contents_conversation_reference_proto_rawDescData +} + +var file_message_contents_conversation_reference_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_message_contents_conversation_reference_proto_goTypes = []interface{}{ + (*ConversationReference)(nil), // 0: xmtp.message_contents.ConversationReference + (*InvitationV1_Context)(nil), // 1: xmtp.message_contents.InvitationV1.Context +} +var file_message_contents_conversation_reference_proto_depIdxs = []int32{ + 1, // 0: xmtp.message_contents.ConversationReference.context:type_name -> xmtp.message_contents.InvitationV1.Context + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_message_contents_conversation_reference_proto_init() } +func file_message_contents_conversation_reference_proto_init() { + if File_message_contents_conversation_reference_proto != nil { + return + } + file_message_contents_invitation_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_conversation_reference_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConversationReference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_conversation_reference_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_conversation_reference_proto_goTypes, + DependencyIndexes: file_message_contents_conversation_reference_proto_depIdxs, + MessageInfos: file_message_contents_conversation_reference_proto_msgTypes, + }.Build() + File_message_contents_conversation_reference_proto = out.File + file_message_contents_conversation_reference_proto_rawDesc = nil + file_message_contents_conversation_reference_proto_goTypes = nil + file_message_contents_conversation_reference_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/ecies.pb.go b/pkg/proto/message_contents/ecies.pb.go new file mode 100644 index 00000000..233c80a6 --- /dev/null +++ b/pkg/proto/message_contents/ecies.pb.go @@ -0,0 +1,183 @@ +// ECIES is a wrapper for ECIES payloads + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/ecies.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EciesMessage is a wrapper for ECIES encrypted payloads +type EciesMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *EciesMessage_V1 + Version isEciesMessage_Version `protobuf_oneof:"version"` +} + +func (x *EciesMessage) Reset() { + *x = EciesMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_ecies_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EciesMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EciesMessage) ProtoMessage() {} + +func (x *EciesMessage) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_ecies_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EciesMessage.ProtoReflect.Descriptor instead. +func (*EciesMessage) Descriptor() ([]byte, []int) { + return file_message_contents_ecies_proto_rawDescGZIP(), []int{0} +} + +func (m *EciesMessage) GetVersion() isEciesMessage_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *EciesMessage) GetV1() []byte { + if x, ok := x.GetVersion().(*EciesMessage_V1); ok { + return x.V1 + } + return nil +} + +type isEciesMessage_Version interface { + isEciesMessage_Version() +} + +type EciesMessage_V1 struct { + // Expected to be an ECIES encrypted SignedPayload + V1 []byte `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*EciesMessage_V1) isEciesMessage_Version() {} + +var File_message_contents_ecies_proto protoreflect.FileDescriptor + +var file_message_contents_ecies_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x65, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2b, 0x0a, 0x0c, 0x45, 0x63, 0x69, 0x65, 0x73, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x42, 0xd1, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x42, 0x0a, 0x45, 0x63, 0x69, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, + 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, + 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_ecies_proto_rawDescOnce sync.Once + file_message_contents_ecies_proto_rawDescData = file_message_contents_ecies_proto_rawDesc +) + +func file_message_contents_ecies_proto_rawDescGZIP() []byte { + file_message_contents_ecies_proto_rawDescOnce.Do(func() { + file_message_contents_ecies_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_ecies_proto_rawDescData) + }) + return file_message_contents_ecies_proto_rawDescData +} + +var file_message_contents_ecies_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_message_contents_ecies_proto_goTypes = []interface{}{ + (*EciesMessage)(nil), // 0: xmtp.message_contents.EciesMessage +} +var file_message_contents_ecies_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_message_contents_ecies_proto_init() } +func file_message_contents_ecies_proto_init() { + if File_message_contents_ecies_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_contents_ecies_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EciesMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_ecies_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*EciesMessage_V1)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_ecies_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_ecies_proto_goTypes, + DependencyIndexes: file_message_contents_ecies_proto_depIdxs, + MessageInfos: file_message_contents_ecies_proto_msgTypes, + }.Build() + File_message_contents_ecies_proto = out.File + file_message_contents_ecies_proto_rawDesc = nil + file_message_contents_ecies_proto_goTypes = nil + file_message_contents_ecies_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/invitation.pb.go b/pkg/proto/message_contents/invitation.pb.go new file mode 100644 index 00000000..92d9b81f --- /dev/null +++ b/pkg/proto/message_contents/invitation.pb.go @@ -0,0 +1,651 @@ +// Invitation is used by an initiator to invite participants +// into a new conversation. Invitation carries the chosen topic name +// and encryption scheme and key material to be used for message encryption. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/invitation.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Unsealed invitation V1 +type InvitationV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // topic name chosen for this conversation. + // It MUST be randomly generated bytes (length >= 32), + // then base64 encoded without padding + Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` + // A context object defining metadata + Context *InvitationV1_Context `protobuf:"bytes,2,opt,name=context,proto3" json:"context,omitempty"` + // message encryption scheme and keys for this conversation. + // + // Types that are assignable to Encryption: + // + // *InvitationV1_Aes256GcmHkdfSha256 + Encryption isInvitationV1_Encryption `protobuf_oneof:"encryption"` +} + +func (x *InvitationV1) Reset() { + *x = InvitationV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_invitation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvitationV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvitationV1) ProtoMessage() {} + +func (x *InvitationV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_invitation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InvitationV1.ProtoReflect.Descriptor instead. +func (*InvitationV1) Descriptor() ([]byte, []int) { + return file_message_contents_invitation_proto_rawDescGZIP(), []int{0} +} + +func (x *InvitationV1) GetTopic() string { + if x != nil { + return x.Topic + } + return "" +} + +func (x *InvitationV1) GetContext() *InvitationV1_Context { + if x != nil { + return x.Context + } + return nil +} + +func (m *InvitationV1) GetEncryption() isInvitationV1_Encryption { + if m != nil { + return m.Encryption + } + return nil +} + +func (x *InvitationV1) GetAes256GcmHkdfSha256() *InvitationV1_Aes256GcmHkdfsha256 { + if x, ok := x.GetEncryption().(*InvitationV1_Aes256GcmHkdfSha256); ok { + return x.Aes256GcmHkdfSha256 + } + return nil +} + +type isInvitationV1_Encryption interface { + isInvitationV1_Encryption() +} + +type InvitationV1_Aes256GcmHkdfSha256 struct { + // Specify the encryption method to process the key material properly. + Aes256GcmHkdfSha256 *InvitationV1_Aes256GcmHkdfsha256 `protobuf:"bytes,3,opt,name=aes256_gcm_hkdf_sha256,json=aes256GcmHkdfSha256,proto3,oneof"` +} + +func (*InvitationV1_Aes256GcmHkdfSha256) isInvitationV1_Encryption() {} + +// Sealed Invitation V1 Header +// Header carries information that is unencrypted, thus readable by the network +// it is however authenticated as associated data with the AEAD scheme used +// to encrypt the invitation body, thus providing tamper evidence. +type SealedInvitationHeaderV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender *SignedPublicKeyBundle `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient *SignedPublicKeyBundle `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + CreatedNs uint64 `protobuf:"varint,3,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` +} + +func (x *SealedInvitationHeaderV1) Reset() { + *x = SealedInvitationHeaderV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_invitation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SealedInvitationHeaderV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SealedInvitationHeaderV1) ProtoMessage() {} + +func (x *SealedInvitationHeaderV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_invitation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SealedInvitationHeaderV1.ProtoReflect.Descriptor instead. +func (*SealedInvitationHeaderV1) Descriptor() ([]byte, []int) { + return file_message_contents_invitation_proto_rawDescGZIP(), []int{1} +} + +func (x *SealedInvitationHeaderV1) GetSender() *SignedPublicKeyBundle { + if x != nil { + return x.Sender + } + return nil +} + +func (x *SealedInvitationHeaderV1) GetRecipient() *SignedPublicKeyBundle { + if x != nil { + return x.Recipient + } + return nil +} + +func (x *SealedInvitationHeaderV1) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +// Sealed Invitation V1 +// Invitation encrypted with key material derived from the sender's and +// recipient's public key bundles using simplified X3DH where +// the sender's ephemeral key is replaced with sender's pre-key. +type SealedInvitationV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // encoded SealedInvitationHeaderV1 used as associated data for Ciphertext + HeaderBytes []byte `protobuf:"bytes,1,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` + // Ciphertext.payload MUST contain encrypted InvitationV1. + Ciphertext *Ciphertext `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` +} + +func (x *SealedInvitationV1) Reset() { + *x = SealedInvitationV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_invitation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SealedInvitationV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SealedInvitationV1) ProtoMessage() {} + +func (x *SealedInvitationV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_invitation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SealedInvitationV1.ProtoReflect.Descriptor instead. +func (*SealedInvitationV1) Descriptor() ([]byte, []int) { + return file_message_contents_invitation_proto_rawDescGZIP(), []int{2} +} + +func (x *SealedInvitationV1) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +func (x *SealedInvitationV1) GetCiphertext() *Ciphertext { + if x != nil { + return x.Ciphertext + } + return nil +} + +// Versioned Sealed Invitation +type SealedInvitation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *SealedInvitation_V1 + Version isSealedInvitation_Version `protobuf_oneof:"version"` +} + +func (x *SealedInvitation) Reset() { + *x = SealedInvitation{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_invitation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SealedInvitation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SealedInvitation) ProtoMessage() {} + +func (x *SealedInvitation) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_invitation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SealedInvitation.ProtoReflect.Descriptor instead. +func (*SealedInvitation) Descriptor() ([]byte, []int) { + return file_message_contents_invitation_proto_rawDescGZIP(), []int{3} +} + +func (m *SealedInvitation) GetVersion() isSealedInvitation_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *SealedInvitation) GetV1() *SealedInvitationV1 { + if x, ok := x.GetVersion().(*SealedInvitation_V1); ok { + return x.V1 + } + return nil +} + +type isSealedInvitation_Version interface { + isSealedInvitation_Version() +} + +type SealedInvitation_V1 struct { + V1 *SealedInvitationV1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*SealedInvitation_V1) isSealedInvitation_Version() {} + +// Supported encryption schemes +// AES256-GCM-HKDF-SHA256 +type InvitationV1_Aes256GcmHkdfsha256 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyMaterial []byte `protobuf:"bytes,1,opt,name=key_material,json=keyMaterial,proto3" json:"key_material,omitempty"` // randomly generated key material (32 bytes) +} + +func (x *InvitationV1_Aes256GcmHkdfsha256) Reset() { + *x = InvitationV1_Aes256GcmHkdfsha256{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_invitation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvitationV1_Aes256GcmHkdfsha256) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvitationV1_Aes256GcmHkdfsha256) ProtoMessage() {} + +func (x *InvitationV1_Aes256GcmHkdfsha256) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_invitation_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InvitationV1_Aes256GcmHkdfsha256.ProtoReflect.Descriptor instead. +func (*InvitationV1_Aes256GcmHkdfsha256) Descriptor() ([]byte, []int) { + return file_message_contents_invitation_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *InvitationV1_Aes256GcmHkdfsha256) GetKeyMaterial() []byte { + if x != nil { + return x.KeyMaterial + } + return nil +} + +// The context type +type InvitationV1_Context struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Expected to be a URI (ie xmtp.org/convo1) + ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` + // Key value map of additional metadata that would be exposed to + // application developers and could be used for filtering + Metadata map[string]string `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *InvitationV1_Context) Reset() { + *x = InvitationV1_Context{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_invitation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvitationV1_Context) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvitationV1_Context) ProtoMessage() {} + +func (x *InvitationV1_Context) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_invitation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InvitationV1_Context.ProtoReflect.Descriptor instead. +func (*InvitationV1_Context) Descriptor() ([]byte, []int) { + return file_message_contents_invitation_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *InvitationV1_Context) GetConversationId() string { + if x != nil { + return x.ConversationId + } + return "" +} + +func (x *InvitationV1_Context) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +var File_message_contents_invitation_proto protoreflect.FileDescriptor + +var file_message_contents_invitation_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x69, 0x70, + 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xec, 0x03, 0x0a, 0x0c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x31, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x6e, + 0x0a, 0x16, 0x61, 0x65, 0x73, 0x32, 0x35, 0x36, 0x5f, 0x67, 0x63, 0x6d, 0x5f, 0x68, 0x6b, 0x64, + 0x66, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x31, 0x2e, 0x41, 0x65, 0x73, 0x32, 0x35, 0x36, 0x67, 0x63, 0x6d, 0x48, 0x6b, 0x64, + 0x66, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x48, 0x00, 0x52, 0x13, 0x61, 0x65, 0x73, 0x32, 0x35, + 0x36, 0x47, 0x63, 0x6d, 0x48, 0x6b, 0x64, 0x66, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x1a, 0x38, + 0x0a, 0x13, 0x41, 0x65, 0x73, 0x32, 0x35, 0x36, 0x67, 0x63, 0x6d, 0x48, 0x6b, 0x64, 0x66, 0x73, + 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x21, 0x0a, 0x0c, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6b, 0x65, 0x79, + 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x1a, 0xc6, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x55, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x39, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0xcb, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x31, 0x12, 0x44, 0x0a, 0x06, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, + 0x64, 0x6c, 0x65, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x22, 0x7a, 0x0a, + 0x12, 0x53, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x31, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0a, 0x63, + 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x22, 0x60, 0x0a, 0x10, 0x53, 0x65, 0x61, + 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, + 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x53, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x42, 0xd6, 0x01, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, + 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, + 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, + 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, + 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_invitation_proto_rawDescOnce sync.Once + file_message_contents_invitation_proto_rawDescData = file_message_contents_invitation_proto_rawDesc +) + +func file_message_contents_invitation_proto_rawDescGZIP() []byte { + file_message_contents_invitation_proto_rawDescOnce.Do(func() { + file_message_contents_invitation_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_invitation_proto_rawDescData) + }) + return file_message_contents_invitation_proto_rawDescData +} + +var file_message_contents_invitation_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_message_contents_invitation_proto_goTypes = []interface{}{ + (*InvitationV1)(nil), // 0: xmtp.message_contents.InvitationV1 + (*SealedInvitationHeaderV1)(nil), // 1: xmtp.message_contents.SealedInvitationHeaderV1 + (*SealedInvitationV1)(nil), // 2: xmtp.message_contents.SealedInvitationV1 + (*SealedInvitation)(nil), // 3: xmtp.message_contents.SealedInvitation + (*InvitationV1_Aes256GcmHkdfsha256)(nil), // 4: xmtp.message_contents.InvitationV1.Aes256gcmHkdfsha256 + (*InvitationV1_Context)(nil), // 5: xmtp.message_contents.InvitationV1.Context + nil, // 6: xmtp.message_contents.InvitationV1.Context.MetadataEntry + (*SignedPublicKeyBundle)(nil), // 7: xmtp.message_contents.SignedPublicKeyBundle + (*Ciphertext)(nil), // 8: xmtp.message_contents.Ciphertext +} +var file_message_contents_invitation_proto_depIdxs = []int32{ + 5, // 0: xmtp.message_contents.InvitationV1.context:type_name -> xmtp.message_contents.InvitationV1.Context + 4, // 1: xmtp.message_contents.InvitationV1.aes256_gcm_hkdf_sha256:type_name -> xmtp.message_contents.InvitationV1.Aes256gcmHkdfsha256 + 7, // 2: xmtp.message_contents.SealedInvitationHeaderV1.sender:type_name -> xmtp.message_contents.SignedPublicKeyBundle + 7, // 3: xmtp.message_contents.SealedInvitationHeaderV1.recipient:type_name -> xmtp.message_contents.SignedPublicKeyBundle + 8, // 4: xmtp.message_contents.SealedInvitationV1.ciphertext:type_name -> xmtp.message_contents.Ciphertext + 2, // 5: xmtp.message_contents.SealedInvitation.v1:type_name -> xmtp.message_contents.SealedInvitationV1 + 6, // 6: xmtp.message_contents.InvitationV1.Context.metadata:type_name -> xmtp.message_contents.InvitationV1.Context.MetadataEntry + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_message_contents_invitation_proto_init() } +func file_message_contents_invitation_proto_init() { + if File_message_contents_invitation_proto != nil { + return + } + file_message_contents_ciphertext_proto_init() + file_message_contents_public_key_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_invitation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvitationV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_invitation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SealedInvitationHeaderV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_invitation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SealedInvitationV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_invitation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SealedInvitation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_invitation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvitationV1_Aes256GcmHkdfsha256); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_invitation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvitationV1_Context); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_invitation_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*InvitationV1_Aes256GcmHkdfSha256)(nil), + } + file_message_contents_invitation_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*SealedInvitation_V1)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_invitation_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_invitation_proto_goTypes, + DependencyIndexes: file_message_contents_invitation_proto_depIdxs, + MessageInfos: file_message_contents_invitation_proto_msgTypes, + }.Build() + File_message_contents_invitation_proto = out.File + file_message_contents_invitation_proto_rawDesc = nil + file_message_contents_invitation_proto_goTypes = nil + file_message_contents_invitation_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/message.pb.go b/pkg/proto/message_contents/message.pb.go new file mode 100644 index 00000000..75d387ea --- /dev/null +++ b/pkg/proto/message_contents/message.pb.go @@ -0,0 +1,688 @@ +// Messages used for transport and storage of user conversations. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/message.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Message header is encoded separately as the bytes are also used +// as associated data for authenticated encryption +type MessageHeaderV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender *PublicKeyBundle `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient *PublicKeyBundle `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *MessageHeaderV1) Reset() { + *x = MessageHeaderV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_message_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageHeaderV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageHeaderV1) ProtoMessage() {} + +func (x *MessageHeaderV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_message_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageHeaderV1.ProtoReflect.Descriptor instead. +func (*MessageHeaderV1) Descriptor() ([]byte, []int) { + return file_message_contents_message_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageHeaderV1) GetSender() *PublicKeyBundle { + if x != nil { + return x.Sender + } + return nil +} + +func (x *MessageHeaderV1) GetRecipient() *PublicKeyBundle { + if x != nil { + return x.Recipient + } + return nil +} + +func (x *MessageHeaderV1) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +// Message is the top level protocol element +type MessageV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HeaderBytes []byte `protobuf:"bytes,1,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` // encapsulates encoded MessageHeaderV1 + // Ciphertext.payload MUST contain encrypted EncodedContent + Ciphertext *Ciphertext `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` +} + +func (x *MessageV1) Reset() { + *x = MessageV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_message_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageV1) ProtoMessage() {} + +func (x *MessageV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_message_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageV1.ProtoReflect.Descriptor instead. +func (*MessageV1) Descriptor() ([]byte, []int) { + return file_message_contents_message_proto_rawDescGZIP(), []int{1} +} + +func (x *MessageV1) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +func (x *MessageV1) GetCiphertext() *Ciphertext { + if x != nil { + return x.Ciphertext + } + return nil +} + +// Message header carries information that is not encrypted, and is therefore +// observable by the network. It is however authenticated as associated data +// of the AEAD encryption used to protect the message, +// thus providing tamper evidence. +type MessageHeaderV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // sender specified message creation time + CreatedNs uint64 `protobuf:"varint,1,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + // the topic the message belongs to + Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"` +} + +func (x *MessageHeaderV2) Reset() { + *x = MessageHeaderV2{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_message_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageHeaderV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageHeaderV2) ProtoMessage() {} + +func (x *MessageHeaderV2) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_message_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageHeaderV2.ProtoReflect.Descriptor instead. +func (*MessageHeaderV2) Descriptor() ([]byte, []int) { + return file_message_contents_message_proto_rawDescGZIP(), []int{2} +} + +func (x *MessageHeaderV2) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (x *MessageHeaderV2) GetTopic() string { + if x != nil { + return x.Topic + } + return "" +} + +// Message combines the encoded header with the encrypted payload. +type MessageV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HeaderBytes []byte `protobuf:"bytes,1,opt,name=header_bytes,json=headerBytes,proto3" json:"header_bytes,omitempty"` // encapsulates encoded MessageHeaderV2 + // Ciphertext.payload MUST contain encrypted SignedContent + Ciphertext *Ciphertext `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` +} + +func (x *MessageV2) Reset() { + *x = MessageV2{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_message_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageV2) ProtoMessage() {} + +func (x *MessageV2) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_message_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageV2.ProtoReflect.Descriptor instead. +func (*MessageV2) Descriptor() ([]byte, []int) { + return file_message_contents_message_proto_rawDescGZIP(), []int{3} +} + +func (x *MessageV2) GetHeaderBytes() []byte { + if x != nil { + return x.HeaderBytes + } + return nil +} + +func (x *MessageV2) GetCiphertext() *Ciphertext { + if x != nil { + return x.Ciphertext + } + return nil +} + +// Versioned Message +type Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *Message_V1 + // *Message_V2 + Version isMessage_Version `protobuf_oneof:"version"` +} + +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_message_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_message_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_message_contents_message_proto_rawDescGZIP(), []int{4} +} + +func (m *Message) GetVersion() isMessage_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *Message) GetV1() *MessageV1 { + if x, ok := x.GetVersion().(*Message_V1); ok { + return x.V1 + } + return nil +} + +func (x *Message) GetV2() *MessageV2 { + if x, ok := x.GetVersion().(*Message_V2); ok { + return x.V2 + } + return nil +} + +type isMessage_Version interface { + isMessage_Version() +} + +type Message_V1 struct { + V1 *MessageV1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +type Message_V2 struct { + V2 *MessageV2 `protobuf:"bytes,2,opt,name=v2,proto3,oneof"` +} + +func (*Message_V1) isMessage_Version() {} + +func (*Message_V2) isMessage_Version() {} + +// DecodedMessage represents the decrypted message contents. +// DecodedMessage instances are not stored on the network, but +// may be serialized and stored by clients +type DecodedMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + MessageVersion string `protobuf:"bytes,2,opt,name=message_version,json=messageVersion,proto3" json:"message_version,omitempty"` + SenderAddress string `protobuf:"bytes,3,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` + RecipientAddress *string `protobuf:"bytes,4,opt,name=recipient_address,json=recipientAddress,proto3,oneof" json:"recipient_address,omitempty"` + SentNs uint64 `protobuf:"varint,5,opt,name=sent_ns,json=sentNs,proto3" json:"sent_ns,omitempty"` + ContentTopic string `protobuf:"bytes,6,opt,name=content_topic,json=contentTopic,proto3" json:"content_topic,omitempty"` + Conversation *ConversationReference `protobuf:"bytes,7,opt,name=conversation,proto3" json:"conversation,omitempty"` + ContentBytes []byte `protobuf:"bytes,8,opt,name=content_bytes,json=contentBytes,proto3" json:"content_bytes,omitempty"` // encapsulates EncodedContent +} + +func (x *DecodedMessage) Reset() { + *x = DecodedMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_message_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecodedMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecodedMessage) ProtoMessage() {} + +func (x *DecodedMessage) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_message_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecodedMessage.ProtoReflect.Descriptor instead. +func (*DecodedMessage) Descriptor() ([]byte, []int) { + return file_message_contents_message_proto_rawDescGZIP(), []int{5} +} + +func (x *DecodedMessage) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DecodedMessage) GetMessageVersion() string { + if x != nil { + return x.MessageVersion + } + return "" +} + +func (x *DecodedMessage) GetSenderAddress() string { + if x != nil { + return x.SenderAddress + } + return "" +} + +func (x *DecodedMessage) GetRecipientAddress() string { + if x != nil && x.RecipientAddress != nil { + return *x.RecipientAddress + } + return "" +} + +func (x *DecodedMessage) GetSentNs() uint64 { + if x != nil { + return x.SentNs + } + return 0 +} + +func (x *DecodedMessage) GetContentTopic() string { + if x != nil { + return x.ContentTopic + } + return "" +} + +func (x *DecodedMessage) GetConversation() *ConversationReference { + if x != nil { + return x.Conversation + } + return nil +} + +func (x *DecodedMessage) GetContentBytes() []byte { + if x != nil { + return x.ContentBytes + } + return nil +} + +var File_message_contents_message_proto protoreflect.FileDescriptor + +var file_message_contents_message_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, + 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x01, 0x0a, + 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x31, + 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x12, 0x44, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x09, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x22, 0x71, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, + 0x31, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0a, 0x63, 0x69, 0x70, + 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x22, 0x46, 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x32, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x22, + 0x71, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, 0x32, 0x12, 0x21, 0x0a, 0x0c, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x41, 0x0a, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, + 0x78, 0x74, 0x22, 0x7c, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, + 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, + 0x31, 0x12, 0x32, 0x0a, 0x02, 0x76, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, 0x32, 0x48, + 0x00, 0x52, 0x02, 0x76, 0x32, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x22, 0xed, 0x02, 0x0a, 0x0e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x30, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x73, 0x12, 0x23, + 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x6f, + 0x70, 0x69, 0x63, 0x12, 0x50, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0c, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, + 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, + 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_message_proto_rawDescOnce sync.Once + file_message_contents_message_proto_rawDescData = file_message_contents_message_proto_rawDesc +) + +func file_message_contents_message_proto_rawDescGZIP() []byte { + file_message_contents_message_proto_rawDescOnce.Do(func() { + file_message_contents_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_message_proto_rawDescData) + }) + return file_message_contents_message_proto_rawDescData +} + +var file_message_contents_message_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_message_contents_message_proto_goTypes = []interface{}{ + (*MessageHeaderV1)(nil), // 0: xmtp.message_contents.MessageHeaderV1 + (*MessageV1)(nil), // 1: xmtp.message_contents.MessageV1 + (*MessageHeaderV2)(nil), // 2: xmtp.message_contents.MessageHeaderV2 + (*MessageV2)(nil), // 3: xmtp.message_contents.MessageV2 + (*Message)(nil), // 4: xmtp.message_contents.Message + (*DecodedMessage)(nil), // 5: xmtp.message_contents.DecodedMessage + (*PublicKeyBundle)(nil), // 6: xmtp.message_contents.PublicKeyBundle + (*Ciphertext)(nil), // 7: xmtp.message_contents.Ciphertext + (*ConversationReference)(nil), // 8: xmtp.message_contents.ConversationReference +} +var file_message_contents_message_proto_depIdxs = []int32{ + 6, // 0: xmtp.message_contents.MessageHeaderV1.sender:type_name -> xmtp.message_contents.PublicKeyBundle + 6, // 1: xmtp.message_contents.MessageHeaderV1.recipient:type_name -> xmtp.message_contents.PublicKeyBundle + 7, // 2: xmtp.message_contents.MessageV1.ciphertext:type_name -> xmtp.message_contents.Ciphertext + 7, // 3: xmtp.message_contents.MessageV2.ciphertext:type_name -> xmtp.message_contents.Ciphertext + 1, // 4: xmtp.message_contents.Message.v1:type_name -> xmtp.message_contents.MessageV1 + 3, // 5: xmtp.message_contents.Message.v2:type_name -> xmtp.message_contents.MessageV2 + 8, // 6: xmtp.message_contents.DecodedMessage.conversation:type_name -> xmtp.message_contents.ConversationReference + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_message_contents_message_proto_init() } +func file_message_contents_message_proto_init() { + if File_message_contents_message_proto != nil { + return + } + file_message_contents_ciphertext_proto_init() + file_message_contents_conversation_reference_proto_init() + file_message_contents_public_key_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageHeaderV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageHeaderV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecodedMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_message_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*Message_V1)(nil), + (*Message_V2)(nil), + } + file_message_contents_message_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_message_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_message_proto_goTypes, + DependencyIndexes: file_message_contents_message_proto_depIdxs, + MessageInfos: file_message_contents_message_proto_msgTypes, + }.Build() + File_message_contents_message_proto = out.File + file_message_contents_message_proto_rawDesc = nil + file_message_contents_message_proto_goTypes = nil + file_message_contents_message_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/private_key.pb.go b/pkg/proto/message_contents/private_key.pb.go new file mode 100644 index 00000000..7ae8216e --- /dev/null +++ b/pkg/proto/message_contents/private_key.pb.go @@ -0,0 +1,925 @@ +// Private Key Storage +// +// Following definitions are not used in the protocol, instead +// they provide a way for encoding private keys for storage. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/private_key.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PrivateKey generalized to support different key types +type SignedPrivateKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // time the key was created + CreatedNs uint64 `protobuf:"varint,1,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + // private key + // + // Types that are assignable to Union: + // + // *SignedPrivateKey_Secp256K1_ + Union isSignedPrivateKey_Union `protobuf_oneof:"union"` + // public key for this private key + PublicKey *SignedPublicKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *SignedPrivateKey) Reset() { + *x = SignedPrivateKey{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedPrivateKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedPrivateKey) ProtoMessage() {} + +func (x *SignedPrivateKey) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedPrivateKey.ProtoReflect.Descriptor instead. +func (*SignedPrivateKey) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedPrivateKey) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (m *SignedPrivateKey) GetUnion() isSignedPrivateKey_Union { + if m != nil { + return m.Union + } + return nil +} + +func (x *SignedPrivateKey) GetSecp256K1() *SignedPrivateKey_Secp256K1 { + if x, ok := x.GetUnion().(*SignedPrivateKey_Secp256K1_); ok { + return x.Secp256K1 + } + return nil +} + +func (x *SignedPrivateKey) GetPublicKey() *SignedPublicKey { + if x != nil { + return x.PublicKey + } + return nil +} + +type isSignedPrivateKey_Union interface { + isSignedPrivateKey_Union() +} + +type SignedPrivateKey_Secp256K1_ struct { + Secp256K1 *SignedPrivateKey_Secp256K1 `protobuf:"bytes,2,opt,name=secp256k1,proto3,oneof"` +} + +func (*SignedPrivateKey_Secp256K1_) isSignedPrivateKey_Union() {} + +// PrivateKeyBundle wraps the identityKey and the preKeys, +// enforces usage of signed keys. +type PrivateKeyBundleV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdentityKey *SignedPrivateKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // all the known pre-keys, newer keys first, + PreKeys []*SignedPrivateKey `protobuf:"bytes,2,rep,name=pre_keys,json=preKeys,proto3" json:"pre_keys,omitempty"` +} + +func (x *PrivateKeyBundleV2) Reset() { + *x = PrivateKeyBundleV2{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivateKeyBundleV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateKeyBundleV2) ProtoMessage() {} + +func (x *PrivateKeyBundleV2) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateKeyBundleV2.ProtoReflect.Descriptor instead. +func (*PrivateKeyBundleV2) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{1} +} + +func (x *PrivateKeyBundleV2) GetIdentityKey() *SignedPrivateKey { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *PrivateKeyBundleV2) GetPreKeys() []*SignedPrivateKey { + if x != nil { + return x.PreKeys + } + return nil +} + +// LEGACY: PrivateKey generalized to support different key types +type PrivateKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // time the key was created + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // private key + // + // Types that are assignable to Union: + // + // *PrivateKey_Secp256K1_ + Union isPrivateKey_Union `protobuf_oneof:"union"` + // public key for this private key + PublicKey *PublicKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *PrivateKey) Reset() { + *x = PrivateKey{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivateKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateKey) ProtoMessage() {} + +func (x *PrivateKey) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateKey.ProtoReflect.Descriptor instead. +func (*PrivateKey) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{2} +} + +func (x *PrivateKey) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (m *PrivateKey) GetUnion() isPrivateKey_Union { + if m != nil { + return m.Union + } + return nil +} + +func (x *PrivateKey) GetSecp256K1() *PrivateKey_Secp256K1 { + if x, ok := x.GetUnion().(*PrivateKey_Secp256K1_); ok { + return x.Secp256K1 + } + return nil +} + +func (x *PrivateKey) GetPublicKey() *PublicKey { + if x != nil { + return x.PublicKey + } + return nil +} + +type isPrivateKey_Union interface { + isPrivateKey_Union() +} + +type PrivateKey_Secp256K1_ struct { + Secp256K1 *PrivateKey_Secp256K1 `protobuf:"bytes,2,opt,name=secp256k1,proto3,oneof"` +} + +func (*PrivateKey_Secp256K1_) isPrivateKey_Union() {} + +// LEGACY: PrivateKeyBundleV1 wraps the identityKey and the preKeys +type PrivateKeyBundleV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdentityKey *PrivateKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // all the known pre-keys, newer keys first, + PreKeys []*PrivateKey `protobuf:"bytes,2,rep,name=pre_keys,json=preKeys,proto3" json:"pre_keys,omitempty"` +} + +func (x *PrivateKeyBundleV1) Reset() { + *x = PrivateKeyBundleV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivateKeyBundleV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateKeyBundleV1) ProtoMessage() {} + +func (x *PrivateKeyBundleV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateKeyBundleV1.ProtoReflect.Descriptor instead. +func (*PrivateKeyBundleV1) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{3} +} + +func (x *PrivateKeyBundleV1) GetIdentityKey() *PrivateKey { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *PrivateKeyBundleV1) GetPreKeys() []*PrivateKey { + if x != nil { + return x.PreKeys + } + return nil +} + +// Versioned PrivateKeyBundle +type PrivateKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *PrivateKeyBundle_V1 + // *PrivateKeyBundle_V2 + Version isPrivateKeyBundle_Version `protobuf_oneof:"version"` +} + +func (x *PrivateKeyBundle) Reset() { + *x = PrivateKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivateKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateKeyBundle) ProtoMessage() {} + +func (x *PrivateKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateKeyBundle.ProtoReflect.Descriptor instead. +func (*PrivateKeyBundle) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{4} +} + +func (m *PrivateKeyBundle) GetVersion() isPrivateKeyBundle_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *PrivateKeyBundle) GetV1() *PrivateKeyBundleV1 { + if x, ok := x.GetVersion().(*PrivateKeyBundle_V1); ok { + return x.V1 + } + return nil +} + +func (x *PrivateKeyBundle) GetV2() *PrivateKeyBundleV2 { + if x, ok := x.GetVersion().(*PrivateKeyBundle_V2); ok { + return x.V2 + } + return nil +} + +type isPrivateKeyBundle_Version interface { + isPrivateKeyBundle_Version() +} + +type PrivateKeyBundle_V1 struct { + V1 *PrivateKeyBundleV1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +type PrivateKeyBundle_V2 struct { + V2 *PrivateKeyBundleV2 `protobuf:"bytes,2,opt,name=v2,proto3,oneof"` +} + +func (*PrivateKeyBundle_V1) isPrivateKeyBundle_Version() {} + +func (*PrivateKeyBundle_V2) isPrivateKeyBundle_Version() {} + +// PrivateKeyBundle encrypted with key material generated by +// signing a randomly generated "pre-key" with the user's wallet, +// i.e. EIP-191 signature of a "storage signature" message with +// the pre-key embedded in it. +// (see xmtp-js::PrivateKeyBundle.toEncryptedBytes for details) +type EncryptedPrivateKeyBundleV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // randomly generated pre-key + WalletPreKey []byte `protobuf:"bytes,1,opt,name=wallet_pre_key,json=walletPreKey,proto3" json:"wallet_pre_key,omitempty"` // 32 bytes + // MUST contain encrypted PrivateKeyBundle + Ciphertext *Ciphertext `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` +} + +func (x *EncryptedPrivateKeyBundleV1) Reset() { + *x = EncryptedPrivateKeyBundleV1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptedPrivateKeyBundleV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptedPrivateKeyBundleV1) ProtoMessage() {} + +func (x *EncryptedPrivateKeyBundleV1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptedPrivateKeyBundleV1.ProtoReflect.Descriptor instead. +func (*EncryptedPrivateKeyBundleV1) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{5} +} + +func (x *EncryptedPrivateKeyBundleV1) GetWalletPreKey() []byte { + if x != nil { + return x.WalletPreKey + } + return nil +} + +func (x *EncryptedPrivateKeyBundleV1) GetCiphertext() *Ciphertext { + if x != nil { + return x.Ciphertext + } + return nil +} + +// Versioned encrypted PrivateKeyBundle +type EncryptedPrivateKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *EncryptedPrivateKeyBundle_V1 + Version isEncryptedPrivateKeyBundle_Version `protobuf_oneof:"version"` +} + +func (x *EncryptedPrivateKeyBundle) Reset() { + *x = EncryptedPrivateKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncryptedPrivateKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncryptedPrivateKeyBundle) ProtoMessage() {} + +func (x *EncryptedPrivateKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncryptedPrivateKeyBundle.ProtoReflect.Descriptor instead. +func (*EncryptedPrivateKeyBundle) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{6} +} + +func (m *EncryptedPrivateKeyBundle) GetVersion() isEncryptedPrivateKeyBundle_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *EncryptedPrivateKeyBundle) GetV1() *EncryptedPrivateKeyBundleV1 { + if x, ok := x.GetVersion().(*EncryptedPrivateKeyBundle_V1); ok { + return x.V1 + } + return nil +} + +type isEncryptedPrivateKeyBundle_Version interface { + isEncryptedPrivateKeyBundle_Version() +} + +type EncryptedPrivateKeyBundle_V1 struct { + V1 *EncryptedPrivateKeyBundleV1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*EncryptedPrivateKeyBundle_V1) isEncryptedPrivateKeyBundle_Version() {} + +// EC: SECP256k1 +type SignedPrivateKey_Secp256K1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` // D big-endian, 32 bytes +} + +func (x *SignedPrivateKey_Secp256K1) Reset() { + *x = SignedPrivateKey_Secp256K1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedPrivateKey_Secp256K1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedPrivateKey_Secp256K1) ProtoMessage() {} + +func (x *SignedPrivateKey_Secp256K1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedPrivateKey_Secp256K1.ProtoReflect.Descriptor instead. +func (*SignedPrivateKey_Secp256K1) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *SignedPrivateKey_Secp256K1) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +// EC: SECP256k1 +type PrivateKey_Secp256K1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` // D big-endian, 32 bytes +} + +func (x *PrivateKey_Secp256K1) Reset() { + *x = PrivateKey_Secp256K1{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_key_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivateKey_Secp256K1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateKey_Secp256K1) ProtoMessage() {} + +func (x *PrivateKey_Secp256K1) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_key_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateKey_Secp256K1.ProtoReflect.Descriptor instead. +func (*PrivateKey_Secp256K1) Descriptor() ([]byte, []int) { + return file_message_contents_private_key_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *PrivateKey_Secp256K1) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +var File_message_contents_private_key_proto protoreflect.FileDescriptor + +var file_message_contents_private_key_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x69, + 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xf7, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x51, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, + 0x6b, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x2e, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x48, 0x00, 0x52, 0x09, 0x73, + 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x1a, + 0x21, 0x0a, 0x09, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x12, 0x14, 0x0a, 0x05, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x22, 0xa4, 0x01, 0x0a, 0x12, + 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x56, 0x32, 0x12, 0x4a, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x42, + 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x07, 0x70, 0x72, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x4b, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x2e, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x48, + 0x00, 0x52, 0x09, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x12, 0x3f, 0x0a, 0x0a, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x1a, 0x21, 0x0a, + 0x09, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x42, 0x07, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0x01, 0x0a, 0x12, 0x50, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, + 0x12, 0x44, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x6b, 0x65, + 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x07, 0x70, 0x72, 0x65, + 0x4b, 0x65, 0x79, 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x10, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x3b, 0x0a, 0x02, 0x76, 0x31, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, + 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x12, 0x3b, 0x0a, 0x02, 0x76, 0x32, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x32, 0x48, 0x00, 0x52, + 0x02, 0x76, 0x32, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4a, 0x04, + 0x08, 0x03, 0x10, 0x04, 0x22, 0x86, 0x01, 0x0a, 0x1b, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, + 0x6c, 0x65, 0x56, 0x31, 0x12, 0x24, 0x0a, 0x0e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x70, + 0x72, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x77, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x50, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x69, + 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, + 0x74, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x22, 0x6c, 0x0a, + 0x19, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x02, 0x76, 0x31, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, + 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0xd6, 0x01, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0f, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, + 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, + 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, + 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, + 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_private_key_proto_rawDescOnce sync.Once + file_message_contents_private_key_proto_rawDescData = file_message_contents_private_key_proto_rawDesc +) + +func file_message_contents_private_key_proto_rawDescGZIP() []byte { + file_message_contents_private_key_proto_rawDescOnce.Do(func() { + file_message_contents_private_key_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_private_key_proto_rawDescData) + }) + return file_message_contents_private_key_proto_rawDescData +} + +var file_message_contents_private_key_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_message_contents_private_key_proto_goTypes = []interface{}{ + (*SignedPrivateKey)(nil), // 0: xmtp.message_contents.SignedPrivateKey + (*PrivateKeyBundleV2)(nil), // 1: xmtp.message_contents.PrivateKeyBundleV2 + (*PrivateKey)(nil), // 2: xmtp.message_contents.PrivateKey + (*PrivateKeyBundleV1)(nil), // 3: xmtp.message_contents.PrivateKeyBundleV1 + (*PrivateKeyBundle)(nil), // 4: xmtp.message_contents.PrivateKeyBundle + (*EncryptedPrivateKeyBundleV1)(nil), // 5: xmtp.message_contents.EncryptedPrivateKeyBundleV1 + (*EncryptedPrivateKeyBundle)(nil), // 6: xmtp.message_contents.EncryptedPrivateKeyBundle + (*SignedPrivateKey_Secp256K1)(nil), // 7: xmtp.message_contents.SignedPrivateKey.Secp256k1 + (*PrivateKey_Secp256K1)(nil), // 8: xmtp.message_contents.PrivateKey.Secp256k1 + (*SignedPublicKey)(nil), // 9: xmtp.message_contents.SignedPublicKey + (*PublicKey)(nil), // 10: xmtp.message_contents.PublicKey + (*Ciphertext)(nil), // 11: xmtp.message_contents.Ciphertext +} +var file_message_contents_private_key_proto_depIdxs = []int32{ + 7, // 0: xmtp.message_contents.SignedPrivateKey.secp256k1:type_name -> xmtp.message_contents.SignedPrivateKey.Secp256k1 + 9, // 1: xmtp.message_contents.SignedPrivateKey.public_key:type_name -> xmtp.message_contents.SignedPublicKey + 0, // 2: xmtp.message_contents.PrivateKeyBundleV2.identity_key:type_name -> xmtp.message_contents.SignedPrivateKey + 0, // 3: xmtp.message_contents.PrivateKeyBundleV2.pre_keys:type_name -> xmtp.message_contents.SignedPrivateKey + 8, // 4: xmtp.message_contents.PrivateKey.secp256k1:type_name -> xmtp.message_contents.PrivateKey.Secp256k1 + 10, // 5: xmtp.message_contents.PrivateKey.public_key:type_name -> xmtp.message_contents.PublicKey + 2, // 6: xmtp.message_contents.PrivateKeyBundleV1.identity_key:type_name -> xmtp.message_contents.PrivateKey + 2, // 7: xmtp.message_contents.PrivateKeyBundleV1.pre_keys:type_name -> xmtp.message_contents.PrivateKey + 3, // 8: xmtp.message_contents.PrivateKeyBundle.v1:type_name -> xmtp.message_contents.PrivateKeyBundleV1 + 1, // 9: xmtp.message_contents.PrivateKeyBundle.v2:type_name -> xmtp.message_contents.PrivateKeyBundleV2 + 11, // 10: xmtp.message_contents.EncryptedPrivateKeyBundleV1.ciphertext:type_name -> xmtp.message_contents.Ciphertext + 5, // 11: xmtp.message_contents.EncryptedPrivateKeyBundle.v1:type_name -> xmtp.message_contents.EncryptedPrivateKeyBundleV1 + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_message_contents_private_key_proto_init() } +func file_message_contents_private_key_proto_init() { + if File_message_contents_private_key_proto != nil { + return + } + file_message_contents_ciphertext_proto_init() + file_message_contents_public_key_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_private_key_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedPrivateKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivateKeyBundleV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivateKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivateKeyBundleV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivateKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptedPrivateKeyBundleV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptedPrivateKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedPrivateKey_Secp256K1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_key_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivateKey_Secp256K1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_private_key_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*SignedPrivateKey_Secp256K1_)(nil), + } + file_message_contents_private_key_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*PrivateKey_Secp256K1_)(nil), + } + file_message_contents_private_key_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*PrivateKeyBundle_V1)(nil), + (*PrivateKeyBundle_V2)(nil), + } + file_message_contents_private_key_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*EncryptedPrivateKeyBundle_V1)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_private_key_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_private_key_proto_goTypes, + DependencyIndexes: file_message_contents_private_key_proto_depIdxs, + MessageInfos: file_message_contents_private_key_proto_msgTypes, + }.Build() + File_message_contents_private_key_proto = out.File + file_message_contents_private_key_proto_rawDesc = nil + file_message_contents_private_key_proto_goTypes = nil + file_message_contents_private_key_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/private_preferences.pb.go b/pkg/proto/message_contents/private_preferences.pb.go new file mode 100644 index 00000000..354c004d --- /dev/null +++ b/pkg/proto/message_contents/private_preferences.pb.go @@ -0,0 +1,439 @@ +// Private Key Storage +// +// Following definitions are not used in the protocol, instead +// they provide a way for encoding private keys for storage. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/private_preferences.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PrivatePreferencesAction is a message used to update the client's +// preference store. The only current actions are allow and block. +// Other actions may be added later +type PrivatePreferencesAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to MessageType: + // + // *PrivatePreferencesAction_Allow_ + // *PrivatePreferencesAction_Block_ + MessageType isPrivatePreferencesAction_MessageType `protobuf_oneof:"message_type"` +} + +func (x *PrivatePreferencesAction) Reset() { + *x = PrivatePreferencesAction{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_preferences_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivatePreferencesAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivatePreferencesAction) ProtoMessage() {} + +func (x *PrivatePreferencesAction) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_preferences_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivatePreferencesAction.ProtoReflect.Descriptor instead. +func (*PrivatePreferencesAction) Descriptor() ([]byte, []int) { + return file_message_contents_private_preferences_proto_rawDescGZIP(), []int{0} +} + +func (m *PrivatePreferencesAction) GetMessageType() isPrivatePreferencesAction_MessageType { + if m != nil { + return m.MessageType + } + return nil +} + +func (x *PrivatePreferencesAction) GetAllow() *PrivatePreferencesAction_Allow { + if x, ok := x.GetMessageType().(*PrivatePreferencesAction_Allow_); ok { + return x.Allow + } + return nil +} + +func (x *PrivatePreferencesAction) GetBlock() *PrivatePreferencesAction_Block { + if x, ok := x.GetMessageType().(*PrivatePreferencesAction_Block_); ok { + return x.Block + } + return nil +} + +type isPrivatePreferencesAction_MessageType interface { + isPrivatePreferencesAction_MessageType() +} + +type PrivatePreferencesAction_Allow_ struct { + Allow *PrivatePreferencesAction_Allow `protobuf:"bytes,1,opt,name=allow,proto3,oneof"` +} + +type PrivatePreferencesAction_Block_ struct { + Block *PrivatePreferencesAction_Block `protobuf:"bytes,2,opt,name=block,proto3,oneof"` +} + +func (*PrivatePreferencesAction_Allow_) isPrivatePreferencesAction_MessageType() {} + +func (*PrivatePreferencesAction_Block_) isPrivatePreferencesAction_MessageType() {} + +// The payload that goes over the wire +type PrivatePreferencesPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *PrivatePreferencesPayload_V1 + Version isPrivatePreferencesPayload_Version `protobuf_oneof:"version"` +} + +func (x *PrivatePreferencesPayload) Reset() { + *x = PrivatePreferencesPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_preferences_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivatePreferencesPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivatePreferencesPayload) ProtoMessage() {} + +func (x *PrivatePreferencesPayload) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_preferences_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivatePreferencesPayload.ProtoReflect.Descriptor instead. +func (*PrivatePreferencesPayload) Descriptor() ([]byte, []int) { + return file_message_contents_private_preferences_proto_rawDescGZIP(), []int{1} +} + +func (m *PrivatePreferencesPayload) GetVersion() isPrivatePreferencesPayload_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *PrivatePreferencesPayload) GetV1() *Ciphertext { + if x, ok := x.GetVersion().(*PrivatePreferencesPayload_V1); ok { + return x.V1 + } + return nil +} + +type isPrivatePreferencesPayload_Version interface { + isPrivatePreferencesPayload_Version() +} + +type PrivatePreferencesPayload_V1 struct { + V1 *Ciphertext `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*PrivatePreferencesPayload_V1) isPrivatePreferencesPayload_Version() {} + +// Add the given wallet addresses to the allow list +type PrivatePreferencesAction_Allow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WalletAddresses []string `protobuf:"bytes,1,rep,name=wallet_addresses,json=walletAddresses,proto3" json:"wallet_addresses,omitempty"` +} + +func (x *PrivatePreferencesAction_Allow) Reset() { + *x = PrivatePreferencesAction_Allow{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_preferences_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivatePreferencesAction_Allow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivatePreferencesAction_Allow) ProtoMessage() {} + +func (x *PrivatePreferencesAction_Allow) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_preferences_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivatePreferencesAction_Allow.ProtoReflect.Descriptor instead. +func (*PrivatePreferencesAction_Allow) Descriptor() ([]byte, []int) { + return file_message_contents_private_preferences_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *PrivatePreferencesAction_Allow) GetWalletAddresses() []string { + if x != nil { + return x.WalletAddresses + } + return nil +} + +// Add the given wallet addresses to the block list +type PrivatePreferencesAction_Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WalletAddresses []string `protobuf:"bytes,1,rep,name=wallet_addresses,json=walletAddresses,proto3" json:"wallet_addresses,omitempty"` +} + +func (x *PrivatePreferencesAction_Block) Reset() { + *x = PrivatePreferencesAction_Block{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_private_preferences_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivatePreferencesAction_Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivatePreferencesAction_Block) ProtoMessage() {} + +func (x *PrivatePreferencesAction_Block) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_private_preferences_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivatePreferencesAction_Block.ProtoReflect.Descriptor instead. +func (*PrivatePreferencesAction_Block) Descriptor() ([]byte, []int) { + return file_message_contents_private_preferences_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *PrivatePreferencesAction_Block) GetWalletAddresses() []string { + if x != nil { + return x.WalletAddresses + } + return nil +} + +var File_message_contents_private_preferences_proto protoreflect.FileDescriptor + +var file_message_contents_private_preferences_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x1a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, 0x02, 0x0a, 0x18, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x48, 0x00, 0x52, 0x05, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x12, 0x4d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x1a, 0x32, 0x0a, 0x05, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x1a, 0x32, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x29, + 0x0a, 0x10, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x5b, 0x0a, 0x19, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x33, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x42, 0x09, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0xde, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x42, 0x17, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x50, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, + 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, + 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, + 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_private_preferences_proto_rawDescOnce sync.Once + file_message_contents_private_preferences_proto_rawDescData = file_message_contents_private_preferences_proto_rawDesc +) + +func file_message_contents_private_preferences_proto_rawDescGZIP() []byte { + file_message_contents_private_preferences_proto_rawDescOnce.Do(func() { + file_message_contents_private_preferences_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_private_preferences_proto_rawDescData) + }) + return file_message_contents_private_preferences_proto_rawDescData +} + +var file_message_contents_private_preferences_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_message_contents_private_preferences_proto_goTypes = []interface{}{ + (*PrivatePreferencesAction)(nil), // 0: xmtp.message_contents.PrivatePreferencesAction + (*PrivatePreferencesPayload)(nil), // 1: xmtp.message_contents.PrivatePreferencesPayload + (*PrivatePreferencesAction_Allow)(nil), // 2: xmtp.message_contents.PrivatePreferencesAction.Allow + (*PrivatePreferencesAction_Block)(nil), // 3: xmtp.message_contents.PrivatePreferencesAction.Block + (*Ciphertext)(nil), // 4: xmtp.message_contents.Ciphertext +} +var file_message_contents_private_preferences_proto_depIdxs = []int32{ + 2, // 0: xmtp.message_contents.PrivatePreferencesAction.allow:type_name -> xmtp.message_contents.PrivatePreferencesAction.Allow + 3, // 1: xmtp.message_contents.PrivatePreferencesAction.block:type_name -> xmtp.message_contents.PrivatePreferencesAction.Block + 4, // 2: xmtp.message_contents.PrivatePreferencesPayload.v1:type_name -> xmtp.message_contents.Ciphertext + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_message_contents_private_preferences_proto_init() } +func file_message_contents_private_preferences_proto_init() { + if File_message_contents_private_preferences_proto != nil { + return + } + file_message_contents_ciphertext_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_private_preferences_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivatePreferencesAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_preferences_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivatePreferencesPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_preferences_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivatePreferencesAction_Allow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_private_preferences_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivatePreferencesAction_Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_private_preferences_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*PrivatePreferencesAction_Allow_)(nil), + (*PrivatePreferencesAction_Block_)(nil), + } + file_message_contents_private_preferences_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*PrivatePreferencesPayload_V1)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_private_preferences_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_private_preferences_proto_goTypes, + DependencyIndexes: file_message_contents_private_preferences_proto_depIdxs, + MessageInfos: file_message_contents_private_preferences_proto_msgTypes, + }.Build() + File_message_contents_private_preferences_proto = out.File + file_message_contents_private_preferences_proto_rawDesc = nil + file_message_contents_private_preferences_proto_goTypes = nil + file_message_contents_private_preferences_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/public_key.pb.go b/pkg/proto/message_contents/public_key.pb.go new file mode 100644 index 00000000..64d32b20 --- /dev/null +++ b/pkg/proto/message_contents/public_key.pb.go @@ -0,0 +1,699 @@ +// Structure for representing public keys of different types, +// including signatures used to authenticate the keys. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/public_key.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// UnsignedPublicKey represents a generalized public key, +// defined as a union to support cryptographic algorithm agility. +type UnsignedPublicKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CreatedNs uint64 `protobuf:"varint,1,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + // Types that are assignable to Union: + // + // *UnsignedPublicKey_Secp256K1Uncompressed_ + Union isUnsignedPublicKey_Union `protobuf_oneof:"union"` +} + +func (x *UnsignedPublicKey) Reset() { + *x = UnsignedPublicKey{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnsignedPublicKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsignedPublicKey) ProtoMessage() {} + +func (x *UnsignedPublicKey) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnsignedPublicKey.ProtoReflect.Descriptor instead. +func (*UnsignedPublicKey) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{0} +} + +func (x *UnsignedPublicKey) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (m *UnsignedPublicKey) GetUnion() isUnsignedPublicKey_Union { + if m != nil { + return m.Union + } + return nil +} + +func (x *UnsignedPublicKey) GetSecp256K1Uncompressed() *UnsignedPublicKey_Secp256K1Uncompressed { + if x, ok := x.GetUnion().(*UnsignedPublicKey_Secp256K1Uncompressed_); ok { + return x.Secp256K1Uncompressed + } + return nil +} + +type isUnsignedPublicKey_Union interface { + isUnsignedPublicKey_Union() +} + +type UnsignedPublicKey_Secp256K1Uncompressed_ struct { + Secp256K1Uncompressed *UnsignedPublicKey_Secp256K1Uncompressed `protobuf:"bytes,3,opt,name=secp256k1_uncompressed,json=secp256k1Uncompressed,proto3,oneof"` +} + +func (*UnsignedPublicKey_Secp256K1Uncompressed_) isUnsignedPublicKey_Union() {} + +// SignedPublicKey +type SignedPublicKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyBytes []byte `protobuf:"bytes,1,opt,name=key_bytes,json=keyBytes,proto3" json:"key_bytes,omitempty"` // embeds an UnsignedPublicKey + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // signs key_bytes +} + +func (x *SignedPublicKey) Reset() { + *x = SignedPublicKey{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedPublicKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedPublicKey) ProtoMessage() {} + +func (x *SignedPublicKey) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedPublicKey.ProtoReflect.Descriptor instead. +func (*SignedPublicKey) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{1} +} + +func (x *SignedPublicKey) GetKeyBytes() []byte { + if x != nil { + return x.KeyBytes + } + return nil +} + +func (x *SignedPublicKey) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +// PublicKeyBundle packages the cryptographic keys associated with a wallet. +type SignedPublicKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identity key MUST be signed by the wallet. + IdentityKey *SignedPublicKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // Pre-key MUST be signed by the identity key. + PreKey *SignedPublicKey `protobuf:"bytes,2,opt,name=pre_key,json=preKey,proto3" json:"pre_key,omitempty"` +} + +func (x *SignedPublicKeyBundle) Reset() { + *x = SignedPublicKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedPublicKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedPublicKeyBundle) ProtoMessage() {} + +func (x *SignedPublicKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedPublicKeyBundle.ProtoReflect.Descriptor instead. +func (*SignedPublicKeyBundle) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{2} +} + +func (x *SignedPublicKeyBundle) GetIdentityKey() *SignedPublicKey { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *SignedPublicKeyBundle) GetPreKey() *SignedPublicKey { + if x != nil { + return x.PreKey + } + return nil +} + +// PublicKey represents a generalized public key, +// defined as a union to support cryptographic algorithm agility. +type PublicKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3,oneof" json:"signature,omitempty"` + // Types that are assignable to Union: + // + // *PublicKey_Secp256K1Uncompressed_ + Union isPublicKey_Union `protobuf_oneof:"union"` +} + +func (x *PublicKey) Reset() { + *x = PublicKey{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublicKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublicKey) ProtoMessage() {} + +func (x *PublicKey) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublicKey.ProtoReflect.Descriptor instead. +func (*PublicKey) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{3} +} + +func (x *PublicKey) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *PublicKey) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +func (m *PublicKey) GetUnion() isPublicKey_Union { + if m != nil { + return m.Union + } + return nil +} + +func (x *PublicKey) GetSecp256K1Uncompressed() *PublicKey_Secp256K1Uncompressed { + if x, ok := x.GetUnion().(*PublicKey_Secp256K1Uncompressed_); ok { + return x.Secp256K1Uncompressed + } + return nil +} + +type isPublicKey_Union interface { + isPublicKey_Union() +} + +type PublicKey_Secp256K1Uncompressed_ struct { + Secp256K1Uncompressed *PublicKey_Secp256K1Uncompressed `protobuf:"bytes,3,opt,name=secp256k1_uncompressed,json=secp256k1Uncompressed,proto3,oneof"` +} + +func (*PublicKey_Secp256K1Uncompressed_) isPublicKey_Union() {} + +// PublicKeyBundle packages the cryptographic keys associated with a wallet, +// both senders and recipients are identified by their key bundles. +type PublicKeyBundle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identity key MUST be signed by the wallet. + IdentityKey *PublicKey `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` + // Pre-key MUST be signed by the identity key. + PreKey *PublicKey `protobuf:"bytes,2,opt,name=pre_key,json=preKey,proto3" json:"pre_key,omitempty"` +} + +func (x *PublicKeyBundle) Reset() { + *x = PublicKeyBundle{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublicKeyBundle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublicKeyBundle) ProtoMessage() {} + +func (x *PublicKeyBundle) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublicKeyBundle.ProtoReflect.Descriptor instead. +func (*PublicKeyBundle) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{4} +} + +func (x *PublicKeyBundle) GetIdentityKey() *PublicKey { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *PublicKeyBundle) GetPreKey() *PublicKey { + if x != nil { + return x.PreKey + } + return nil +} + +// EC: SECP256k1 +type UnsignedPublicKey_Secp256K1Uncompressed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uncompressed point with prefix (0x04) [ P || X || Y ], 65 bytes + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (x *UnsignedPublicKey_Secp256K1Uncompressed) Reset() { + *x = UnsignedPublicKey_Secp256K1Uncompressed{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnsignedPublicKey_Secp256K1Uncompressed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsignedPublicKey_Secp256K1Uncompressed) ProtoMessage() {} + +func (x *UnsignedPublicKey_Secp256K1Uncompressed) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnsignedPublicKey_Secp256K1Uncompressed.ProtoReflect.Descriptor instead. +func (*UnsignedPublicKey_Secp256K1Uncompressed) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *UnsignedPublicKey_Secp256K1Uncompressed) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +// The key bytes +type PublicKey_Secp256K1Uncompressed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uncompressed point with prefix (0x04) [ P || X || Y ], 65 bytes + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (x *PublicKey_Secp256K1Uncompressed) Reset() { + *x = PublicKey_Secp256K1Uncompressed{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_public_key_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublicKey_Secp256K1Uncompressed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublicKey_Secp256K1Uncompressed) ProtoMessage() {} + +func (x *PublicKey_Secp256K1Uncompressed) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_public_key_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublicKey_Secp256K1Uncompressed.ProtoReflect.Descriptor instead. +func (*PublicKey_Secp256K1Uncompressed) Descriptor() ([]byte, []int) { + return file_message_contents_public_key_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *PublicKey_Secp256K1Uncompressed) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +var File_message_contents_public_key_proto protoreflect.FileDescriptor + +var file_message_contents_public_key_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x20, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x01, 0x0a, + 0x11, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, + 0x73, 0x12, 0x77, 0x0a, 0x16, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x5f, 0x75, + 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x2e, 0x53, 0x65, 0x63, 0x70, + 0x32, 0x35, 0x36, 0x6b, 0x31, 0x55, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x48, 0x00, 0x52, 0x15, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x55, 0x6e, + 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x1a, 0x2d, 0x0a, 0x15, 0x53, 0x65, + 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x55, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x75, 0x6e, 0x69, + 0x6f, 0x6e, 0x22, 0x6e, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x49, 0x0a, 0x0c, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x52, 0x06, 0x70, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x22, 0xa5, 0x02, 0x0a, 0x09, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x43, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x01, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x6f, 0x0a, 0x16, 0x73, 0x65, 0x63, + 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x5f, 0x75, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x2e, 0x53, 0x65, 0x63, 0x70, + 0x32, 0x35, 0x36, 0x6b, 0x31, 0x55, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x48, 0x00, 0x52, 0x15, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x55, 0x6e, + 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x1a, 0x2d, 0x0a, 0x15, 0x53, 0x65, + 0x63, 0x70, 0x32, 0x35, 0x36, 0x6b, 0x31, 0x55, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x75, 0x6e, 0x69, + 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x22, 0x91, 0x01, 0x0a, 0x0f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x0b, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x07, 0x70, 0x72, 0x65, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x70, 0x72, + 0x65, 0x4b, 0x65, 0x79, 0x42, 0xd5, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x42, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, + 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, + 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, + 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_public_key_proto_rawDescOnce sync.Once + file_message_contents_public_key_proto_rawDescData = file_message_contents_public_key_proto_rawDesc +) + +func file_message_contents_public_key_proto_rawDescGZIP() []byte { + file_message_contents_public_key_proto_rawDescOnce.Do(func() { + file_message_contents_public_key_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_public_key_proto_rawDescData) + }) + return file_message_contents_public_key_proto_rawDescData +} + +var file_message_contents_public_key_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_message_contents_public_key_proto_goTypes = []interface{}{ + (*UnsignedPublicKey)(nil), // 0: xmtp.message_contents.UnsignedPublicKey + (*SignedPublicKey)(nil), // 1: xmtp.message_contents.SignedPublicKey + (*SignedPublicKeyBundle)(nil), // 2: xmtp.message_contents.SignedPublicKeyBundle + (*PublicKey)(nil), // 3: xmtp.message_contents.PublicKey + (*PublicKeyBundle)(nil), // 4: xmtp.message_contents.PublicKeyBundle + (*UnsignedPublicKey_Secp256K1Uncompressed)(nil), // 5: xmtp.message_contents.UnsignedPublicKey.Secp256k1Uncompressed + (*PublicKey_Secp256K1Uncompressed)(nil), // 6: xmtp.message_contents.PublicKey.Secp256k1Uncompressed + (*Signature)(nil), // 7: xmtp.message_contents.Signature +} +var file_message_contents_public_key_proto_depIdxs = []int32{ + 5, // 0: xmtp.message_contents.UnsignedPublicKey.secp256k1_uncompressed:type_name -> xmtp.message_contents.UnsignedPublicKey.Secp256k1Uncompressed + 7, // 1: xmtp.message_contents.SignedPublicKey.signature:type_name -> xmtp.message_contents.Signature + 1, // 2: xmtp.message_contents.SignedPublicKeyBundle.identity_key:type_name -> xmtp.message_contents.SignedPublicKey + 1, // 3: xmtp.message_contents.SignedPublicKeyBundle.pre_key:type_name -> xmtp.message_contents.SignedPublicKey + 7, // 4: xmtp.message_contents.PublicKey.signature:type_name -> xmtp.message_contents.Signature + 6, // 5: xmtp.message_contents.PublicKey.secp256k1_uncompressed:type_name -> xmtp.message_contents.PublicKey.Secp256k1Uncompressed + 3, // 6: xmtp.message_contents.PublicKeyBundle.identity_key:type_name -> xmtp.message_contents.PublicKey + 3, // 7: xmtp.message_contents.PublicKeyBundle.pre_key:type_name -> xmtp.message_contents.PublicKey + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_message_contents_public_key_proto_init() } +func file_message_contents_public_key_proto_init() { + if File_message_contents_public_key_proto != nil { + return + } + file_message_contents_signature_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_public_key_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnsignedPublicKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_public_key_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedPublicKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_public_key_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedPublicKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_public_key_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublicKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_public_key_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublicKeyBundle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_public_key_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnsignedPublicKey_Secp256K1Uncompressed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_public_key_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublicKey_Secp256K1Uncompressed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_public_key_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*UnsignedPublicKey_Secp256K1Uncompressed_)(nil), + } + file_message_contents_public_key_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*PublicKey_Secp256K1Uncompressed_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_public_key_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_public_key_proto_goTypes, + DependencyIndexes: file_message_contents_public_key_proto_depIdxs, + MessageInfos: file_message_contents_public_key_proto_msgTypes, + }.Build() + File_message_contents_public_key_proto = out.File + file_message_contents_public_key_proto_rawDesc = nil + file_message_contents_public_key_proto_goTypes = nil + file_message_contents_public_key_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/signature.pb.go b/pkg/proto/message_contents/signature.pb.go new file mode 100644 index 00000000..74f26b6d --- /dev/null +++ b/pkg/proto/message_contents/signature.pb.go @@ -0,0 +1,361 @@ +// Signature is a generic structure for public key signatures. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/signature.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Signature represents a generalized public key signature, +// defined as a union to support cryptographic algorithm agility. +type Signature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Union: + // + // *Signature_EcdsaCompact + // *Signature_WalletEcdsaCompact + Union isSignature_Union `protobuf_oneof:"union"` +} + +func (x *Signature) Reset() { + *x = Signature{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_signature_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Signature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Signature) ProtoMessage() {} + +func (x *Signature) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_signature_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Signature.ProtoReflect.Descriptor instead. +func (*Signature) Descriptor() ([]byte, []int) { + return file_message_contents_signature_proto_rawDescGZIP(), []int{0} +} + +func (m *Signature) GetUnion() isSignature_Union { + if m != nil { + return m.Union + } + return nil +} + +func (x *Signature) GetEcdsaCompact() *Signature_ECDSACompact { + if x, ok := x.GetUnion().(*Signature_EcdsaCompact); ok { + return x.EcdsaCompact + } + return nil +} + +func (x *Signature) GetWalletEcdsaCompact() *Signature_WalletECDSACompact { + if x, ok := x.GetUnion().(*Signature_WalletEcdsaCompact); ok { + return x.WalletEcdsaCompact + } + return nil +} + +type isSignature_Union interface { + isSignature_Union() +} + +type Signature_EcdsaCompact struct { + EcdsaCompact *Signature_ECDSACompact `protobuf:"bytes,1,opt,name=ecdsa_compact,json=ecdsaCompact,proto3,oneof"` +} + +type Signature_WalletEcdsaCompact struct { + WalletEcdsaCompact *Signature_WalletECDSACompact `protobuf:"bytes,2,opt,name=wallet_ecdsa_compact,json=walletEcdsaCompact,proto3,oneof"` +} + +func (*Signature_EcdsaCompact) isSignature_Union() {} + +func (*Signature_WalletEcdsaCompact) isSignature_Union() {} + +// ECDSA signature bytes and the recovery bit +type Signature_ECDSACompact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` // compact representation [ R || S ], 64 bytes + Recovery uint32 `protobuf:"varint,2,opt,name=recovery,proto3" json:"recovery,omitempty"` // recovery bit +} + +func (x *Signature_ECDSACompact) Reset() { + *x = Signature_ECDSACompact{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_signature_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Signature_ECDSACompact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Signature_ECDSACompact) ProtoMessage() {} + +func (x *Signature_ECDSACompact) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_signature_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Signature_ECDSACompact.ProtoReflect.Descriptor instead. +func (*Signature_ECDSACompact) Descriptor() ([]byte, []int) { + return file_message_contents_signature_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Signature_ECDSACompact) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +func (x *Signature_ECDSACompact) GetRecovery() uint32 { + if x != nil { + return x.Recovery + } + return 0 +} + +// ECDSA signature bytes and the recovery bit +// produced by xmtp-js::PublicKey.signWithWallet function, i.e. +// EIP-191 signature of a "Create Identity" message with the key embedded. +// Used to sign identity keys. +type Signature_WalletECDSACompact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` // compact representation [ R || S ], 64 bytes + Recovery uint32 `protobuf:"varint,2,opt,name=recovery,proto3" json:"recovery,omitempty"` // recovery bit +} + +func (x *Signature_WalletECDSACompact) Reset() { + *x = Signature_WalletECDSACompact{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_signature_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Signature_WalletECDSACompact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Signature_WalletECDSACompact) ProtoMessage() {} + +func (x *Signature_WalletECDSACompact) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_signature_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Signature_WalletECDSACompact.ProtoReflect.Descriptor instead. +func (*Signature_WalletECDSACompact) Descriptor() ([]byte, []int) { + return file_message_contents_signature_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Signature_WalletECDSACompact) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +func (x *Signature_WalletECDSACompact) GetRecovery() uint32 { + if x != nil { + return x.Recovery + } + return 0 +} + +var File_message_contents_signature_proto protoreflect.FileDescriptor + +var file_message_contents_signature_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xdd, 0x02, 0x0a, 0x09, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x54, 0x0a, 0x0d, 0x65, 0x63, 0x64, 0x73, 0x61, + 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x2e, 0x45, 0x43, 0x44, 0x53, 0x41, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x48, 0x00, 0x52, + 0x0c, 0x65, 0x63, 0x64, 0x73, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x67, 0x0a, + 0x14, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x57, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x45, 0x43, 0x44, 0x53, 0x41, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x48, 0x00, 0x52, 0x12, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x45, 0x63, 0x64, 0x73, 0x61, 0x43, + 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x1a, 0x40, 0x0a, 0x0c, 0x45, 0x43, 0x44, 0x53, 0x41, 0x43, + 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, + 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x1a, 0x46, 0x0a, 0x12, 0x57, 0x61, 0x6c, 0x6c, + 0x65, 0x74, 0x45, 0x43, 0x44, 0x53, 0x41, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x42, 0x07, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x42, 0xd5, 0x01, 0x0a, 0x19, 0x63, 0x6f, + 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, + 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, + 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, + 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_signature_proto_rawDescOnce sync.Once + file_message_contents_signature_proto_rawDescData = file_message_contents_signature_proto_rawDesc +) + +func file_message_contents_signature_proto_rawDescGZIP() []byte { + file_message_contents_signature_proto_rawDescOnce.Do(func() { + file_message_contents_signature_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_signature_proto_rawDescData) + }) + return file_message_contents_signature_proto_rawDescData +} + +var file_message_contents_signature_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_message_contents_signature_proto_goTypes = []interface{}{ + (*Signature)(nil), // 0: xmtp.message_contents.Signature + (*Signature_ECDSACompact)(nil), // 1: xmtp.message_contents.Signature.ECDSACompact + (*Signature_WalletECDSACompact)(nil), // 2: xmtp.message_contents.Signature.WalletECDSACompact +} +var file_message_contents_signature_proto_depIdxs = []int32{ + 1, // 0: xmtp.message_contents.Signature.ecdsa_compact:type_name -> xmtp.message_contents.Signature.ECDSACompact + 2, // 1: xmtp.message_contents.Signature.wallet_ecdsa_compact:type_name -> xmtp.message_contents.Signature.WalletECDSACompact + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_message_contents_signature_proto_init() } +func file_message_contents_signature_proto_init() { + if File_message_contents_signature_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_contents_signature_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Signature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_signature_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Signature_ECDSACompact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_contents_signature_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Signature_WalletECDSACompact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_message_contents_signature_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Signature_EcdsaCompact)(nil), + (*Signature_WalletEcdsaCompact)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_signature_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_signature_proto_goTypes, + DependencyIndexes: file_message_contents_signature_proto_depIdxs, + MessageInfos: file_message_contents_signature_proto_msgTypes, + }.Build() + File_message_contents_signature_proto = out.File + file_message_contents_signature_proto_rawDesc = nil + file_message_contents_signature_proto_goTypes = nil + file_message_contents_signature_proto_depIdxs = nil +} diff --git a/pkg/proto/message_contents/signed_payload.pb.go b/pkg/proto/message_contents/signed_payload.pb.go new file mode 100644 index 00000000..d66f8b2b --- /dev/null +++ b/pkg/proto/message_contents/signed_payload.pb.go @@ -0,0 +1,177 @@ +// Signature is a generic structure for signed byte arrays + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: message_contents/signed_payload.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SignedPayload is a wrapper for a signature and a payload +type SignedPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Signature *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedPayload) Reset() { + *x = SignedPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_message_contents_signed_payload_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedPayload) ProtoMessage() {} + +func (x *SignedPayload) ProtoReflect() protoreflect.Message { + mi := &file_message_contents_signed_payload_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedPayload.ProtoReflect.Descriptor instead. +func (*SignedPayload) Descriptor() ([]byte, []int) { + return file_message_contents_signed_payload_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedPayload) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SignedPayload) GetSignature() *Signature { + if x != nil { + return x.Signature + } + return nil +} + +var File_message_contents_signed_payload_proto protoreflect.FileDescriptor + +var file_message_contents_signed_payload_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x20, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x69, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3e, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0xd9, 0x01, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x12, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, + 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, 0x02, + 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x20, 0x58, + 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_contents_signed_payload_proto_rawDescOnce sync.Once + file_message_contents_signed_payload_proto_rawDescData = file_message_contents_signed_payload_proto_rawDesc +) + +func file_message_contents_signed_payload_proto_rawDescGZIP() []byte { + file_message_contents_signed_payload_proto_rawDescOnce.Do(func() { + file_message_contents_signed_payload_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_contents_signed_payload_proto_rawDescData) + }) + return file_message_contents_signed_payload_proto_rawDescData +} + +var file_message_contents_signed_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_message_contents_signed_payload_proto_goTypes = []interface{}{ + (*SignedPayload)(nil), // 0: xmtp.message_contents.SignedPayload + (*Signature)(nil), // 1: xmtp.message_contents.Signature +} +var file_message_contents_signed_payload_proto_depIdxs = []int32{ + 1, // 0: xmtp.message_contents.SignedPayload.signature:type_name -> xmtp.message_contents.Signature + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_message_contents_signed_payload_proto_init() } +func file_message_contents_signed_payload_proto_init() { + if File_message_contents_signed_payload_proto != nil { + return + } + file_message_contents_signature_proto_init() + if !protoimpl.UnsafeEnabled { + file_message_contents_signed_payload_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_contents_signed_payload_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_message_contents_signed_payload_proto_goTypes, + DependencyIndexes: file_message_contents_signed_payload_proto_depIdxs, + MessageInfos: file_message_contents_signed_payload_proto_msgTypes, + }.Build() + File_message_contents_signed_payload_proto = out.File + file_message_contents_signed_payload_proto_rawDesc = nil + file_message_contents_signed_payload_proto_goTypes = nil + file_message_contents_signed_payload_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/api/v1/mls.pb.go b/pkg/proto/mls/api/v1/mls.pb.go new file mode 100644 index 00000000..6b02d3a8 --- /dev/null +++ b/pkg/proto/mls/api/v1/mls.pb.go @@ -0,0 +1,2844 @@ +// Message API + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/api/v1/mls.proto + +package apiv1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + message_contents "github.com/xmtp/xmtp-node-go/pkg/proto/message_contents" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Sort direction for queries +type SortDirection int32 + +const ( + SortDirection_SORT_DIRECTION_UNSPECIFIED SortDirection = 0 + SortDirection_SORT_DIRECTION_ASCENDING SortDirection = 1 + SortDirection_SORT_DIRECTION_DESCENDING SortDirection = 2 +) + +// Enum value maps for SortDirection. +var ( + SortDirection_name = map[int32]string{ + 0: "SORT_DIRECTION_UNSPECIFIED", + 1: "SORT_DIRECTION_ASCENDING", + 2: "SORT_DIRECTION_DESCENDING", + } + SortDirection_value = map[string]int32{ + "SORT_DIRECTION_UNSPECIFIED": 0, + "SORT_DIRECTION_ASCENDING": 1, + "SORT_DIRECTION_DESCENDING": 2, + } +) + +func (x SortDirection) Enum() *SortDirection { + p := new(SortDirection) + *p = x + return p +} + +func (x SortDirection) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SortDirection) Descriptor() protoreflect.EnumDescriptor { + return file_mls_api_v1_mls_proto_enumTypes[0].Descriptor() +} + +func (SortDirection) Type() protoreflect.EnumType { + return &file_mls_api_v1_mls_proto_enumTypes[0] +} + +func (x SortDirection) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SortDirection.Descriptor instead. +func (SortDirection) EnumDescriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{0} +} + +// Full representation of a welcome message +type WelcomeMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *WelcomeMessage_V1_ + Version isWelcomeMessage_Version `protobuf_oneof:"version"` +} + +func (x *WelcomeMessage) Reset() { + *x = WelcomeMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WelcomeMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WelcomeMessage) ProtoMessage() {} + +func (x *WelcomeMessage) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WelcomeMessage.ProtoReflect.Descriptor instead. +func (*WelcomeMessage) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{0} +} + +func (m *WelcomeMessage) GetVersion() isWelcomeMessage_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *WelcomeMessage) GetV1() *WelcomeMessage_V1 { + if x, ok := x.GetVersion().(*WelcomeMessage_V1_); ok { + return x.V1 + } + return nil +} + +type isWelcomeMessage_Version interface { + isWelcomeMessage_Version() +} + +type WelcomeMessage_V1_ struct { + V1 *WelcomeMessage_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*WelcomeMessage_V1_) isWelcomeMessage_Version() {} + +// Input type for a welcome message +type WelcomeMessageInput struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *WelcomeMessageInput_V1_ + Version isWelcomeMessageInput_Version `protobuf_oneof:"version"` +} + +func (x *WelcomeMessageInput) Reset() { + *x = WelcomeMessageInput{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WelcomeMessageInput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WelcomeMessageInput) ProtoMessage() {} + +func (x *WelcomeMessageInput) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WelcomeMessageInput.ProtoReflect.Descriptor instead. +func (*WelcomeMessageInput) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{1} +} + +func (m *WelcomeMessageInput) GetVersion() isWelcomeMessageInput_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *WelcomeMessageInput) GetV1() *WelcomeMessageInput_V1 { + if x, ok := x.GetVersion().(*WelcomeMessageInput_V1_); ok { + return x.V1 + } + return nil +} + +type isWelcomeMessageInput_Version interface { + isWelcomeMessageInput_Version() +} + +type WelcomeMessageInput_V1_ struct { + V1 *WelcomeMessageInput_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*WelcomeMessageInput_V1_) isWelcomeMessageInput_Version() {} + +// Full representation of a group message +type GroupMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *GroupMessage_V1_ + Version isGroupMessage_Version `protobuf_oneof:"version"` +} + +func (x *GroupMessage) Reset() { + *x = GroupMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMessage) ProtoMessage() {} + +func (x *GroupMessage) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMessage.ProtoReflect.Descriptor instead. +func (*GroupMessage) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{2} +} + +func (m *GroupMessage) GetVersion() isGroupMessage_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *GroupMessage) GetV1() *GroupMessage_V1 { + if x, ok := x.GetVersion().(*GroupMessage_V1_); ok { + return x.V1 + } + return nil +} + +type isGroupMessage_Version interface { + isGroupMessage_Version() +} + +type GroupMessage_V1_ struct { + V1 *GroupMessage_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*GroupMessage_V1_) isGroupMessage_Version() {} + +// Input type for a group message +type GroupMessageInput struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *GroupMessageInput_V1_ + Version isGroupMessageInput_Version `protobuf_oneof:"version"` +} + +func (x *GroupMessageInput) Reset() { + *x = GroupMessageInput{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMessageInput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMessageInput) ProtoMessage() {} + +func (x *GroupMessageInput) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMessageInput.ProtoReflect.Descriptor instead. +func (*GroupMessageInput) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{3} +} + +func (m *GroupMessageInput) GetVersion() isGroupMessageInput_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *GroupMessageInput) GetV1() *GroupMessageInput_V1 { + if x, ok := x.GetVersion().(*GroupMessageInput_V1_); ok { + return x.V1 + } + return nil +} + +type isGroupMessageInput_Version interface { + isGroupMessageInput_Version() +} + +type GroupMessageInput_V1_ struct { + V1 *GroupMessageInput_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*GroupMessageInput_V1_) isGroupMessageInput_Version() {} + +// Send a batch of MLS messages +type SendGroupMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Messages []*GroupMessageInput `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` +} + +func (x *SendGroupMessagesRequest) Reset() { + *x = SendGroupMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendGroupMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendGroupMessagesRequest) ProtoMessage() {} + +func (x *SendGroupMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendGroupMessagesRequest.ProtoReflect.Descriptor instead. +func (*SendGroupMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{4} +} + +func (x *SendGroupMessagesRequest) GetMessages() []*GroupMessageInput { + if x != nil { + return x.Messages + } + return nil +} + +// Send a batch of welcome messages +type SendWelcomeMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Messages []*WelcomeMessageInput `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` +} + +func (x *SendWelcomeMessagesRequest) Reset() { + *x = SendWelcomeMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendWelcomeMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendWelcomeMessagesRequest) ProtoMessage() {} + +func (x *SendWelcomeMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendWelcomeMessagesRequest.ProtoReflect.Descriptor instead. +func (*SendWelcomeMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{5} +} + +func (x *SendWelcomeMessagesRequest) GetMessages() []*WelcomeMessageInput { + if x != nil { + return x.Messages + } + return nil +} + +// A wrapper around the Key Package bytes +type KeyPackageUpload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The owner's wallet address would be extracted from the identity + // credential in the key package, and all signatures would be validated. + KeyPackageTlsSerialized []byte `protobuf:"bytes,1,opt,name=key_package_tls_serialized,json=keyPackageTlsSerialized,proto3" json:"key_package_tls_serialized,omitempty"` +} + +func (x *KeyPackageUpload) Reset() { + *x = KeyPackageUpload{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyPackageUpload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyPackageUpload) ProtoMessage() {} + +func (x *KeyPackageUpload) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyPackageUpload.ProtoReflect.Descriptor instead. +func (*KeyPackageUpload) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{6} +} + +func (x *KeyPackageUpload) GetKeyPackageTlsSerialized() []byte { + if x != nil { + return x.KeyPackageTlsSerialized + } + return nil +} + +// Register a new installation +type RegisterInstallationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The Key Package contains all information needed to register an installation + KeyPackage *KeyPackageUpload `protobuf:"bytes,1,opt,name=key_package,json=keyPackage,proto3" json:"key_package,omitempty"` +} + +func (x *RegisterInstallationRequest) Reset() { + *x = RegisterInstallationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterInstallationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterInstallationRequest) ProtoMessage() {} + +func (x *RegisterInstallationRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterInstallationRequest.ProtoReflect.Descriptor instead. +func (*RegisterInstallationRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{7} +} + +func (x *RegisterInstallationRequest) GetKeyPackage() *KeyPackageUpload { + if x != nil { + return x.KeyPackage + } + return nil +} + +// The response to a RegisterInstallationRequest +type RegisterInstallationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` +} + +func (x *RegisterInstallationResponse) Reset() { + *x = RegisterInstallationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterInstallationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterInstallationResponse) ProtoMessage() {} + +func (x *RegisterInstallationResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterInstallationResponse.ProtoReflect.Descriptor instead. +func (*RegisterInstallationResponse) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{8} +} + +func (x *RegisterInstallationResponse) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +// Upload a new key packages +type UploadKeyPackageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // An individual key package upload request + KeyPackage *KeyPackageUpload `protobuf:"bytes,1,opt,name=key_package,json=keyPackage,proto3" json:"key_package,omitempty"` +} + +func (x *UploadKeyPackageRequest) Reset() { + *x = UploadKeyPackageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadKeyPackageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadKeyPackageRequest) ProtoMessage() {} + +func (x *UploadKeyPackageRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadKeyPackageRequest.ProtoReflect.Descriptor instead. +func (*UploadKeyPackageRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{9} +} + +func (x *UploadKeyPackageRequest) GetKeyPackage() *KeyPackageUpload { + if x != nil { + return x.KeyPackage + } + return nil +} + +// Fetch one or more key packages +type FetchKeyPackagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The caller can provide an array of installation keys, and the API + // will return one key package for each installation associated with each + // installation key + InstallationKeys [][]byte `protobuf:"bytes,1,rep,name=installation_keys,json=installationKeys,proto3" json:"installation_keys,omitempty"` +} + +func (x *FetchKeyPackagesRequest) Reset() { + *x = FetchKeyPackagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchKeyPackagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchKeyPackagesRequest) ProtoMessage() {} + +func (x *FetchKeyPackagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchKeyPackagesRequest.ProtoReflect.Descriptor instead. +func (*FetchKeyPackagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{10} +} + +func (x *FetchKeyPackagesRequest) GetInstallationKeys() [][]byte { + if x != nil { + return x.InstallationKeys + } + return nil +} + +// The response to a FetchKeyPackagesRequest +type FetchKeyPackagesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Returns one key package per installation in the original order of the + // request. If any installations are missing key packages, an empty entry is + // left in their respective spots in the array. + KeyPackages []*FetchKeyPackagesResponse_KeyPackage `protobuf:"bytes,1,rep,name=key_packages,json=keyPackages,proto3" json:"key_packages,omitempty"` +} + +func (x *FetchKeyPackagesResponse) Reset() { + *x = FetchKeyPackagesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchKeyPackagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchKeyPackagesResponse) ProtoMessage() {} + +func (x *FetchKeyPackagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchKeyPackagesResponse.ProtoReflect.Descriptor instead. +func (*FetchKeyPackagesResponse) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{11} +} + +func (x *FetchKeyPackagesResponse) GetKeyPackages() []*FetchKeyPackagesResponse_KeyPackage { + if x != nil { + return x.KeyPackages + } + return nil +} + +// Revoke an installation +type RevokeInstallationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + // All revocations must be validated with a wallet signature over the + // installation_id being revoked (and some sort of standard prologue) + WalletSignature *message_contents.Signature `protobuf:"bytes,2,opt,name=wallet_signature,json=walletSignature,proto3" json:"wallet_signature,omitempty"` +} + +func (x *RevokeInstallationRequest) Reset() { + *x = RevokeInstallationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RevokeInstallationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeInstallationRequest) ProtoMessage() {} + +func (x *RevokeInstallationRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeInstallationRequest.ProtoReflect.Descriptor instead. +func (*RevokeInstallationRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{12} +} + +func (x *RevokeInstallationRequest) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *RevokeInstallationRequest) GetWalletSignature() *message_contents.Signature { + if x != nil { + return x.WalletSignature + } + return nil +} + +// Get all updates for an identity since the specified time +type GetIdentityUpdatesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountAddresses []string `protobuf:"bytes,1,rep,name=account_addresses,json=accountAddresses,proto3" json:"account_addresses,omitempty"` + StartTimeNs uint64 `protobuf:"varint,2,opt,name=start_time_ns,json=startTimeNs,proto3" json:"start_time_ns,omitempty"` +} + +func (x *GetIdentityUpdatesRequest) Reset() { + *x = GetIdentityUpdatesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityUpdatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityUpdatesRequest) ProtoMessage() {} + +func (x *GetIdentityUpdatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityUpdatesRequest.ProtoReflect.Descriptor instead. +func (*GetIdentityUpdatesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{13} +} + +func (x *GetIdentityUpdatesRequest) GetAccountAddresses() []string { + if x != nil { + return x.AccountAddresses + } + return nil +} + +func (x *GetIdentityUpdatesRequest) GetStartTimeNs() uint64 { + if x != nil { + return x.StartTimeNs + } + return 0 +} + +// Used to get any new or revoked installations for a list of wallet addresses +type GetIdentityUpdatesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A list of updates (or empty objects if no changes) in the original order + // of the request + Updates []*GetIdentityUpdatesResponse_WalletUpdates `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` +} + +func (x *GetIdentityUpdatesResponse) Reset() { + *x = GetIdentityUpdatesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityUpdatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityUpdatesResponse) ProtoMessage() {} + +func (x *GetIdentityUpdatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityUpdatesResponse.ProtoReflect.Descriptor instead. +func (*GetIdentityUpdatesResponse) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{14} +} + +func (x *GetIdentityUpdatesResponse) GetUpdates() []*GetIdentityUpdatesResponse_WalletUpdates { + if x != nil { + return x.Updates + } + return nil +} + +// Pagination config for queries +type PagingInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Direction SortDirection `protobuf:"varint,1,opt,name=direction,proto3,enum=xmtp.mls.api.v1.SortDirection" json:"direction,omitempty"` + Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + IdCursor uint64 `protobuf:"varint,3,opt,name=id_cursor,json=idCursor,proto3" json:"id_cursor,omitempty"` +} + +func (x *PagingInfo) Reset() { + *x = PagingInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PagingInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PagingInfo) ProtoMessage() {} + +func (x *PagingInfo) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PagingInfo.ProtoReflect.Descriptor instead. +func (*PagingInfo) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{15} +} + +func (x *PagingInfo) GetDirection() SortDirection { + if x != nil { + return x.Direction + } + return SortDirection_SORT_DIRECTION_UNSPECIFIED +} + +func (x *PagingInfo) GetLimit() uint32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *PagingInfo) GetIdCursor() uint64 { + if x != nil { + return x.IdCursor + } + return 0 +} + +// Request for group message queries +type QueryGroupMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId []byte `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"` +} + +func (x *QueryGroupMessagesRequest) Reset() { + *x = QueryGroupMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGroupMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGroupMessagesRequest) ProtoMessage() {} + +func (x *QueryGroupMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryGroupMessagesRequest.ProtoReflect.Descriptor instead. +func (*QueryGroupMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{16} +} + +func (x *QueryGroupMessagesRequest) GetGroupId() []byte { + if x != nil { + return x.GroupId + } + return nil +} + +func (x *QueryGroupMessagesRequest) GetPagingInfo() *PagingInfo { + if x != nil { + return x.PagingInfo + } + return nil +} + +// Response for group message queries +type QueryGroupMessagesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Messages []*GroupMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"` +} + +func (x *QueryGroupMessagesResponse) Reset() { + *x = QueryGroupMessagesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGroupMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGroupMessagesResponse) ProtoMessage() {} + +func (x *QueryGroupMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryGroupMessagesResponse.ProtoReflect.Descriptor instead. +func (*QueryGroupMessagesResponse) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{17} +} + +func (x *QueryGroupMessagesResponse) GetMessages() []*GroupMessage { + if x != nil { + return x.Messages + } + return nil +} + +func (x *QueryGroupMessagesResponse) GetPagingInfo() *PagingInfo { + if x != nil { + return x.PagingInfo + } + return nil +} + +// Request for welcome message queries +type QueryWelcomeMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"` +} + +func (x *QueryWelcomeMessagesRequest) Reset() { + *x = QueryWelcomeMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryWelcomeMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryWelcomeMessagesRequest) ProtoMessage() {} + +func (x *QueryWelcomeMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryWelcomeMessagesRequest.ProtoReflect.Descriptor instead. +func (*QueryWelcomeMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{18} +} + +func (x *QueryWelcomeMessagesRequest) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *QueryWelcomeMessagesRequest) GetPagingInfo() *PagingInfo { + if x != nil { + return x.PagingInfo + } + return nil +} + +// Response for welcome message queries +type QueryWelcomeMessagesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Messages []*WelcomeMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + PagingInfo *PagingInfo `protobuf:"bytes,2,opt,name=paging_info,json=pagingInfo,proto3" json:"paging_info,omitempty"` +} + +func (x *QueryWelcomeMessagesResponse) Reset() { + *x = QueryWelcomeMessagesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryWelcomeMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryWelcomeMessagesResponse) ProtoMessage() {} + +func (x *QueryWelcomeMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryWelcomeMessagesResponse.ProtoReflect.Descriptor instead. +func (*QueryWelcomeMessagesResponse) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{19} +} + +func (x *QueryWelcomeMessagesResponse) GetMessages() []*WelcomeMessage { + if x != nil { + return x.Messages + } + return nil +} + +func (x *QueryWelcomeMessagesResponse) GetPagingInfo() *PagingInfo { + if x != nil { + return x.PagingInfo + } + return nil +} + +// Request for subscribing to group messages +type SubscribeGroupMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filters []*SubscribeGroupMessagesRequest_Filter `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *SubscribeGroupMessagesRequest) Reset() { + *x = SubscribeGroupMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeGroupMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeGroupMessagesRequest) ProtoMessage() {} + +func (x *SubscribeGroupMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeGroupMessagesRequest.ProtoReflect.Descriptor instead. +func (*SubscribeGroupMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{20} +} + +func (x *SubscribeGroupMessagesRequest) GetFilters() []*SubscribeGroupMessagesRequest_Filter { + if x != nil { + return x.Filters + } + return nil +} + +// Request for subscribing to welcome messages +type SubscribeWelcomeMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filters []*SubscribeWelcomeMessagesRequest_Filter `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *SubscribeWelcomeMessagesRequest) Reset() { + *x = SubscribeWelcomeMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeWelcomeMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeWelcomeMessagesRequest) ProtoMessage() {} + +func (x *SubscribeWelcomeMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeWelcomeMessagesRequest.ProtoReflect.Descriptor instead. +func (*SubscribeWelcomeMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{21} +} + +func (x *SubscribeWelcomeMessagesRequest) GetFilters() []*SubscribeWelcomeMessagesRequest_Filter { + if x != nil { + return x.Filters + } + return nil +} + +// Version 1 of the WelcomeMessage format +type WelcomeMessage_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + InstallationKey []byte `protobuf:"bytes,3,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *WelcomeMessage_V1) Reset() { + *x = WelcomeMessage_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WelcomeMessage_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WelcomeMessage_V1) ProtoMessage() {} + +func (x *WelcomeMessage_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WelcomeMessage_V1.ProtoReflect.Descriptor instead. +func (*WelcomeMessage_V1) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *WelcomeMessage_V1) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *WelcomeMessage_V1) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (x *WelcomeMessage_V1) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *WelcomeMessage_V1) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Version 1 of the WelcomeMessageInput format +type WelcomeMessageInput_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *WelcomeMessageInput_V1) Reset() { + *x = WelcomeMessageInput_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WelcomeMessageInput_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WelcomeMessageInput_V1) ProtoMessage() {} + +func (x *WelcomeMessageInput_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WelcomeMessageInput_V1.ProtoReflect.Descriptor instead. +func (*WelcomeMessageInput_V1) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *WelcomeMessageInput_V1) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *WelcomeMessageInput_V1) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Version 1 of the GroupMessage format +type GroupMessage_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + GroupId []byte `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GroupMessage_V1) Reset() { + *x = GroupMessage_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMessage_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMessage_V1) ProtoMessage() {} + +func (x *GroupMessage_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMessage_V1.ProtoReflect.Descriptor instead. +func (*GroupMessage_V1) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *GroupMessage_V1) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GroupMessage_V1) GetCreatedNs() uint64 { + if x != nil { + return x.CreatedNs + } + return 0 +} + +func (x *GroupMessage_V1) GetGroupId() []byte { + if x != nil { + return x.GroupId + } + return nil +} + +func (x *GroupMessage_V1) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Version 1 of the GroupMessageInput payload format +type GroupMessageInput_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GroupMessageInput_V1) Reset() { + *x = GroupMessageInput_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMessageInput_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMessageInput_V1) ProtoMessage() {} + +func (x *GroupMessageInput_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMessageInput_V1.ProtoReflect.Descriptor instead. +func (*GroupMessageInput_V1) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *GroupMessageInput_V1) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// An individual key package +type FetchKeyPackagesResponse_KeyPackage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyPackageTlsSerialized []byte `protobuf:"bytes,1,opt,name=key_package_tls_serialized,json=keyPackageTlsSerialized,proto3" json:"key_package_tls_serialized,omitempty"` +} + +func (x *FetchKeyPackagesResponse_KeyPackage) Reset() { + *x = FetchKeyPackagesResponse_KeyPackage{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FetchKeyPackagesResponse_KeyPackage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchKeyPackagesResponse_KeyPackage) ProtoMessage() {} + +func (x *FetchKeyPackagesResponse_KeyPackage) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchKeyPackagesResponse_KeyPackage.ProtoReflect.Descriptor instead. +func (*FetchKeyPackagesResponse_KeyPackage) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *FetchKeyPackagesResponse_KeyPackage) GetKeyPackageTlsSerialized() []byte { + if x != nil { + return x.KeyPackageTlsSerialized + } + return nil +} + +// A new installation key was seen for the first time by the nodes +type GetIdentityUpdatesResponse_NewInstallationUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + CredentialIdentity []byte `protobuf:"bytes,2,opt,name=credential_identity,json=credentialIdentity,proto3" json:"credential_identity,omitempty"` +} + +func (x *GetIdentityUpdatesResponse_NewInstallationUpdate) Reset() { + *x = GetIdentityUpdatesResponse_NewInstallationUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityUpdatesResponse_NewInstallationUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityUpdatesResponse_NewInstallationUpdate) ProtoMessage() {} + +func (x *GetIdentityUpdatesResponse_NewInstallationUpdate) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityUpdatesResponse_NewInstallationUpdate.ProtoReflect.Descriptor instead. +func (*GetIdentityUpdatesResponse_NewInstallationUpdate) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *GetIdentityUpdatesResponse_NewInstallationUpdate) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *GetIdentityUpdatesResponse_NewInstallationUpdate) GetCredentialIdentity() []byte { + if x != nil { + return x.CredentialIdentity + } + return nil +} + +// An installation was revoked +type GetIdentityUpdatesResponse_RevokedInstallationUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` +} + +func (x *GetIdentityUpdatesResponse_RevokedInstallationUpdate) Reset() { + *x = GetIdentityUpdatesResponse_RevokedInstallationUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityUpdatesResponse_RevokedInstallationUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityUpdatesResponse_RevokedInstallationUpdate) ProtoMessage() {} + +func (x *GetIdentityUpdatesResponse_RevokedInstallationUpdate) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityUpdatesResponse_RevokedInstallationUpdate.ProtoReflect.Descriptor instead. +func (*GetIdentityUpdatesResponse_RevokedInstallationUpdate) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{14, 1} +} + +func (x *GetIdentityUpdatesResponse_RevokedInstallationUpdate) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +// A wrapper for any update to the wallet +type GetIdentityUpdatesResponse_Update struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimestampNs uint64 `protobuf:"varint,1,opt,name=timestamp_ns,json=timestampNs,proto3" json:"timestamp_ns,omitempty"` + // Types that are assignable to Kind: + // + // *GetIdentityUpdatesResponse_Update_NewInstallation + // *GetIdentityUpdatesResponse_Update_RevokedInstallation + Kind isGetIdentityUpdatesResponse_Update_Kind `protobuf_oneof:"kind"` +} + +func (x *GetIdentityUpdatesResponse_Update) Reset() { + *x = GetIdentityUpdatesResponse_Update{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityUpdatesResponse_Update) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityUpdatesResponse_Update) ProtoMessage() {} + +func (x *GetIdentityUpdatesResponse_Update) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityUpdatesResponse_Update.ProtoReflect.Descriptor instead. +func (*GetIdentityUpdatesResponse_Update) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{14, 2} +} + +func (x *GetIdentityUpdatesResponse_Update) GetTimestampNs() uint64 { + if x != nil { + return x.TimestampNs + } + return 0 +} + +func (m *GetIdentityUpdatesResponse_Update) GetKind() isGetIdentityUpdatesResponse_Update_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *GetIdentityUpdatesResponse_Update) GetNewInstallation() *GetIdentityUpdatesResponse_NewInstallationUpdate { + if x, ok := x.GetKind().(*GetIdentityUpdatesResponse_Update_NewInstallation); ok { + return x.NewInstallation + } + return nil +} + +func (x *GetIdentityUpdatesResponse_Update) GetRevokedInstallation() *GetIdentityUpdatesResponse_RevokedInstallationUpdate { + if x, ok := x.GetKind().(*GetIdentityUpdatesResponse_Update_RevokedInstallation); ok { + return x.RevokedInstallation + } + return nil +} + +type isGetIdentityUpdatesResponse_Update_Kind interface { + isGetIdentityUpdatesResponse_Update_Kind() +} + +type GetIdentityUpdatesResponse_Update_NewInstallation struct { + NewInstallation *GetIdentityUpdatesResponse_NewInstallationUpdate `protobuf:"bytes,2,opt,name=new_installation,json=newInstallation,proto3,oneof"` +} + +type GetIdentityUpdatesResponse_Update_RevokedInstallation struct { + RevokedInstallation *GetIdentityUpdatesResponse_RevokedInstallationUpdate `protobuf:"bytes,3,opt,name=revoked_installation,json=revokedInstallation,proto3,oneof"` +} + +func (*GetIdentityUpdatesResponse_Update_NewInstallation) isGetIdentityUpdatesResponse_Update_Kind() { +} + +func (*GetIdentityUpdatesResponse_Update_RevokedInstallation) isGetIdentityUpdatesResponse_Update_Kind() { +} + +// A wrapper for the updates for a single wallet +type GetIdentityUpdatesResponse_WalletUpdates struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Updates []*GetIdentityUpdatesResponse_Update `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` +} + +func (x *GetIdentityUpdatesResponse_WalletUpdates) Reset() { + *x = GetIdentityUpdatesResponse_WalletUpdates{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityUpdatesResponse_WalletUpdates) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityUpdatesResponse_WalletUpdates) ProtoMessage() {} + +func (x *GetIdentityUpdatesResponse_WalletUpdates) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityUpdatesResponse_WalletUpdates.ProtoReflect.Descriptor instead. +func (*GetIdentityUpdatesResponse_WalletUpdates) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{14, 3} +} + +func (x *GetIdentityUpdatesResponse_WalletUpdates) GetUpdates() []*GetIdentityUpdatesResponse_Update { + if x != nil { + return x.Updates + } + return nil +} + +// Subscription filter +type SubscribeGroupMessagesRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId []byte `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + IdCursor uint64 `protobuf:"varint,2,opt,name=id_cursor,json=idCursor,proto3" json:"id_cursor,omitempty"` +} + +func (x *SubscribeGroupMessagesRequest_Filter) Reset() { + *x = SubscribeGroupMessagesRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeGroupMessagesRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeGroupMessagesRequest_Filter) ProtoMessage() {} + +func (x *SubscribeGroupMessagesRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeGroupMessagesRequest_Filter.ProtoReflect.Descriptor instead. +func (*SubscribeGroupMessagesRequest_Filter) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{20, 0} +} + +func (x *SubscribeGroupMessagesRequest_Filter) GetGroupId() []byte { + if x != nil { + return x.GroupId + } + return nil +} + +func (x *SubscribeGroupMessagesRequest_Filter) GetIdCursor() uint64 { + if x != nil { + return x.IdCursor + } + return 0 +} + +// Subscription filter +type SubscribeWelcomeMessagesRequest_Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + IdCursor uint64 `protobuf:"varint,2,opt,name=id_cursor,json=idCursor,proto3" json:"id_cursor,omitempty"` +} + +func (x *SubscribeWelcomeMessagesRequest_Filter) Reset() { + *x = SubscribeWelcomeMessagesRequest_Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_api_v1_mls_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubscribeWelcomeMessagesRequest_Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeWelcomeMessagesRequest_Filter) ProtoMessage() {} + +func (x *SubscribeWelcomeMessagesRequest_Filter) ProtoReflect() protoreflect.Message { + mi := &file_mls_api_v1_mls_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeWelcomeMessagesRequest_Filter.ProtoReflect.Descriptor instead. +func (*SubscribeWelcomeMessagesRequest_Filter) Descriptor() ([]byte, []int) { + return file_mls_api_v1_mls_proto_rawDescGZIP(), []int{21, 0} +} + +func (x *SubscribeWelcomeMessagesRequest_Filter) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *SubscribeWelcomeMessagesRequest_Filter) GetIdCursor() uint64 { + if x != nil { + return x.IdCursor + } + return 0 +} + +var File_mls_api_v1_mls_proto protoreflect.FileDescriptor + +var file_mls_api_v1_mls_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6d, 0x6c, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6c, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x0e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x72, 0x0a, + 0x02, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x4e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa0, 0x01, 0x0a, + 0x13, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x12, 0x39, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, + 0x43, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, + 0xb1, 0x01, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x32, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x31, 0x48, 0x00, + 0x52, 0x02, 0x76, 0x31, 0x1a, 0x62, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, + 0x31, 0x1a, 0x18, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x18, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x1a, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x10, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x6b, 0x65, 0x79, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x64, 0x22, 0x61, 0x0a, 0x1b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0x49, 0x0a, 0x1c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, + 0x79, 0x22, 0x5d, 0x0a, 0x17, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0b, + 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x22, 0x46, 0x0a, 0x17, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xbe, 0x01, 0x0a, 0x18, 0x46, 0x65, 0x74, + 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x1a, 0x49, + 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x1a, + 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, + 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x17, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x6c, 0x73, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x19, 0x52, 0x65, + 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, + 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x10, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, + 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0x6c, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x22, 0xaf, 0x05, + 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x07, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x57, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x1a, 0x73, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x46, 0x0a, 0x19, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, + 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x9f, + 0x02, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x73, 0x12, 0x6e, 0x0a, 0x10, + 0x6e, 0x65, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x65, 0x77, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x6e, 0x65, 0x77, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x0a, 0x14, + 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x1a, 0x5d, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x22, + 0x7d, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, + 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x74, + 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, + 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x3c, + 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x86, 0x01, 0x0a, + 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, + 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, + 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, + 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x19, + 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, + 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, + 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0xc6, 0x01, 0x0a, 0x1f, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x07, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x50, 0x0a, + 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, + 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x2a, + 0x6c, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1d, + 0x0a, 0x19, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x32, 0xcd, 0x0c, + 0x0a, 0x06, 0x4d, 0x6c, 0x73, 0x41, 0x70, 0x69, 0x12, 0x7e, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x6e, + 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x12, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, + 0x22, 0x1d, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2d, 0x77, + 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, + 0x9d, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, + 0x22, 0x1d, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x7b, 0x0a, 0x10, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x12, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, + 0x22, 0x1a, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x8e, 0x01, 0x0a, + 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x73, 0x12, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, + 0x2a, 0x22, 0x1a, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, + 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x80, 0x01, + 0x0a, 0x12, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x96, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x6d, 0x6c, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x12, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, + 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, + 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2d, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x30, 0x01, 0x12, 0x9e, 0x01, 0x0a, + 0x18, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, + 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2d, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x77, 0x65, 0x6c, 0x63, 0x6f, + 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x30, 0x01, 0x42, 0xc9, 0x01, + 0x92, 0x41, 0x0f, 0x12, 0x0d, 0x0a, 0x06, 0x4d, 0x6c, 0x73, 0x41, 0x70, 0x69, 0x32, 0x03, 0x31, + 0x2e, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4d, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, + 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x58, + 0x4d, 0x41, 0xaa, 0x02, 0x0f, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x2e, 0x41, 0x70, + 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, + 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, + 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, + 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_mls_api_v1_mls_proto_rawDescOnce sync.Once + file_mls_api_v1_mls_proto_rawDescData = file_mls_api_v1_mls_proto_rawDesc +) + +func file_mls_api_v1_mls_proto_rawDescGZIP() []byte { + file_mls_api_v1_mls_proto_rawDescOnce.Do(func() { + file_mls_api_v1_mls_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_api_v1_mls_proto_rawDescData) + }) + return file_mls_api_v1_mls_proto_rawDescData +} + +var file_mls_api_v1_mls_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_mls_api_v1_mls_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_mls_api_v1_mls_proto_goTypes = []interface{}{ + (SortDirection)(0), // 0: xmtp.mls.api.v1.SortDirection + (*WelcomeMessage)(nil), // 1: xmtp.mls.api.v1.WelcomeMessage + (*WelcomeMessageInput)(nil), // 2: xmtp.mls.api.v1.WelcomeMessageInput + (*GroupMessage)(nil), // 3: xmtp.mls.api.v1.GroupMessage + (*GroupMessageInput)(nil), // 4: xmtp.mls.api.v1.GroupMessageInput + (*SendGroupMessagesRequest)(nil), // 5: xmtp.mls.api.v1.SendGroupMessagesRequest + (*SendWelcomeMessagesRequest)(nil), // 6: xmtp.mls.api.v1.SendWelcomeMessagesRequest + (*KeyPackageUpload)(nil), // 7: xmtp.mls.api.v1.KeyPackageUpload + (*RegisterInstallationRequest)(nil), // 8: xmtp.mls.api.v1.RegisterInstallationRequest + (*RegisterInstallationResponse)(nil), // 9: xmtp.mls.api.v1.RegisterInstallationResponse + (*UploadKeyPackageRequest)(nil), // 10: xmtp.mls.api.v1.UploadKeyPackageRequest + (*FetchKeyPackagesRequest)(nil), // 11: xmtp.mls.api.v1.FetchKeyPackagesRequest + (*FetchKeyPackagesResponse)(nil), // 12: xmtp.mls.api.v1.FetchKeyPackagesResponse + (*RevokeInstallationRequest)(nil), // 13: xmtp.mls.api.v1.RevokeInstallationRequest + (*GetIdentityUpdatesRequest)(nil), // 14: xmtp.mls.api.v1.GetIdentityUpdatesRequest + (*GetIdentityUpdatesResponse)(nil), // 15: xmtp.mls.api.v1.GetIdentityUpdatesResponse + (*PagingInfo)(nil), // 16: xmtp.mls.api.v1.PagingInfo + (*QueryGroupMessagesRequest)(nil), // 17: xmtp.mls.api.v1.QueryGroupMessagesRequest + (*QueryGroupMessagesResponse)(nil), // 18: xmtp.mls.api.v1.QueryGroupMessagesResponse + (*QueryWelcomeMessagesRequest)(nil), // 19: xmtp.mls.api.v1.QueryWelcomeMessagesRequest + (*QueryWelcomeMessagesResponse)(nil), // 20: xmtp.mls.api.v1.QueryWelcomeMessagesResponse + (*SubscribeGroupMessagesRequest)(nil), // 21: xmtp.mls.api.v1.SubscribeGroupMessagesRequest + (*SubscribeWelcomeMessagesRequest)(nil), // 22: xmtp.mls.api.v1.SubscribeWelcomeMessagesRequest + (*WelcomeMessage_V1)(nil), // 23: xmtp.mls.api.v1.WelcomeMessage.V1 + (*WelcomeMessageInput_V1)(nil), // 24: xmtp.mls.api.v1.WelcomeMessageInput.V1 + (*GroupMessage_V1)(nil), // 25: xmtp.mls.api.v1.GroupMessage.V1 + (*GroupMessageInput_V1)(nil), // 26: xmtp.mls.api.v1.GroupMessageInput.V1 + (*FetchKeyPackagesResponse_KeyPackage)(nil), // 27: xmtp.mls.api.v1.FetchKeyPackagesResponse.KeyPackage + (*GetIdentityUpdatesResponse_NewInstallationUpdate)(nil), // 28: xmtp.mls.api.v1.GetIdentityUpdatesResponse.NewInstallationUpdate + (*GetIdentityUpdatesResponse_RevokedInstallationUpdate)(nil), // 29: xmtp.mls.api.v1.GetIdentityUpdatesResponse.RevokedInstallationUpdate + (*GetIdentityUpdatesResponse_Update)(nil), // 30: xmtp.mls.api.v1.GetIdentityUpdatesResponse.Update + (*GetIdentityUpdatesResponse_WalletUpdates)(nil), // 31: xmtp.mls.api.v1.GetIdentityUpdatesResponse.WalletUpdates + (*SubscribeGroupMessagesRequest_Filter)(nil), // 32: xmtp.mls.api.v1.SubscribeGroupMessagesRequest.Filter + (*SubscribeWelcomeMessagesRequest_Filter)(nil), // 33: xmtp.mls.api.v1.SubscribeWelcomeMessagesRequest.Filter + (*message_contents.Signature)(nil), // 34: xmtp.message_contents.Signature + (*emptypb.Empty)(nil), // 35: google.protobuf.Empty +} +var file_mls_api_v1_mls_proto_depIdxs = []int32{ + 23, // 0: xmtp.mls.api.v1.WelcomeMessage.v1:type_name -> xmtp.mls.api.v1.WelcomeMessage.V1 + 24, // 1: xmtp.mls.api.v1.WelcomeMessageInput.v1:type_name -> xmtp.mls.api.v1.WelcomeMessageInput.V1 + 25, // 2: xmtp.mls.api.v1.GroupMessage.v1:type_name -> xmtp.mls.api.v1.GroupMessage.V1 + 26, // 3: xmtp.mls.api.v1.GroupMessageInput.v1:type_name -> xmtp.mls.api.v1.GroupMessageInput.V1 + 4, // 4: xmtp.mls.api.v1.SendGroupMessagesRequest.messages:type_name -> xmtp.mls.api.v1.GroupMessageInput + 2, // 5: xmtp.mls.api.v1.SendWelcomeMessagesRequest.messages:type_name -> xmtp.mls.api.v1.WelcomeMessageInput + 7, // 6: xmtp.mls.api.v1.RegisterInstallationRequest.key_package:type_name -> xmtp.mls.api.v1.KeyPackageUpload + 7, // 7: xmtp.mls.api.v1.UploadKeyPackageRequest.key_package:type_name -> xmtp.mls.api.v1.KeyPackageUpload + 27, // 8: xmtp.mls.api.v1.FetchKeyPackagesResponse.key_packages:type_name -> xmtp.mls.api.v1.FetchKeyPackagesResponse.KeyPackage + 34, // 9: xmtp.mls.api.v1.RevokeInstallationRequest.wallet_signature:type_name -> xmtp.message_contents.Signature + 31, // 10: xmtp.mls.api.v1.GetIdentityUpdatesResponse.updates:type_name -> xmtp.mls.api.v1.GetIdentityUpdatesResponse.WalletUpdates + 0, // 11: xmtp.mls.api.v1.PagingInfo.direction:type_name -> xmtp.mls.api.v1.SortDirection + 16, // 12: xmtp.mls.api.v1.QueryGroupMessagesRequest.paging_info:type_name -> xmtp.mls.api.v1.PagingInfo + 3, // 13: xmtp.mls.api.v1.QueryGroupMessagesResponse.messages:type_name -> xmtp.mls.api.v1.GroupMessage + 16, // 14: xmtp.mls.api.v1.QueryGroupMessagesResponse.paging_info:type_name -> xmtp.mls.api.v1.PagingInfo + 16, // 15: xmtp.mls.api.v1.QueryWelcomeMessagesRequest.paging_info:type_name -> xmtp.mls.api.v1.PagingInfo + 1, // 16: xmtp.mls.api.v1.QueryWelcomeMessagesResponse.messages:type_name -> xmtp.mls.api.v1.WelcomeMessage + 16, // 17: xmtp.mls.api.v1.QueryWelcomeMessagesResponse.paging_info:type_name -> xmtp.mls.api.v1.PagingInfo + 32, // 18: xmtp.mls.api.v1.SubscribeGroupMessagesRequest.filters:type_name -> xmtp.mls.api.v1.SubscribeGroupMessagesRequest.Filter + 33, // 19: xmtp.mls.api.v1.SubscribeWelcomeMessagesRequest.filters:type_name -> xmtp.mls.api.v1.SubscribeWelcomeMessagesRequest.Filter + 28, // 20: xmtp.mls.api.v1.GetIdentityUpdatesResponse.Update.new_installation:type_name -> xmtp.mls.api.v1.GetIdentityUpdatesResponse.NewInstallationUpdate + 29, // 21: xmtp.mls.api.v1.GetIdentityUpdatesResponse.Update.revoked_installation:type_name -> xmtp.mls.api.v1.GetIdentityUpdatesResponse.RevokedInstallationUpdate + 30, // 22: xmtp.mls.api.v1.GetIdentityUpdatesResponse.WalletUpdates.updates:type_name -> xmtp.mls.api.v1.GetIdentityUpdatesResponse.Update + 5, // 23: xmtp.mls.api.v1.MlsApi.SendGroupMessages:input_type -> xmtp.mls.api.v1.SendGroupMessagesRequest + 6, // 24: xmtp.mls.api.v1.MlsApi.SendWelcomeMessages:input_type -> xmtp.mls.api.v1.SendWelcomeMessagesRequest + 8, // 25: xmtp.mls.api.v1.MlsApi.RegisterInstallation:input_type -> xmtp.mls.api.v1.RegisterInstallationRequest + 10, // 26: xmtp.mls.api.v1.MlsApi.UploadKeyPackage:input_type -> xmtp.mls.api.v1.UploadKeyPackageRequest + 11, // 27: xmtp.mls.api.v1.MlsApi.FetchKeyPackages:input_type -> xmtp.mls.api.v1.FetchKeyPackagesRequest + 13, // 28: xmtp.mls.api.v1.MlsApi.RevokeInstallation:input_type -> xmtp.mls.api.v1.RevokeInstallationRequest + 14, // 29: xmtp.mls.api.v1.MlsApi.GetIdentityUpdates:input_type -> xmtp.mls.api.v1.GetIdentityUpdatesRequest + 17, // 30: xmtp.mls.api.v1.MlsApi.QueryGroupMessages:input_type -> xmtp.mls.api.v1.QueryGroupMessagesRequest + 19, // 31: xmtp.mls.api.v1.MlsApi.QueryWelcomeMessages:input_type -> xmtp.mls.api.v1.QueryWelcomeMessagesRequest + 21, // 32: xmtp.mls.api.v1.MlsApi.SubscribeGroupMessages:input_type -> xmtp.mls.api.v1.SubscribeGroupMessagesRequest + 22, // 33: xmtp.mls.api.v1.MlsApi.SubscribeWelcomeMessages:input_type -> xmtp.mls.api.v1.SubscribeWelcomeMessagesRequest + 35, // 34: xmtp.mls.api.v1.MlsApi.SendGroupMessages:output_type -> google.protobuf.Empty + 35, // 35: xmtp.mls.api.v1.MlsApi.SendWelcomeMessages:output_type -> google.protobuf.Empty + 9, // 36: xmtp.mls.api.v1.MlsApi.RegisterInstallation:output_type -> xmtp.mls.api.v1.RegisterInstallationResponse + 35, // 37: xmtp.mls.api.v1.MlsApi.UploadKeyPackage:output_type -> google.protobuf.Empty + 12, // 38: xmtp.mls.api.v1.MlsApi.FetchKeyPackages:output_type -> xmtp.mls.api.v1.FetchKeyPackagesResponse + 35, // 39: xmtp.mls.api.v1.MlsApi.RevokeInstallation:output_type -> google.protobuf.Empty + 15, // 40: xmtp.mls.api.v1.MlsApi.GetIdentityUpdates:output_type -> xmtp.mls.api.v1.GetIdentityUpdatesResponse + 18, // 41: xmtp.mls.api.v1.MlsApi.QueryGroupMessages:output_type -> xmtp.mls.api.v1.QueryGroupMessagesResponse + 20, // 42: xmtp.mls.api.v1.MlsApi.QueryWelcomeMessages:output_type -> xmtp.mls.api.v1.QueryWelcomeMessagesResponse + 3, // 43: xmtp.mls.api.v1.MlsApi.SubscribeGroupMessages:output_type -> xmtp.mls.api.v1.GroupMessage + 1, // 44: xmtp.mls.api.v1.MlsApi.SubscribeWelcomeMessages:output_type -> xmtp.mls.api.v1.WelcomeMessage + 34, // [34:45] is the sub-list for method output_type + 23, // [23:34] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name +} + +func init() { file_mls_api_v1_mls_proto_init() } +func file_mls_api_v1_mls_proto_init() { + if File_mls_api_v1_mls_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_api_v1_mls_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WelcomeMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WelcomeMessageInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMessageInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendGroupMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendWelcomeMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyPackageUpload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterInstallationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterInstallationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadKeyPackageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchKeyPackagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchKeyPackagesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeInstallationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityUpdatesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityUpdatesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PagingInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGroupMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGroupMessagesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryWelcomeMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryWelcomeMessagesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeGroupMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeWelcomeMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WelcomeMessage_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WelcomeMessageInput_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMessage_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMessageInput_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FetchKeyPackagesResponse_KeyPackage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityUpdatesResponse_NewInstallationUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityUpdatesResponse_RevokedInstallationUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityUpdatesResponse_Update); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityUpdatesResponse_WalletUpdates); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeGroupMessagesRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_api_v1_mls_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubscribeWelcomeMessagesRequest_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mls_api_v1_mls_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*WelcomeMessage_V1_)(nil), + } + file_mls_api_v1_mls_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*WelcomeMessageInput_V1_)(nil), + } + file_mls_api_v1_mls_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*GroupMessage_V1_)(nil), + } + file_mls_api_v1_mls_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*GroupMessageInput_V1_)(nil), + } + file_mls_api_v1_mls_proto_msgTypes[29].OneofWrappers = []interface{}{ + (*GetIdentityUpdatesResponse_Update_NewInstallation)(nil), + (*GetIdentityUpdatesResponse_Update_RevokedInstallation)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_api_v1_mls_proto_rawDesc, + NumEnums: 1, + NumMessages: 33, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mls_api_v1_mls_proto_goTypes, + DependencyIndexes: file_mls_api_v1_mls_proto_depIdxs, + EnumInfos: file_mls_api_v1_mls_proto_enumTypes, + MessageInfos: file_mls_api_v1_mls_proto_msgTypes, + }.Build() + File_mls_api_v1_mls_proto = out.File + file_mls_api_v1_mls_proto_rawDesc = nil + file_mls_api_v1_mls_proto_goTypes = nil + file_mls_api_v1_mls_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/api/v1/mls.pb.gw.go b/pkg/proto/mls/api/v1/mls.pb.gw.go new file mode 100644 index 00000000..81e69096 --- /dev/null +++ b/pkg/proto/mls/api/v1/mls.pb.gw.go @@ -0,0 +1,887 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: mls/api/v1/mls.proto + +/* +Package apiv1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package apiv1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_MlsApi_SendGroupMessages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SendGroupMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendGroupMessages(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_SendGroupMessages_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SendGroupMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendGroupMessages(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_SendWelcomeMessages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SendWelcomeMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendWelcomeMessages(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_SendWelcomeMessages_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SendWelcomeMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendWelcomeMessages(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_RegisterInstallation_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterInstallationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RegisterInstallation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_RegisterInstallation_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegisterInstallationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RegisterInstallation(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_UploadKeyPackage_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadKeyPackageRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UploadKeyPackage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_UploadKeyPackage_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadKeyPackageRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UploadKeyPackage(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_FetchKeyPackages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FetchKeyPackagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FetchKeyPackages(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_FetchKeyPackages_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FetchKeyPackagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FetchKeyPackages(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_RevokeInstallation_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RevokeInstallationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RevokeInstallation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_RevokeInstallation_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RevokeInstallationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RevokeInstallation(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_GetIdentityUpdates_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetIdentityUpdatesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetIdentityUpdates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_GetIdentityUpdates_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetIdentityUpdatesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetIdentityUpdates(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_QueryGroupMessages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryGroupMessages(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_QueryGroupMessages_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryGroupMessages(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_QueryWelcomeMessages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryWelcomeMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryWelcomeMessages(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MlsApi_QueryWelcomeMessages_0(ctx context.Context, marshaler runtime.Marshaler, server MlsApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryWelcomeMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryWelcomeMessages(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MlsApi_SubscribeGroupMessages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (MlsApi_SubscribeGroupMessagesClient, runtime.ServerMetadata, error) { + var protoReq SubscribeGroupMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.SubscribeGroupMessages(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_MlsApi_SubscribeWelcomeMessages_0(ctx context.Context, marshaler runtime.Marshaler, client MlsApiClient, req *http.Request, pathParams map[string]string) (MlsApi_SubscribeWelcomeMessagesClient, runtime.ServerMetadata, error) { + var protoReq SubscribeWelcomeMessagesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.SubscribeWelcomeMessages(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterMlsApiHandlerServer registers the http handlers for service MlsApi to "mux". +// UnaryRPC :call MlsApiServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMlsApiHandlerFromEndpoint instead. +func RegisterMlsApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MlsApiServer) error { + + mux.Handle("POST", pattern_MlsApi_SendGroupMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/SendGroupMessages", runtime.WithHTTPPathPattern("/mls/v1/send-group-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_SendGroupMessages_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_SendGroupMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_SendWelcomeMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/SendWelcomeMessages", runtime.WithHTTPPathPattern("/mls/v1/send-welcome-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_SendWelcomeMessages_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_SendWelcomeMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_RegisterInstallation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/RegisterInstallation", runtime.WithHTTPPathPattern("/mls/v1/register-installation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_RegisterInstallation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_RegisterInstallation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_UploadKeyPackage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/UploadKeyPackage", runtime.WithHTTPPathPattern("/mls/v1/upload-key-package")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_UploadKeyPackage_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_UploadKeyPackage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_FetchKeyPackages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/FetchKeyPackages", runtime.WithHTTPPathPattern("/mls/v1/fetch-key-packages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_FetchKeyPackages_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_FetchKeyPackages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_RevokeInstallation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/RevokeInstallation", runtime.WithHTTPPathPattern("/mls/v1/revoke-installation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_RevokeInstallation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_RevokeInstallation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_GetIdentityUpdates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/GetIdentityUpdates", runtime.WithHTTPPathPattern("/mls/v1/get-identity-updates")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_GetIdentityUpdates_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_GetIdentityUpdates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_QueryGroupMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/QueryGroupMessages", runtime.WithHTTPPathPattern("/mls/v1/query-group-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_QueryGroupMessages_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_QueryGroupMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_QueryWelcomeMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/QueryWelcomeMessages", runtime.WithHTTPPathPattern("/mls/v1/query-welcome-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MlsApi_QueryWelcomeMessages_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_QueryWelcomeMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_SubscribeGroupMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle("POST", pattern_MlsApi_SubscribeWelcomeMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterMlsApiHandlerFromEndpoint is same as RegisterMlsApiHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMlsApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMlsApiHandler(ctx, mux, conn) +} + +// RegisterMlsApiHandler registers the http handlers for service MlsApi to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMlsApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMlsApiHandlerClient(ctx, mux, NewMlsApiClient(conn)) +} + +// RegisterMlsApiHandlerClient registers the http handlers for service MlsApi +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MlsApiClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MlsApiClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MlsApiClient" to call the correct interceptors. +func RegisterMlsApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MlsApiClient) error { + + mux.Handle("POST", pattern_MlsApi_SendGroupMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/SendGroupMessages", runtime.WithHTTPPathPattern("/mls/v1/send-group-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_SendGroupMessages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_SendGroupMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_SendWelcomeMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/SendWelcomeMessages", runtime.WithHTTPPathPattern("/mls/v1/send-welcome-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_SendWelcomeMessages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_SendWelcomeMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_RegisterInstallation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/RegisterInstallation", runtime.WithHTTPPathPattern("/mls/v1/register-installation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_RegisterInstallation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_RegisterInstallation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_UploadKeyPackage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/UploadKeyPackage", runtime.WithHTTPPathPattern("/mls/v1/upload-key-package")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_UploadKeyPackage_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_UploadKeyPackage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_FetchKeyPackages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/FetchKeyPackages", runtime.WithHTTPPathPattern("/mls/v1/fetch-key-packages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_FetchKeyPackages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_FetchKeyPackages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_RevokeInstallation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/RevokeInstallation", runtime.WithHTTPPathPattern("/mls/v1/revoke-installation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_RevokeInstallation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_RevokeInstallation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_GetIdentityUpdates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/GetIdentityUpdates", runtime.WithHTTPPathPattern("/mls/v1/get-identity-updates")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_GetIdentityUpdates_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_GetIdentityUpdates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_QueryGroupMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/QueryGroupMessages", runtime.WithHTTPPathPattern("/mls/v1/query-group-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_QueryGroupMessages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_QueryGroupMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_QueryWelcomeMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/QueryWelcomeMessages", runtime.WithHTTPPathPattern("/mls/v1/query-welcome-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_QueryWelcomeMessages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_QueryWelcomeMessages_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_SubscribeGroupMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/SubscribeGroupMessages", runtime.WithHTTPPathPattern("/mls/v1/subscribe-group-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_SubscribeGroupMessages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_SubscribeGroupMessages_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_MlsApi_SubscribeWelcomeMessages_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.mls.api.v1.MlsApi/SubscribeWelcomeMessages", runtime.WithHTTPPathPattern("/mls/v1/subscribe-welcome-messages")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MlsApi_SubscribeWelcomeMessages_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MlsApi_SubscribeWelcomeMessages_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MlsApi_SendGroupMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "send-group-messages"}, "")) + + pattern_MlsApi_SendWelcomeMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "send-welcome-messages"}, "")) + + pattern_MlsApi_RegisterInstallation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "register-installation"}, "")) + + pattern_MlsApi_UploadKeyPackage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "upload-key-package"}, "")) + + pattern_MlsApi_FetchKeyPackages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "fetch-key-packages"}, "")) + + pattern_MlsApi_RevokeInstallation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "revoke-installation"}, "")) + + pattern_MlsApi_GetIdentityUpdates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "get-identity-updates"}, "")) + + pattern_MlsApi_QueryGroupMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "query-group-messages"}, "")) + + pattern_MlsApi_QueryWelcomeMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "query-welcome-messages"}, "")) + + pattern_MlsApi_SubscribeGroupMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "subscribe-group-messages"}, "")) + + pattern_MlsApi_SubscribeWelcomeMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v1", "subscribe-welcome-messages"}, "")) +) + +var ( + forward_MlsApi_SendGroupMessages_0 = runtime.ForwardResponseMessage + + forward_MlsApi_SendWelcomeMessages_0 = runtime.ForwardResponseMessage + + forward_MlsApi_RegisterInstallation_0 = runtime.ForwardResponseMessage + + forward_MlsApi_UploadKeyPackage_0 = runtime.ForwardResponseMessage + + forward_MlsApi_FetchKeyPackages_0 = runtime.ForwardResponseMessage + + forward_MlsApi_RevokeInstallation_0 = runtime.ForwardResponseMessage + + forward_MlsApi_GetIdentityUpdates_0 = runtime.ForwardResponseMessage + + forward_MlsApi_QueryGroupMessages_0 = runtime.ForwardResponseMessage + + forward_MlsApi_QueryWelcomeMessages_0 = runtime.ForwardResponseMessage + + forward_MlsApi_SubscribeGroupMessages_0 = runtime.ForwardResponseStream + + forward_MlsApi_SubscribeWelcomeMessages_0 = runtime.ForwardResponseStream +) diff --git a/pkg/proto/mls/api/v1/mls_grpc.pb.go b/pkg/proto/mls/api/v1/mls_grpc.pb.go new file mode 100644 index 00000000..6e1e674d --- /dev/null +++ b/pkg/proto/mls/api/v1/mls_grpc.pb.go @@ -0,0 +1,567 @@ +// Message API + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: mls/api/v1/mls.proto + +package apiv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MlsApi_SendGroupMessages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/SendGroupMessages" + MlsApi_SendWelcomeMessages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/SendWelcomeMessages" + MlsApi_RegisterInstallation_FullMethodName = "/xmtp.mls.api.v1.MlsApi/RegisterInstallation" + MlsApi_UploadKeyPackage_FullMethodName = "/xmtp.mls.api.v1.MlsApi/UploadKeyPackage" + MlsApi_FetchKeyPackages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/FetchKeyPackages" + MlsApi_RevokeInstallation_FullMethodName = "/xmtp.mls.api.v1.MlsApi/RevokeInstallation" + MlsApi_GetIdentityUpdates_FullMethodName = "/xmtp.mls.api.v1.MlsApi/GetIdentityUpdates" + MlsApi_QueryGroupMessages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/QueryGroupMessages" + MlsApi_QueryWelcomeMessages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/QueryWelcomeMessages" + MlsApi_SubscribeGroupMessages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/SubscribeGroupMessages" + MlsApi_SubscribeWelcomeMessages_FullMethodName = "/xmtp.mls.api.v1.MlsApi/SubscribeWelcomeMessages" +) + +// MlsApiClient is the client API for MlsApi service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MlsApiClient interface { + // Send a MLS payload, that would be validated before being stored to the + // network + SendGroupMessages(ctx context.Context, in *SendGroupMessagesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Send a batch of welcome messages + SendWelcomeMessages(ctx context.Context, in *SendWelcomeMessagesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Register a new installation, which would be validated before storage + RegisterInstallation(ctx context.Context, in *RegisterInstallationRequest, opts ...grpc.CallOption) (*RegisterInstallationResponse, error) + // Upload a new KeyPackage, which would be validated before storage + UploadKeyPackage(ctx context.Context, in *UploadKeyPackageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Get one or more Key Packages by installation_id + FetchKeyPackages(ctx context.Context, in *FetchKeyPackagesRequest, opts ...grpc.CallOption) (*FetchKeyPackagesResponse, error) + // Would delete all key packages associated with the installation and mark + // the installation as having been revoked + RevokeInstallation(ctx context.Context, in *RevokeInstallationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // 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. + GetIdentityUpdates(ctx context.Context, in *GetIdentityUpdatesRequest, opts ...grpc.CallOption) (*GetIdentityUpdatesResponse, error) + // Query stored group messages + QueryGroupMessages(ctx context.Context, in *QueryGroupMessagesRequest, opts ...grpc.CallOption) (*QueryGroupMessagesResponse, error) + // Query stored group messages + QueryWelcomeMessages(ctx context.Context, in *QueryWelcomeMessagesRequest, opts ...grpc.CallOption) (*QueryWelcomeMessagesResponse, error) + // Subscribe stream of new group messages + SubscribeGroupMessages(ctx context.Context, in *SubscribeGroupMessagesRequest, opts ...grpc.CallOption) (MlsApi_SubscribeGroupMessagesClient, error) + // Subscribe stream of new welcome messages + SubscribeWelcomeMessages(ctx context.Context, in *SubscribeWelcomeMessagesRequest, opts ...grpc.CallOption) (MlsApi_SubscribeWelcomeMessagesClient, error) +} + +type mlsApiClient struct { + cc grpc.ClientConnInterface +} + +func NewMlsApiClient(cc grpc.ClientConnInterface) MlsApiClient { + return &mlsApiClient{cc} +} + +func (c *mlsApiClient) SendGroupMessages(ctx context.Context, in *SendGroupMessagesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MlsApi_SendGroupMessages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) SendWelcomeMessages(ctx context.Context, in *SendWelcomeMessagesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MlsApi_SendWelcomeMessages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) RegisterInstallation(ctx context.Context, in *RegisterInstallationRequest, opts ...grpc.CallOption) (*RegisterInstallationResponse, error) { + out := new(RegisterInstallationResponse) + err := c.cc.Invoke(ctx, MlsApi_RegisterInstallation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) UploadKeyPackage(ctx context.Context, in *UploadKeyPackageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MlsApi_UploadKeyPackage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) FetchKeyPackages(ctx context.Context, in *FetchKeyPackagesRequest, opts ...grpc.CallOption) (*FetchKeyPackagesResponse, error) { + out := new(FetchKeyPackagesResponse) + err := c.cc.Invoke(ctx, MlsApi_FetchKeyPackages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) RevokeInstallation(ctx context.Context, in *RevokeInstallationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MlsApi_RevokeInstallation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) GetIdentityUpdates(ctx context.Context, in *GetIdentityUpdatesRequest, opts ...grpc.CallOption) (*GetIdentityUpdatesResponse, error) { + out := new(GetIdentityUpdatesResponse) + err := c.cc.Invoke(ctx, MlsApi_GetIdentityUpdates_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) QueryGroupMessages(ctx context.Context, in *QueryGroupMessagesRequest, opts ...grpc.CallOption) (*QueryGroupMessagesResponse, error) { + out := new(QueryGroupMessagesResponse) + err := c.cc.Invoke(ctx, MlsApi_QueryGroupMessages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) QueryWelcomeMessages(ctx context.Context, in *QueryWelcomeMessagesRequest, opts ...grpc.CallOption) (*QueryWelcomeMessagesResponse, error) { + out := new(QueryWelcomeMessagesResponse) + err := c.cc.Invoke(ctx, MlsApi_QueryWelcomeMessages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mlsApiClient) SubscribeGroupMessages(ctx context.Context, in *SubscribeGroupMessagesRequest, opts ...grpc.CallOption) (MlsApi_SubscribeGroupMessagesClient, error) { + stream, err := c.cc.NewStream(ctx, &MlsApi_ServiceDesc.Streams[0], MlsApi_SubscribeGroupMessages_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &mlsApiSubscribeGroupMessagesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MlsApi_SubscribeGroupMessagesClient interface { + Recv() (*GroupMessage, error) + grpc.ClientStream +} + +type mlsApiSubscribeGroupMessagesClient struct { + grpc.ClientStream +} + +func (x *mlsApiSubscribeGroupMessagesClient) Recv() (*GroupMessage, error) { + m := new(GroupMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *mlsApiClient) SubscribeWelcomeMessages(ctx context.Context, in *SubscribeWelcomeMessagesRequest, opts ...grpc.CallOption) (MlsApi_SubscribeWelcomeMessagesClient, error) { + stream, err := c.cc.NewStream(ctx, &MlsApi_ServiceDesc.Streams[1], MlsApi_SubscribeWelcomeMessages_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &mlsApiSubscribeWelcomeMessagesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MlsApi_SubscribeWelcomeMessagesClient interface { + Recv() (*WelcomeMessage, error) + grpc.ClientStream +} + +type mlsApiSubscribeWelcomeMessagesClient struct { + grpc.ClientStream +} + +func (x *mlsApiSubscribeWelcomeMessagesClient) Recv() (*WelcomeMessage, error) { + m := new(WelcomeMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// MlsApiServer is the server API for MlsApi service. +// All implementations must embed UnimplementedMlsApiServer +// for forward compatibility +type MlsApiServer interface { + // Send a MLS payload, that would be validated before being stored to the + // network + SendGroupMessages(context.Context, *SendGroupMessagesRequest) (*emptypb.Empty, error) + // Send a batch of welcome messages + SendWelcomeMessages(context.Context, *SendWelcomeMessagesRequest) (*emptypb.Empty, error) + // Register a new installation, which would be validated before storage + RegisterInstallation(context.Context, *RegisterInstallationRequest) (*RegisterInstallationResponse, error) + // Upload a new KeyPackage, which would be validated before storage + UploadKeyPackage(context.Context, *UploadKeyPackageRequest) (*emptypb.Empty, error) + // Get one or more Key Packages by installation_id + FetchKeyPackages(context.Context, *FetchKeyPackagesRequest) (*FetchKeyPackagesResponse, error) + // Would delete all key packages associated with the installation and mark + // the installation as having been revoked + RevokeInstallation(context.Context, *RevokeInstallationRequest) (*emptypb.Empty, error) + // 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. + GetIdentityUpdates(context.Context, *GetIdentityUpdatesRequest) (*GetIdentityUpdatesResponse, error) + // Query stored group messages + QueryGroupMessages(context.Context, *QueryGroupMessagesRequest) (*QueryGroupMessagesResponse, error) + // Query stored group messages + QueryWelcomeMessages(context.Context, *QueryWelcomeMessagesRequest) (*QueryWelcomeMessagesResponse, error) + // Subscribe stream of new group messages + SubscribeGroupMessages(*SubscribeGroupMessagesRequest, MlsApi_SubscribeGroupMessagesServer) error + // Subscribe stream of new welcome messages + SubscribeWelcomeMessages(*SubscribeWelcomeMessagesRequest, MlsApi_SubscribeWelcomeMessagesServer) error + mustEmbedUnimplementedMlsApiServer() +} + +// UnimplementedMlsApiServer must be embedded to have forward compatible implementations. +type UnimplementedMlsApiServer struct { +} + +func (UnimplementedMlsApiServer) SendGroupMessages(context.Context, *SendGroupMessagesRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendGroupMessages not implemented") +} +func (UnimplementedMlsApiServer) SendWelcomeMessages(context.Context, *SendWelcomeMessagesRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendWelcomeMessages not implemented") +} +func (UnimplementedMlsApiServer) RegisterInstallation(context.Context, *RegisterInstallationRequest) (*RegisterInstallationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterInstallation not implemented") +} +func (UnimplementedMlsApiServer) UploadKeyPackage(context.Context, *UploadKeyPackageRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadKeyPackage not implemented") +} +func (UnimplementedMlsApiServer) FetchKeyPackages(context.Context, *FetchKeyPackagesRequest) (*FetchKeyPackagesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FetchKeyPackages not implemented") +} +func (UnimplementedMlsApiServer) RevokeInstallation(context.Context, *RevokeInstallationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method RevokeInstallation not implemented") +} +func (UnimplementedMlsApiServer) GetIdentityUpdates(context.Context, *GetIdentityUpdatesRequest) (*GetIdentityUpdatesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIdentityUpdates not implemented") +} +func (UnimplementedMlsApiServer) QueryGroupMessages(context.Context, *QueryGroupMessagesRequest) (*QueryGroupMessagesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryGroupMessages not implemented") +} +func (UnimplementedMlsApiServer) QueryWelcomeMessages(context.Context, *QueryWelcomeMessagesRequest) (*QueryWelcomeMessagesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryWelcomeMessages not implemented") +} +func (UnimplementedMlsApiServer) SubscribeGroupMessages(*SubscribeGroupMessagesRequest, MlsApi_SubscribeGroupMessagesServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeGroupMessages not implemented") +} +func (UnimplementedMlsApiServer) SubscribeWelcomeMessages(*SubscribeWelcomeMessagesRequest, MlsApi_SubscribeWelcomeMessagesServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeWelcomeMessages not implemented") +} +func (UnimplementedMlsApiServer) mustEmbedUnimplementedMlsApiServer() {} + +// UnsafeMlsApiServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MlsApiServer will +// result in compilation errors. +type UnsafeMlsApiServer interface { + mustEmbedUnimplementedMlsApiServer() +} + +func RegisterMlsApiServer(s grpc.ServiceRegistrar, srv MlsApiServer) { + s.RegisterService(&MlsApi_ServiceDesc, srv) +} + +func _MlsApi_SendGroupMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendGroupMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).SendGroupMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_SendGroupMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).SendGroupMessages(ctx, req.(*SendGroupMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_SendWelcomeMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendWelcomeMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).SendWelcomeMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_SendWelcomeMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).SendWelcomeMessages(ctx, req.(*SendWelcomeMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_RegisterInstallation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterInstallationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).RegisterInstallation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_RegisterInstallation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).RegisterInstallation(ctx, req.(*RegisterInstallationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_UploadKeyPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadKeyPackageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).UploadKeyPackage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_UploadKeyPackage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).UploadKeyPackage(ctx, req.(*UploadKeyPackageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_FetchKeyPackages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FetchKeyPackagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).FetchKeyPackages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_FetchKeyPackages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).FetchKeyPackages(ctx, req.(*FetchKeyPackagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_RevokeInstallation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RevokeInstallationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).RevokeInstallation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_RevokeInstallation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).RevokeInstallation(ctx, req.(*RevokeInstallationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_GetIdentityUpdates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIdentityUpdatesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).GetIdentityUpdates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_GetIdentityUpdates_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).GetIdentityUpdates(ctx, req.(*GetIdentityUpdatesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_QueryGroupMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGroupMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).QueryGroupMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_QueryGroupMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).QueryGroupMessages(ctx, req.(*QueryGroupMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_QueryWelcomeMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryWelcomeMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MlsApiServer).QueryWelcomeMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MlsApi_QueryWelcomeMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MlsApiServer).QueryWelcomeMessages(ctx, req.(*QueryWelcomeMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MlsApi_SubscribeGroupMessages_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeGroupMessagesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MlsApiServer).SubscribeGroupMessages(m, &mlsApiSubscribeGroupMessagesServer{stream}) +} + +type MlsApi_SubscribeGroupMessagesServer interface { + Send(*GroupMessage) error + grpc.ServerStream +} + +type mlsApiSubscribeGroupMessagesServer struct { + grpc.ServerStream +} + +func (x *mlsApiSubscribeGroupMessagesServer) Send(m *GroupMessage) error { + return x.ServerStream.SendMsg(m) +} + +func _MlsApi_SubscribeWelcomeMessages_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeWelcomeMessagesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MlsApiServer).SubscribeWelcomeMessages(m, &mlsApiSubscribeWelcomeMessagesServer{stream}) +} + +type MlsApi_SubscribeWelcomeMessagesServer interface { + Send(*WelcomeMessage) error + grpc.ServerStream +} + +type mlsApiSubscribeWelcomeMessagesServer struct { + grpc.ServerStream +} + +func (x *mlsApiSubscribeWelcomeMessagesServer) Send(m *WelcomeMessage) error { + return x.ServerStream.SendMsg(m) +} + +// MlsApi_ServiceDesc is the grpc.ServiceDesc for MlsApi service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MlsApi_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "xmtp.mls.api.v1.MlsApi", + HandlerType: (*MlsApiServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SendGroupMessages", + Handler: _MlsApi_SendGroupMessages_Handler, + }, + { + MethodName: "SendWelcomeMessages", + Handler: _MlsApi_SendWelcomeMessages_Handler, + }, + { + MethodName: "RegisterInstallation", + Handler: _MlsApi_RegisterInstallation_Handler, + }, + { + MethodName: "UploadKeyPackage", + Handler: _MlsApi_UploadKeyPackage_Handler, + }, + { + MethodName: "FetchKeyPackages", + Handler: _MlsApi_FetchKeyPackages_Handler, + }, + { + MethodName: "RevokeInstallation", + Handler: _MlsApi_RevokeInstallation_Handler, + }, + { + MethodName: "GetIdentityUpdates", + Handler: _MlsApi_GetIdentityUpdates_Handler, + }, + { + MethodName: "QueryGroupMessages", + Handler: _MlsApi_QueryGroupMessages_Handler, + }, + { + MethodName: "QueryWelcomeMessages", + Handler: _MlsApi_QueryWelcomeMessages_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeGroupMessages", + Handler: _MlsApi_SubscribeGroupMessages_Handler, + ServerStreams: true, + }, + { + StreamName: "SubscribeWelcomeMessages", + Handler: _MlsApi_SubscribeWelcomeMessages_Handler, + ServerStreams: true, + }, + }, + Metadata: "mls/api/v1/mls.proto", +} diff --git a/pkg/proto/mls/database/intents.pb.go b/pkg/proto/mls/database/intents.pb.go new file mode 100644 index 00000000..420ecd00 --- /dev/null +++ b/pkg/proto/mls/database/intents.pb.go @@ -0,0 +1,983 @@ +// V3 invite message structure + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/database/intents.proto + +package database + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The data required to publish a message +type SendMessageData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *SendMessageData_V1_ + Version isSendMessageData_Version `protobuf_oneof:"version"` +} + +func (x *SendMessageData) Reset() { + *x = SendMessageData{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendMessageData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendMessageData) ProtoMessage() {} + +func (x *SendMessageData) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendMessageData.ProtoReflect.Descriptor instead. +func (*SendMessageData) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{0} +} + +func (m *SendMessageData) GetVersion() isSendMessageData_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *SendMessageData) GetV1() *SendMessageData_V1 { + if x, ok := x.GetVersion().(*SendMessageData_V1_); ok { + return x.V1 + } + return nil +} + +type isSendMessageData_Version interface { + isSendMessageData_Version() +} + +type SendMessageData_V1_ struct { + V1 *SendMessageData_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*SendMessageData_V1_) isSendMessageData_Version() {} + +// Wrapper around a list af repeated EVM Account Addresses +type AccountAddresses struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountAddresses []string `protobuf:"bytes,1,rep,name=account_addresses,json=accountAddresses,proto3" json:"account_addresses,omitempty"` +} + +func (x *AccountAddresses) Reset() { + *x = AccountAddresses{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountAddresses) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountAddresses) ProtoMessage() {} + +func (x *AccountAddresses) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountAddresses.ProtoReflect.Descriptor instead. +func (*AccountAddresses) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountAddresses) GetAccountAddresses() []string { + if x != nil { + return x.AccountAddresses + } + return nil +} + +// Wrapper around a list of repeated Installation IDs +type InstallationIds struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationIds [][]byte `protobuf:"bytes,1,rep,name=installation_ids,json=installationIds,proto3" json:"installation_ids,omitempty"` +} + +func (x *InstallationIds) Reset() { + *x = InstallationIds{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallationIds) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallationIds) ProtoMessage() {} + +func (x *InstallationIds) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallationIds.ProtoReflect.Descriptor instead. +func (*InstallationIds) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{2} +} + +func (x *InstallationIds) GetInstallationIds() [][]byte { + if x != nil { + return x.InstallationIds + } + return nil +} + +// One of an EVM account address or Installation ID +type AddressesOrInstallationIds struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to AddressesOrInstallationIds: + // + // *AddressesOrInstallationIds_AccountAddresses + // *AddressesOrInstallationIds_InstallationIds + AddressesOrInstallationIds isAddressesOrInstallationIds_AddressesOrInstallationIds `protobuf_oneof:"addresses_or_installation_ids"` +} + +func (x *AddressesOrInstallationIds) Reset() { + *x = AddressesOrInstallationIds{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddressesOrInstallationIds) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddressesOrInstallationIds) ProtoMessage() {} + +func (x *AddressesOrInstallationIds) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddressesOrInstallationIds.ProtoReflect.Descriptor instead. +func (*AddressesOrInstallationIds) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{3} +} + +func (m *AddressesOrInstallationIds) GetAddressesOrInstallationIds() isAddressesOrInstallationIds_AddressesOrInstallationIds { + if m != nil { + return m.AddressesOrInstallationIds + } + return nil +} + +func (x *AddressesOrInstallationIds) GetAccountAddresses() *AccountAddresses { + if x, ok := x.GetAddressesOrInstallationIds().(*AddressesOrInstallationIds_AccountAddresses); ok { + return x.AccountAddresses + } + return nil +} + +func (x *AddressesOrInstallationIds) GetInstallationIds() *InstallationIds { + if x, ok := x.GetAddressesOrInstallationIds().(*AddressesOrInstallationIds_InstallationIds); ok { + return x.InstallationIds + } + return nil +} + +type isAddressesOrInstallationIds_AddressesOrInstallationIds interface { + isAddressesOrInstallationIds_AddressesOrInstallationIds() +} + +type AddressesOrInstallationIds_AccountAddresses struct { + AccountAddresses *AccountAddresses `protobuf:"bytes,1,opt,name=account_addresses,json=accountAddresses,proto3,oneof"` +} + +type AddressesOrInstallationIds_InstallationIds struct { + InstallationIds *InstallationIds `protobuf:"bytes,2,opt,name=installation_ids,json=installationIds,proto3,oneof"` +} + +func (*AddressesOrInstallationIds_AccountAddresses) isAddressesOrInstallationIds_AddressesOrInstallationIds() { +} + +func (*AddressesOrInstallationIds_InstallationIds) isAddressesOrInstallationIds_AddressesOrInstallationIds() { +} + +// The data required to add members to a group +type AddMembersData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *AddMembersData_V1_ + Version isAddMembersData_Version `protobuf_oneof:"version"` +} + +func (x *AddMembersData) Reset() { + *x = AddMembersData{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddMembersData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddMembersData) ProtoMessage() {} + +func (x *AddMembersData) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddMembersData.ProtoReflect.Descriptor instead. +func (*AddMembersData) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{4} +} + +func (m *AddMembersData) GetVersion() isAddMembersData_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *AddMembersData) GetV1() *AddMembersData_V1 { + if x, ok := x.GetVersion().(*AddMembersData_V1_); ok { + return x.V1 + } + return nil +} + +type isAddMembersData_Version interface { + isAddMembersData_Version() +} + +type AddMembersData_V1_ struct { + V1 *AddMembersData_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*AddMembersData_V1_) isAddMembersData_Version() {} + +// The data required to remove members from a group +type RemoveMembersData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Version: + // + // *RemoveMembersData_V1_ + Version isRemoveMembersData_Version `protobuf_oneof:"version"` +} + +func (x *RemoveMembersData) Reset() { + *x = RemoveMembersData{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveMembersData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveMembersData) ProtoMessage() {} + +func (x *RemoveMembersData) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveMembersData.ProtoReflect.Descriptor instead. +func (*RemoveMembersData) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{5} +} + +func (m *RemoveMembersData) GetVersion() isRemoveMembersData_Version { + if m != nil { + return m.Version + } + return nil +} + +func (x *RemoveMembersData) GetV1() *RemoveMembersData_V1 { + if x, ok := x.GetVersion().(*RemoveMembersData_V1_); ok { + return x.V1 + } + return nil +} + +type isRemoveMembersData_Version interface { + isRemoveMembersData_Version() +} + +type RemoveMembersData_V1_ struct { + V1 *RemoveMembersData_V1 `protobuf:"bytes,1,opt,name=v1,proto3,oneof"` +} + +func (*RemoveMembersData_V1_) isRemoveMembersData_Version() {} + +// Generic data-type for all post-commit actions +type PostCommitAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *PostCommitAction_SendWelcomes_ + Kind isPostCommitAction_Kind `protobuf_oneof:"kind"` +} + +func (x *PostCommitAction) Reset() { + *x = PostCommitAction{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostCommitAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCommitAction) ProtoMessage() {} + +func (x *PostCommitAction) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostCommitAction.ProtoReflect.Descriptor instead. +func (*PostCommitAction) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{6} +} + +func (m *PostCommitAction) GetKind() isPostCommitAction_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *PostCommitAction) GetSendWelcomes() *PostCommitAction_SendWelcomes { + if x, ok := x.GetKind().(*PostCommitAction_SendWelcomes_); ok { + return x.SendWelcomes + } + return nil +} + +type isPostCommitAction_Kind interface { + isPostCommitAction_Kind() +} + +type PostCommitAction_SendWelcomes_ struct { + SendWelcomes *PostCommitAction_SendWelcomes `protobuf:"bytes,1,opt,name=send_welcomes,json=sendWelcomes,proto3,oneof"` +} + +func (*PostCommitAction_SendWelcomes_) isPostCommitAction_Kind() {} + +// V1 of SendMessagePublishData +type SendMessageData_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PayloadBytes []byte `protobuf:"bytes,1,opt,name=payload_bytes,json=payloadBytes,proto3" json:"payload_bytes,omitempty"` +} + +func (x *SendMessageData_V1) Reset() { + *x = SendMessageData_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendMessageData_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendMessageData_V1) ProtoMessage() {} + +func (x *SendMessageData_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendMessageData_V1.ProtoReflect.Descriptor instead. +func (*SendMessageData_V1) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *SendMessageData_V1) GetPayloadBytes() []byte { + if x != nil { + return x.PayloadBytes + } + return nil +} + +// V1 of AddMembersPublishData +type AddMembersData_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AddressesOrInstallationIds *AddressesOrInstallationIds `protobuf:"bytes,1,opt,name=addresses_or_installation_ids,json=addressesOrInstallationIds,proto3" json:"addresses_or_installation_ids,omitempty"` +} + +func (x *AddMembersData_V1) Reset() { + *x = AddMembersData_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddMembersData_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddMembersData_V1) ProtoMessage() {} + +func (x *AddMembersData_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddMembersData_V1.ProtoReflect.Descriptor instead. +func (*AddMembersData_V1) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *AddMembersData_V1) GetAddressesOrInstallationIds() *AddressesOrInstallationIds { + if x != nil { + return x.AddressesOrInstallationIds + } + return nil +} + +// V1 of RemoveMembersPublishData +type RemoveMembersData_V1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AddressesOrInstallationIds *AddressesOrInstallationIds `protobuf:"bytes,1,opt,name=addresses_or_installation_ids,json=addressesOrInstallationIds,proto3" json:"addresses_or_installation_ids,omitempty"` +} + +func (x *RemoveMembersData_V1) Reset() { + *x = RemoveMembersData_V1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveMembersData_V1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveMembersData_V1) ProtoMessage() {} + +func (x *RemoveMembersData_V1) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveMembersData_V1.ProtoReflect.Descriptor instead. +func (*RemoveMembersData_V1) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *RemoveMembersData_V1) GetAddressesOrInstallationIds() *AddressesOrInstallationIds { + if x != nil { + return x.AddressesOrInstallationIds + } + return nil +} + +// SendWelcome message +type PostCommitAction_SendWelcomes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationIds [][]byte `protobuf:"bytes,1,rep,name=installation_ids,json=installationIds,proto3" json:"installation_ids,omitempty"` + WelcomeMessage []byte `protobuf:"bytes,2,opt,name=welcome_message,json=welcomeMessage,proto3" json:"welcome_message,omitempty"` +} + +func (x *PostCommitAction_SendWelcomes) Reset() { + *x = PostCommitAction_SendWelcomes{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostCommitAction_SendWelcomes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCommitAction_SendWelcomes) ProtoMessage() {} + +func (x *PostCommitAction_SendWelcomes) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostCommitAction_SendWelcomes.ProtoReflect.Descriptor instead. +func (*PostCommitAction_SendWelcomes) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *PostCommitAction_SendWelcomes) GetInstallationIds() [][]byte { + if x != nil { + return x.InstallationIds + } + return nil +} + +func (x *PostCommitAction_SendWelcomes) GetWelcomeMessage() []byte { + if x != nil { + return x.WelcomeMessage + } + return nil +} + +var File_mls_database_intents_proto protoreflect.FileDescriptor + +var file_mls_database_intents_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x6d, 0x6c, 0x73, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, + 0x80, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x37, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x29, 0x0a, 0x02, + 0x56, 0x31, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x3f, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x10, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x73, 0x22, 0x3c, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x73, 0x22, 0xe2, 0x01, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4f, + 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, + 0x12, 0x52, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x48, 0x00, 0x52, 0x10, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x73, 0x48, 0x00, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x42, 0x1f, 0x0a, 0x1d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x5f, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x02, 0x76, 0x31, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, + 0x31, 0x1a, 0x76, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x70, 0x0a, 0x1d, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x5f, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4f, 0x72, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x52, 0x1a, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4f, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd1, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x02, 0x76, 0x31, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x31, 0x48, + 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x76, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x70, 0x0a, 0x1d, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x5f, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x4f, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x73, 0x52, 0x1a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4f, 0x72, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x42, 0x09, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd7, 0x01, 0x0a, 0x10, 0x50, 0x6f, 0x73, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, + 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, + 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x57, 0x65, + 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x1a, 0x62, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, + 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x77, 0x65, 0x6c, 0x63, + 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x42, 0xc0, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x42, 0x0c, 0x49, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, + 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x44, 0xaa, 0x02, 0x11, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, + 0x6c, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0xca, 0x02, 0x11, 0x58, 0x6d, + 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0xe2, + 0x02, 0x1d, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x44, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x44, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_database_intents_proto_rawDescOnce sync.Once + file_mls_database_intents_proto_rawDescData = file_mls_database_intents_proto_rawDesc +) + +func file_mls_database_intents_proto_rawDescGZIP() []byte { + file_mls_database_intents_proto_rawDescOnce.Do(func() { + file_mls_database_intents_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_database_intents_proto_rawDescData) + }) + return file_mls_database_intents_proto_rawDescData +} + +var file_mls_database_intents_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_mls_database_intents_proto_goTypes = []interface{}{ + (*SendMessageData)(nil), // 0: xmtp.mls.database.SendMessageData + (*AccountAddresses)(nil), // 1: xmtp.mls.database.AccountAddresses + (*InstallationIds)(nil), // 2: xmtp.mls.database.InstallationIds + (*AddressesOrInstallationIds)(nil), // 3: xmtp.mls.database.AddressesOrInstallationIds + (*AddMembersData)(nil), // 4: xmtp.mls.database.AddMembersData + (*RemoveMembersData)(nil), // 5: xmtp.mls.database.RemoveMembersData + (*PostCommitAction)(nil), // 6: xmtp.mls.database.PostCommitAction + (*SendMessageData_V1)(nil), // 7: xmtp.mls.database.SendMessageData.V1 + (*AddMembersData_V1)(nil), // 8: xmtp.mls.database.AddMembersData.V1 + (*RemoveMembersData_V1)(nil), // 9: xmtp.mls.database.RemoveMembersData.V1 + (*PostCommitAction_SendWelcomes)(nil), // 10: xmtp.mls.database.PostCommitAction.SendWelcomes +} +var file_mls_database_intents_proto_depIdxs = []int32{ + 7, // 0: xmtp.mls.database.SendMessageData.v1:type_name -> xmtp.mls.database.SendMessageData.V1 + 1, // 1: xmtp.mls.database.AddressesOrInstallationIds.account_addresses:type_name -> xmtp.mls.database.AccountAddresses + 2, // 2: xmtp.mls.database.AddressesOrInstallationIds.installation_ids:type_name -> xmtp.mls.database.InstallationIds + 8, // 3: xmtp.mls.database.AddMembersData.v1:type_name -> xmtp.mls.database.AddMembersData.V1 + 9, // 4: xmtp.mls.database.RemoveMembersData.v1:type_name -> xmtp.mls.database.RemoveMembersData.V1 + 10, // 5: xmtp.mls.database.PostCommitAction.send_welcomes:type_name -> xmtp.mls.database.PostCommitAction.SendWelcomes + 3, // 6: xmtp.mls.database.AddMembersData.V1.addresses_or_installation_ids:type_name -> xmtp.mls.database.AddressesOrInstallationIds + 3, // 7: xmtp.mls.database.RemoveMembersData.V1.addresses_or_installation_ids:type_name -> xmtp.mls.database.AddressesOrInstallationIds + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_mls_database_intents_proto_init() } +func file_mls_database_intents_proto_init() { + if File_mls_database_intents_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_database_intents_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendMessageData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountAddresses); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallationIds); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddressesOrInstallationIds); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddMembersData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveMembersData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostCommitAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendMessageData_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddMembersData_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveMembersData_V1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostCommitAction_SendWelcomes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mls_database_intents_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*SendMessageData_V1_)(nil), + } + file_mls_database_intents_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*AddressesOrInstallationIds_AccountAddresses)(nil), + (*AddressesOrInstallationIds_InstallationIds)(nil), + } + file_mls_database_intents_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*AddMembersData_V1_)(nil), + } + file_mls_database_intents_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*RemoveMembersData_V1_)(nil), + } + file_mls_database_intents_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*PostCommitAction_SendWelcomes_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_database_intents_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mls_database_intents_proto_goTypes, + DependencyIndexes: file_mls_database_intents_proto_depIdxs, + MessageInfos: file_mls_database_intents_proto_msgTypes, + }.Build() + File_mls_database_intents_proto = out.File + file_mls_database_intents_proto_rawDesc = nil + file_mls_database_intents_proto_goTypes = nil + file_mls_database_intents_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/message_contents/association.pb.go b/pkg/proto/mls/message_contents/association.pb.go new file mode 100644 index 00000000..011dab4f --- /dev/null +++ b/pkg/proto/mls/message_contents/association.pb.go @@ -0,0 +1,389 @@ +// Associations and signatures + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/message_contents/association.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Allows for us to update the format of the association text without +// incrementing the entire proto +type AssociationTextVersion int32 + +const ( + AssociationTextVersion_ASSOCIATION_TEXT_VERSION_UNSPECIFIED AssociationTextVersion = 0 + AssociationTextVersion_ASSOCIATION_TEXT_VERSION_1 AssociationTextVersion = 1 +) + +// Enum value maps for AssociationTextVersion. +var ( + AssociationTextVersion_name = map[int32]string{ + 0: "ASSOCIATION_TEXT_VERSION_UNSPECIFIED", + 1: "ASSOCIATION_TEXT_VERSION_1", + } + AssociationTextVersion_value = map[string]int32{ + "ASSOCIATION_TEXT_VERSION_UNSPECIFIED": 0, + "ASSOCIATION_TEXT_VERSION_1": 1, + } +) + +func (x AssociationTextVersion) Enum() *AssociationTextVersion { + p := new(AssociationTextVersion) + *p = x + return p +} + +func (x AssociationTextVersion) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AssociationTextVersion) Descriptor() protoreflect.EnumDescriptor { + return file_mls_message_contents_association_proto_enumTypes[0].Descriptor() +} + +func (AssociationTextVersion) Type() protoreflect.EnumType { + return &file_mls_message_contents_association_proto_enumTypes[0] +} + +func (x AssociationTextVersion) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AssociationTextVersion.Descriptor instead. +func (AssociationTextVersion) EnumDescriptor() ([]byte, []int) { + return file_mls_message_contents_association_proto_rawDescGZIP(), []int{0} +} + +// EIP191Association is used for all EIP 191 compliant wallet signatures +type Eip191Association struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AssociationTextVersion AssociationTextVersion `protobuf:"varint,1,opt,name=association_text_version,json=associationTextVersion,proto3,enum=xmtp.mls.message_contents.AssociationTextVersion" json:"association_text_version,omitempty"` + Signature *RecoverableEcdsaSignature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + AccountAddress string `protobuf:"bytes,3,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + Iso8601Time string `protobuf:"bytes,4,opt,name=iso8601_time,json=iso8601Time,proto3" json:"iso8601_time,omitempty"` +} + +func (x *Eip191Association) Reset() { + *x = Eip191Association{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_association_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Eip191Association) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Eip191Association) ProtoMessage() {} + +func (x *Eip191Association) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_association_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Eip191Association.ProtoReflect.Descriptor instead. +func (*Eip191Association) Descriptor() ([]byte, []int) { + return file_mls_message_contents_association_proto_rawDescGZIP(), []int{0} +} + +func (x *Eip191Association) GetAssociationTextVersion() AssociationTextVersion { + if x != nil { + return x.AssociationTextVersion + } + return AssociationTextVersion_ASSOCIATION_TEXT_VERSION_UNSPECIFIED +} + +func (x *Eip191Association) GetSignature() *RecoverableEcdsaSignature { + if x != nil { + return x.Signature + } + return nil +} + +func (x *Eip191Association) GetAccountAddress() string { + if x != nil { + return x.AccountAddress + } + return "" +} + +func (x *Eip191Association) GetIso8601Time() string { + if x != nil { + return x.Iso8601Time + } + return "" +} + +// RecoverableEcdsaSignature +type RecoverableEcdsaSignature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Includes recovery id as the last byte + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (x *RecoverableEcdsaSignature) Reset() { + *x = RecoverableEcdsaSignature{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_association_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RecoverableEcdsaSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecoverableEcdsaSignature) ProtoMessage() {} + +func (x *RecoverableEcdsaSignature) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_association_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecoverableEcdsaSignature.ProtoReflect.Descriptor instead. +func (*RecoverableEcdsaSignature) Descriptor() ([]byte, []int) { + return file_mls_message_contents_association_proto_rawDescGZIP(), []int{1} +} + +func (x *RecoverableEcdsaSignature) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +// EdDSA signature bytes matching RFC 8032 +type EdDsaSignature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (x *EdDsaSignature) Reset() { + *x = EdDsaSignature{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_association_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EdDsaSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EdDsaSignature) ProtoMessage() {} + +func (x *EdDsaSignature) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_association_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EdDsaSignature.ProtoReflect.Descriptor instead. +func (*EdDsaSignature) Descriptor() ([]byte, []int) { + return file_mls_message_contents_association_proto_rawDescGZIP(), []int{2} +} + +func (x *EdDsaSignature) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +var File_mls_message_contents_association_proto protoreflect.FileDescriptor + +var file_mls_message_contents_association_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0xa0, 0x02, 0x0a, 0x11, 0x45, 0x69, 0x70, 0x31, 0x39, 0x31, 0x41, 0x73, + 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6b, 0x0a, 0x18, 0x61, 0x73, 0x73, + 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x16, + 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x62, 0x6c, + 0x65, 0x45, 0x63, 0x64, 0x73, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x6f, 0x38, 0x36, 0x30, 0x31, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x73, 0x6f, 0x38, 0x36, + 0x30, 0x31, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x19, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x63, 0x64, 0x73, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x0e, 0x45, 0x64, 0x44, + 0x73, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x2a, 0x62, 0x0a, 0x16, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x65, 0x78, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x41, + 0x53, 0x53, 0x4f, 0x43, 0x49, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x5f, + 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x53, 0x53, 0x4f, 0x43, 0x49, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, + 0x4e, 0x5f, 0x31, 0x10, 0x01, 0x42, 0xf0, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x10, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, + 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x4d, 0xaa, 0x02, + 0x18, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, + 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x24, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x58, 0x6d, + 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_message_contents_association_proto_rawDescOnce sync.Once + file_mls_message_contents_association_proto_rawDescData = file_mls_message_contents_association_proto_rawDesc +) + +func file_mls_message_contents_association_proto_rawDescGZIP() []byte { + file_mls_message_contents_association_proto_rawDescOnce.Do(func() { + file_mls_message_contents_association_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_message_contents_association_proto_rawDescData) + }) + return file_mls_message_contents_association_proto_rawDescData +} + +var file_mls_message_contents_association_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_mls_message_contents_association_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_mls_message_contents_association_proto_goTypes = []interface{}{ + (AssociationTextVersion)(0), // 0: xmtp.mls.message_contents.AssociationTextVersion + (*Eip191Association)(nil), // 1: xmtp.mls.message_contents.Eip191Association + (*RecoverableEcdsaSignature)(nil), // 2: xmtp.mls.message_contents.RecoverableEcdsaSignature + (*EdDsaSignature)(nil), // 3: xmtp.mls.message_contents.EdDsaSignature +} +var file_mls_message_contents_association_proto_depIdxs = []int32{ + 0, // 0: xmtp.mls.message_contents.Eip191Association.association_text_version:type_name -> xmtp.mls.message_contents.AssociationTextVersion + 2, // 1: xmtp.mls.message_contents.Eip191Association.signature:type_name -> xmtp.mls.message_contents.RecoverableEcdsaSignature + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_mls_message_contents_association_proto_init() } +func file_mls_message_contents_association_proto_init() { + if File_mls_message_contents_association_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_message_contents_association_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Eip191Association); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_association_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RecoverableEcdsaSignature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_association_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EdDsaSignature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_message_contents_association_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mls_message_contents_association_proto_goTypes, + DependencyIndexes: file_mls_message_contents_association_proto_depIdxs, + EnumInfos: file_mls_message_contents_association_proto_enumTypes, + MessageInfos: file_mls_message_contents_association_proto_msgTypes, + }.Build() + File_mls_message_contents_association_proto = out.File + file_mls_message_contents_association_proto_rawDesc = nil + file_mls_message_contents_association_proto_goTypes = nil + file_mls_message_contents_association_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/message_contents/content.pb.go b/pkg/proto/mls/message_contents/content.pb.go new file mode 100644 index 00000000..ee31ca09 --- /dev/null +++ b/pkg/proto/mls/message_contents/content.pb.go @@ -0,0 +1,380 @@ +// Message content encoding structures +// Copied from V2 code so that we can eventually retire all V2 message content + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/message_contents/content.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Recognized compression algorithms +// protolint:disable ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH +type Compression int32 + +const ( + Compression_COMPRESSION_DEFLATE Compression = 0 + Compression_COMPRESSION_GZIP Compression = 1 +) + +// Enum value maps for Compression. +var ( + Compression_name = map[int32]string{ + 0: "COMPRESSION_DEFLATE", + 1: "COMPRESSION_GZIP", + } + Compression_value = map[string]int32{ + "COMPRESSION_DEFLATE": 0, + "COMPRESSION_GZIP": 1, + } +) + +func (x Compression) Enum() *Compression { + p := new(Compression) + *p = x + return p +} + +func (x Compression) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Compression) Descriptor() protoreflect.EnumDescriptor { + return file_mls_message_contents_content_proto_enumTypes[0].Descriptor() +} + +func (Compression) Type() protoreflect.EnumType { + return &file_mls_message_contents_content_proto_enumTypes[0] +} + +func (x Compression) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Compression.Descriptor instead. +func (Compression) EnumDescriptor() ([]byte, []int) { + return file_mls_message_contents_content_proto_rawDescGZIP(), []int{0} +} + +// ContentTypeId is used to identify the type of content stored in a Message. +type ContentTypeId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuthorityId string `protobuf:"bytes,1,opt,name=authority_id,json=authorityId,proto3" json:"authority_id,omitempty"` // authority governing this content type + TypeId string `protobuf:"bytes,2,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` // type identifier + VersionMajor uint32 `protobuf:"varint,3,opt,name=version_major,json=versionMajor,proto3" json:"version_major,omitempty"` // major version of the type + VersionMinor uint32 `protobuf:"varint,4,opt,name=version_minor,json=versionMinor,proto3" json:"version_minor,omitempty"` // minor version of the type +} + +func (x *ContentTypeId) Reset() { + *x = ContentTypeId{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_content_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContentTypeId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContentTypeId) ProtoMessage() {} + +func (x *ContentTypeId) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_content_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContentTypeId.ProtoReflect.Descriptor instead. +func (*ContentTypeId) Descriptor() ([]byte, []int) { + return file_mls_message_contents_content_proto_rawDescGZIP(), []int{0} +} + +func (x *ContentTypeId) GetAuthorityId() string { + if x != nil { + return x.AuthorityId + } + return "" +} + +func (x *ContentTypeId) GetTypeId() string { + if x != nil { + return x.TypeId + } + return "" +} + +func (x *ContentTypeId) GetVersionMajor() uint32 { + if x != nil { + return x.VersionMajor + } + return 0 +} + +func (x *ContentTypeId) GetVersionMinor() uint32 { + if x != nil { + return x.VersionMinor + } + return 0 +} + +// EncodedContent bundles the content with metadata identifying its type +// and parameters required for correct decoding and presentation of the content. +type EncodedContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // content type identifier used to match the payload with + // the correct decoding machinery + Type *ContentTypeId `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // optional encoding parameters required to correctly decode the content + Parameters map[string]string `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // optional fallback description of the content that can be used in case + // the client cannot decode or render the content + Fallback *string `protobuf:"bytes,3,opt,name=fallback,proto3,oneof" json:"fallback,omitempty"` + // optional compression; the value indicates algorithm used to + // compress the encoded content bytes + Compression *Compression `protobuf:"varint,5,opt,name=compression,proto3,enum=xmtp.mls.message_contents.Compression,oneof" json:"compression,omitempty"` + // encoded content itself + Content []byte `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *EncodedContent) Reset() { + *x = EncodedContent{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_content_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncodedContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EncodedContent) ProtoMessage() {} + +func (x *EncodedContent) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_content_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EncodedContent.ProtoReflect.Descriptor instead. +func (*EncodedContent) Descriptor() ([]byte, []int) { + return file_mls_message_contents_content_proto_rawDescGZIP(), []int{1} +} + +func (x *EncodedContent) GetType() *ContentTypeId { + if x != nil { + return x.Type + } + return nil +} + +func (x *EncodedContent) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *EncodedContent) GetFallback() string { + if x != nil && x.Fallback != nil { + return *x.Fallback + } + return "" +} + +func (x *EncodedContent) GetCompression() Compression { + if x != nil && x.Compression != nil { + return *x.Compression + } + return Compression_COMPRESSION_DEFLATE +} + +func (x *EncodedContent) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +var File_mls_message_contents_content_proto protoreflect.FileDescriptor + +var file_mls_message_contents_content_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x95, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, + 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6a, + 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, + 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x8f, 0x03, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x49, 0x64, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, + 0x6b, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x48, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x3d, 0x0a, + 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0b, 0x0a, 0x09, + 0x5f, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0x3c, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x50, + 0x52, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x46, 0x4c, 0x41, 0x54, 0x45, 0x10, + 0x00, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x47, 0x5a, 0x49, 0x50, 0x10, 0x01, 0x42, 0xec, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, + 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x4d, 0xaa, 0x02, 0x18, 0x58, + 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, + 0x6c, 0x73, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0xe2, 0x02, 0x24, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x58, 0x6d, 0x74, 0x70, + 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_message_contents_content_proto_rawDescOnce sync.Once + file_mls_message_contents_content_proto_rawDescData = file_mls_message_contents_content_proto_rawDesc +) + +func file_mls_message_contents_content_proto_rawDescGZIP() []byte { + file_mls_message_contents_content_proto_rawDescOnce.Do(func() { + file_mls_message_contents_content_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_message_contents_content_proto_rawDescData) + }) + return file_mls_message_contents_content_proto_rawDescData +} + +var file_mls_message_contents_content_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_mls_message_contents_content_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_mls_message_contents_content_proto_goTypes = []interface{}{ + (Compression)(0), // 0: xmtp.mls.message_contents.Compression + (*ContentTypeId)(nil), // 1: xmtp.mls.message_contents.ContentTypeId + (*EncodedContent)(nil), // 2: xmtp.mls.message_contents.EncodedContent + nil, // 3: xmtp.mls.message_contents.EncodedContent.ParametersEntry +} +var file_mls_message_contents_content_proto_depIdxs = []int32{ + 1, // 0: xmtp.mls.message_contents.EncodedContent.type:type_name -> xmtp.mls.message_contents.ContentTypeId + 3, // 1: xmtp.mls.message_contents.EncodedContent.parameters:type_name -> xmtp.mls.message_contents.EncodedContent.ParametersEntry + 0, // 2: xmtp.mls.message_contents.EncodedContent.compression:type_name -> xmtp.mls.message_contents.Compression + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_mls_message_contents_content_proto_init() } +func file_mls_message_contents_content_proto_init() { + if File_mls_message_contents_content_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_message_contents_content_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContentTypeId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_content_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncodedContent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mls_message_contents_content_proto_msgTypes[1].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_message_contents_content_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mls_message_contents_content_proto_goTypes, + DependencyIndexes: file_mls_message_contents_content_proto_depIdxs, + EnumInfos: file_mls_message_contents_content_proto_enumTypes, + MessageInfos: file_mls_message_contents_content_proto_msgTypes, + }.Build() + File_mls_message_contents_content_proto = out.File + file_mls_message_contents_content_proto_rawDesc = nil + file_mls_message_contents_content_proto_goTypes = nil + file_mls_message_contents_content_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/message_contents/credential.pb.go b/pkg/proto/mls/message_contents/credential.pb.go new file mode 100644 index 00000000..937216df --- /dev/null +++ b/pkg/proto/mls/message_contents/credential.pb.go @@ -0,0 +1,309 @@ +// Credentials and revocations + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/message_contents/credential.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A credential that can be used in MLS leaf nodes +type MlsCredential struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationPublicKey []byte `protobuf:"bytes,1,opt,name=installation_public_key,json=installationPublicKey,proto3" json:"installation_public_key,omitempty"` + // Types that are assignable to Association: + // + // *MlsCredential_Eip_191 + Association isMlsCredential_Association `protobuf_oneof:"association"` +} + +func (x *MlsCredential) Reset() { + *x = MlsCredential{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_credential_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MlsCredential) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MlsCredential) ProtoMessage() {} + +func (x *MlsCredential) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_credential_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MlsCredential.ProtoReflect.Descriptor instead. +func (*MlsCredential) Descriptor() ([]byte, []int) { + return file_mls_message_contents_credential_proto_rawDescGZIP(), []int{0} +} + +func (x *MlsCredential) GetInstallationPublicKey() []byte { + if x != nil { + return x.InstallationPublicKey + } + return nil +} + +func (m *MlsCredential) GetAssociation() isMlsCredential_Association { + if m != nil { + return m.Association + } + return nil +} + +func (x *MlsCredential) GetEip_191() *Eip191Association { + if x, ok := x.GetAssociation().(*MlsCredential_Eip_191); ok { + return x.Eip_191 + } + return nil +} + +type isMlsCredential_Association interface { + isMlsCredential_Association() +} + +type MlsCredential_Eip_191 struct { + Eip_191 *Eip191Association `protobuf:"bytes,2,opt,name=eip_191,json=eip191,proto3,oneof"` +} + +func (*MlsCredential_Eip_191) isMlsCredential_Association() {} + +// A declaration and proof that a credential is no longer valid +type CredentialRevocation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationPublicKey []byte `protobuf:"bytes,1,opt,name=installation_public_key,json=installationPublicKey,proto3" json:"installation_public_key,omitempty"` + // Types that are assignable to Association: + // + // *CredentialRevocation_Eip_191 + Association isCredentialRevocation_Association `protobuf_oneof:"association"` +} + +func (x *CredentialRevocation) Reset() { + *x = CredentialRevocation{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_credential_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CredentialRevocation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CredentialRevocation) ProtoMessage() {} + +func (x *CredentialRevocation) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_credential_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CredentialRevocation.ProtoReflect.Descriptor instead. +func (*CredentialRevocation) Descriptor() ([]byte, []int) { + return file_mls_message_contents_credential_proto_rawDescGZIP(), []int{1} +} + +func (x *CredentialRevocation) GetInstallationPublicKey() []byte { + if x != nil { + return x.InstallationPublicKey + } + return nil +} + +func (m *CredentialRevocation) GetAssociation() isCredentialRevocation_Association { + if m != nil { + return m.Association + } + return nil +} + +func (x *CredentialRevocation) GetEip_191() *Eip191Association { + if x, ok := x.GetAssociation().(*CredentialRevocation_Eip_191); ok { + return x.Eip_191 + } + return nil +} + +type isCredentialRevocation_Association interface { + isCredentialRevocation_Association() +} + +type CredentialRevocation_Eip_191 struct { + Eip_191 *Eip191Association `protobuf:"bytes,2,opt,name=eip_191,json=eip191,proto3,oneof"` +} + +func (*CredentialRevocation_Eip_191) isCredentialRevocation_Association() {} + +var File_mls_message_contents_credential_proto protoreflect.FileDescriptor + +var file_mls_message_contents_credential_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x1a, 0x26, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x4d, + 0x6c, 0x73, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x17, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x47, 0x0a, 0x07, 0x65, 0x69, 0x70, 0x5f, 0x31, 0x39, 0x31, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x45, 0x69, 0x70, 0x31, 0x39, 0x31, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x65, 0x69, 0x70, 0x31, 0x39, 0x31, 0x42, 0x0d, 0x0a, + 0x0b, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, 0x0a, + 0x14, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x76, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x17, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x47, 0x0a, + 0x07, 0x65, 0x69, 0x70, 0x5f, 0x31, 0x39, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x69, 0x70, 0x31, 0x39, + 0x31, 0x41, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, + 0x65, 0x69, 0x70, 0x31, 0x39, 0x31, 0x42, 0x0d, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xef, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0f, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, + 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x4d, 0xaa, 0x02, 0x18, + 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, 0x5c, + 0x4d, 0x6c, 0x73, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0xe2, 0x02, 0x24, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x58, 0x6d, 0x74, + 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_message_contents_credential_proto_rawDescOnce sync.Once + file_mls_message_contents_credential_proto_rawDescData = file_mls_message_contents_credential_proto_rawDesc +) + +func file_mls_message_contents_credential_proto_rawDescGZIP() []byte { + file_mls_message_contents_credential_proto_rawDescOnce.Do(func() { + file_mls_message_contents_credential_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_message_contents_credential_proto_rawDescData) + }) + return file_mls_message_contents_credential_proto_rawDescData +} + +var file_mls_message_contents_credential_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_mls_message_contents_credential_proto_goTypes = []interface{}{ + (*MlsCredential)(nil), // 0: xmtp.mls.message_contents.MlsCredential + (*CredentialRevocation)(nil), // 1: xmtp.mls.message_contents.CredentialRevocation + (*Eip191Association)(nil), // 2: xmtp.mls.message_contents.Eip191Association +} +var file_mls_message_contents_credential_proto_depIdxs = []int32{ + 2, // 0: xmtp.mls.message_contents.MlsCredential.eip_191:type_name -> xmtp.mls.message_contents.Eip191Association + 2, // 1: xmtp.mls.message_contents.CredentialRevocation.eip_191:type_name -> xmtp.mls.message_contents.Eip191Association + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_mls_message_contents_credential_proto_init() } +func file_mls_message_contents_credential_proto_init() { + if File_mls_message_contents_credential_proto != nil { + return + } + file_mls_message_contents_association_proto_init() + if !protoimpl.UnsafeEnabled { + file_mls_message_contents_credential_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MlsCredential); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_credential_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CredentialRevocation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mls_message_contents_credential_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*MlsCredential_Eip_191)(nil), + } + file_mls_message_contents_credential_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*CredentialRevocation_Eip_191)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_message_contents_credential_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mls_message_contents_credential_proto_goTypes, + DependencyIndexes: file_mls_message_contents_credential_proto_depIdxs, + MessageInfos: file_mls_message_contents_credential_proto_msgTypes, + }.Build() + File_mls_message_contents_credential_proto = out.File + file_mls_message_contents_credential_proto_rawDesc = nil + file_mls_message_contents_credential_proto_goTypes = nil + file_mls_message_contents_credential_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/message_contents/group_metadata.pb.go b/pkg/proto/mls/message_contents/group_metadata.pb.go new file mode 100644 index 00000000..7ee35a48 --- /dev/null +++ b/pkg/proto/mls/message_contents/group_metadata.pb.go @@ -0,0 +1,668 @@ +// Group metadata + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/message_contents/group_metadata.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Defines the type of conversation +type ConversationType int32 + +const ( + ConversationType_CONVERSATION_TYPE_UNSPECIFIED ConversationType = 0 + ConversationType_CONVERSATION_TYPE_GROUP ConversationType = 1 + ConversationType_CONVERSATION_TYPE_DM ConversationType = 2 +) + +// Enum value maps for ConversationType. +var ( + ConversationType_name = map[int32]string{ + 0: "CONVERSATION_TYPE_UNSPECIFIED", + 1: "CONVERSATION_TYPE_GROUP", + 2: "CONVERSATION_TYPE_DM", + } + ConversationType_value = map[string]int32{ + "CONVERSATION_TYPE_UNSPECIFIED": 0, + "CONVERSATION_TYPE_GROUP": 1, + "CONVERSATION_TYPE_DM": 2, + } +) + +func (x ConversationType) Enum() *ConversationType { + p := new(ConversationType) + *p = x + return p +} + +func (x ConversationType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConversationType) Descriptor() protoreflect.EnumDescriptor { + return file_mls_message_contents_group_metadata_proto_enumTypes[0].Descriptor() +} + +func (ConversationType) Type() protoreflect.EnumType { + return &file_mls_message_contents_group_metadata_proto_enumTypes[0] +} + +func (x ConversationType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConversationType.Descriptor instead. +func (ConversationType) EnumDescriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{0} +} + +// Base policy +type MembershipPolicy_BasePolicy int32 + +const ( + MembershipPolicy_BASE_POLICY_UNSPECIFIED MembershipPolicy_BasePolicy = 0 + MembershipPolicy_BASE_POLICY_ALLOW MembershipPolicy_BasePolicy = 1 + MembershipPolicy_BASE_POLICY_DENY MembershipPolicy_BasePolicy = 2 + MembershipPolicy_BASE_POLICY_ALLOW_IF_ACTOR_CREATOR MembershipPolicy_BasePolicy = 3 +) + +// Enum value maps for MembershipPolicy_BasePolicy. +var ( + MembershipPolicy_BasePolicy_name = map[int32]string{ + 0: "BASE_POLICY_UNSPECIFIED", + 1: "BASE_POLICY_ALLOW", + 2: "BASE_POLICY_DENY", + 3: "BASE_POLICY_ALLOW_IF_ACTOR_CREATOR", + } + MembershipPolicy_BasePolicy_value = map[string]int32{ + "BASE_POLICY_UNSPECIFIED": 0, + "BASE_POLICY_ALLOW": 1, + "BASE_POLICY_DENY": 2, + "BASE_POLICY_ALLOW_IF_ACTOR_CREATOR": 3, + } +) + +func (x MembershipPolicy_BasePolicy) Enum() *MembershipPolicy_BasePolicy { + p := new(MembershipPolicy_BasePolicy) + *p = x + return p +} + +func (x MembershipPolicy_BasePolicy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MembershipPolicy_BasePolicy) Descriptor() protoreflect.EnumDescriptor { + return file_mls_message_contents_group_metadata_proto_enumTypes[1].Descriptor() +} + +func (MembershipPolicy_BasePolicy) Type() protoreflect.EnumType { + return &file_mls_message_contents_group_metadata_proto_enumTypes[1] +} + +func (x MembershipPolicy_BasePolicy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MembershipPolicy_BasePolicy.Descriptor instead. +func (MembershipPolicy_BasePolicy) EnumDescriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{2, 0} +} + +// Parent message for group metadata +type GroupMetadataV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConversationType ConversationType `protobuf:"varint,1,opt,name=conversation_type,json=conversationType,proto3,enum=xmtp.mls.message_contents.ConversationType" json:"conversation_type,omitempty"` + CreatorAccountAddress string `protobuf:"bytes,2,opt,name=creator_account_address,json=creatorAccountAddress,proto3" json:"creator_account_address,omitempty"` + Policies *PolicySet `protobuf:"bytes,3,opt,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *GroupMetadataV1) Reset() { + *x = GroupMetadataV1{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMetadataV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMetadataV1) ProtoMessage() {} + +func (x *GroupMetadataV1) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMetadataV1.ProtoReflect.Descriptor instead. +func (*GroupMetadataV1) Descriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{0} +} + +func (x *GroupMetadataV1) GetConversationType() ConversationType { + if x != nil { + return x.ConversationType + } + return ConversationType_CONVERSATION_TYPE_UNSPECIFIED +} + +func (x *GroupMetadataV1) GetCreatorAccountAddress() string { + if x != nil { + return x.CreatorAccountAddress + } + return "" +} + +func (x *GroupMetadataV1) GetPolicies() *PolicySet { + if x != nil { + return x.Policies + } + return nil +} + +// The set of policies that govern the group +type PolicySet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AddMemberPolicy *MembershipPolicy `protobuf:"bytes,1,opt,name=add_member_policy,json=addMemberPolicy,proto3" json:"add_member_policy,omitempty"` + RemoveMemberPolicy *MembershipPolicy `protobuf:"bytes,2,opt,name=remove_member_policy,json=removeMemberPolicy,proto3" json:"remove_member_policy,omitempty"` +} + +func (x *PolicySet) Reset() { + *x = PolicySet{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicySet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicySet) ProtoMessage() {} + +func (x *PolicySet) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PolicySet.ProtoReflect.Descriptor instead. +func (*PolicySet) Descriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{1} +} + +func (x *PolicySet) GetAddMemberPolicy() *MembershipPolicy { + if x != nil { + return x.AddMemberPolicy + } + return nil +} + +func (x *PolicySet) GetRemoveMemberPolicy() *MembershipPolicy { + if x != nil { + return x.RemoveMemberPolicy + } + return nil +} + +// A policy that governs adding/removing members or installations +type MembershipPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *MembershipPolicy_Base + // *MembershipPolicy_AndCondition_ + // *MembershipPolicy_AnyCondition_ + Kind isMembershipPolicy_Kind `protobuf_oneof:"kind"` +} + +func (x *MembershipPolicy) Reset() { + *x = MembershipPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipPolicy) ProtoMessage() {} + +func (x *MembershipPolicy) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipPolicy.ProtoReflect.Descriptor instead. +func (*MembershipPolicy) Descriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{2} +} + +func (m *MembershipPolicy) GetKind() isMembershipPolicy_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *MembershipPolicy) GetBase() MembershipPolicy_BasePolicy { + if x, ok := x.GetKind().(*MembershipPolicy_Base); ok { + return x.Base + } + return MembershipPolicy_BASE_POLICY_UNSPECIFIED +} + +func (x *MembershipPolicy) GetAndCondition() *MembershipPolicy_AndCondition { + if x, ok := x.GetKind().(*MembershipPolicy_AndCondition_); ok { + return x.AndCondition + } + return nil +} + +func (x *MembershipPolicy) GetAnyCondition() *MembershipPolicy_AnyCondition { + if x, ok := x.GetKind().(*MembershipPolicy_AnyCondition_); ok { + return x.AnyCondition + } + return nil +} + +type isMembershipPolicy_Kind interface { + isMembershipPolicy_Kind() +} + +type MembershipPolicy_Base struct { + Base MembershipPolicy_BasePolicy `protobuf:"varint,1,opt,name=base,proto3,enum=xmtp.mls.message_contents.MembershipPolicy_BasePolicy,oneof"` +} + +type MembershipPolicy_AndCondition_ struct { + AndCondition *MembershipPolicy_AndCondition `protobuf:"bytes,2,opt,name=and_condition,json=andCondition,proto3,oneof"` +} + +type MembershipPolicy_AnyCondition_ struct { + AnyCondition *MembershipPolicy_AnyCondition `protobuf:"bytes,3,opt,name=any_condition,json=anyCondition,proto3,oneof"` +} + +func (*MembershipPolicy_Base) isMembershipPolicy_Kind() {} + +func (*MembershipPolicy_AndCondition_) isMembershipPolicy_Kind() {} + +func (*MembershipPolicy_AnyCondition_) isMembershipPolicy_Kind() {} + +// Combine multiple policies. All must evaluate to true +type MembershipPolicy_AndCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policies []*MembershipPolicy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *MembershipPolicy_AndCondition) Reset() { + *x = MembershipPolicy_AndCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipPolicy_AndCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipPolicy_AndCondition) ProtoMessage() {} + +func (x *MembershipPolicy_AndCondition) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipPolicy_AndCondition.ProtoReflect.Descriptor instead. +func (*MembershipPolicy_AndCondition) Descriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *MembershipPolicy_AndCondition) GetPolicies() []*MembershipPolicy { + if x != nil { + return x.Policies + } + return nil +} + +// Combine multiple policies. Any must evaluate to true +type MembershipPolicy_AnyCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policies []*MembershipPolicy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *MembershipPolicy_AnyCondition) Reset() { + *x = MembershipPolicy_AnyCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipPolicy_AnyCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipPolicy_AnyCondition) ProtoMessage() {} + +func (x *MembershipPolicy_AnyCondition) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_group_metadata_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipPolicy_AnyCondition.ProtoReflect.Descriptor instead. +func (*MembershipPolicy_AnyCondition) Descriptor() ([]byte, []int) { + return file_mls_message_contents_group_metadata_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *MembershipPolicy_AnyCondition) GetPolicies() []*MembershipPolicy { + if x != nil { + return x.Policies + } + return nil +} + +var File_mls_message_contents_group_metadata_proto protoreflect.FileDescriptor + +var file_mls_message_contents_group_metadata_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x56, 0x31, 0x12, 0x58, 0x0a, 0x11, 0x63, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x08, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x53, 0x65, 0x74, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0xc3, + 0x01, 0x0a, 0x09, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x74, 0x12, 0x57, 0x0a, 0x11, + 0x61, 0x64, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0f, 0x61, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x5d, 0x0a, 0x14, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x52, 0x12, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x22, 0xdc, 0x04, 0x0a, 0x10, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4c, 0x0a, 0x04, 0x62, 0x61, 0x73, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, + 0x00, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0d, 0x61, 0x6e, 0x64, 0x5f, 0x63, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x6e, 0x64, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x6e, 0x64, 0x43, + 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5f, 0x0a, 0x0d, 0x61, 0x6e, 0x79, 0x5f, + 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x38, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x6e, 0x79, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x6e, 0x79, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x57, 0x0a, 0x0c, 0x41, 0x6e, 0x64, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x08, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, + 0x69, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x1a, 0x57, 0x0a, 0x0c, 0x41, 0x6e, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x7e, 0x0a, 0x0a, 0x42, + 0x61, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x17, 0x42, 0x41, 0x53, + 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x50, + 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, + 0x10, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x44, 0x45, 0x4e, + 0x59, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, + 0x43, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x49, 0x46, 0x5f, 0x41, 0x43, 0x54, 0x4f, + 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x03, 0x42, 0x06, 0x0a, 0x04, 0x6b, + 0x69, 0x6e, 0x64, 0x2a, 0x6c, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4e, 0x56, 0x45, + 0x52, 0x53, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, + 0x4e, 0x56, 0x45, 0x52, 0x53, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4e, 0x56, 0x45, + 0x52, 0x53, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4d, 0x10, + 0x02, 0x42, 0xf2, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x42, 0x12, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, + 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x4d, 0xaa, 0x02, 0x18, 0x58, + 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xca, 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, + 0x6c, 0x73, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0xe2, 0x02, 0x24, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x58, 0x6d, 0x74, 0x70, + 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_message_contents_group_metadata_proto_rawDescOnce sync.Once + file_mls_message_contents_group_metadata_proto_rawDescData = file_mls_message_contents_group_metadata_proto_rawDesc +) + +func file_mls_message_contents_group_metadata_proto_rawDescGZIP() []byte { + file_mls_message_contents_group_metadata_proto_rawDescOnce.Do(func() { + file_mls_message_contents_group_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_message_contents_group_metadata_proto_rawDescData) + }) + return file_mls_message_contents_group_metadata_proto_rawDescData +} + +var file_mls_message_contents_group_metadata_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_mls_message_contents_group_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_mls_message_contents_group_metadata_proto_goTypes = []interface{}{ + (ConversationType)(0), // 0: xmtp.mls.message_contents.ConversationType + (MembershipPolicy_BasePolicy)(0), // 1: xmtp.mls.message_contents.MembershipPolicy.BasePolicy + (*GroupMetadataV1)(nil), // 2: xmtp.mls.message_contents.GroupMetadataV1 + (*PolicySet)(nil), // 3: xmtp.mls.message_contents.PolicySet + (*MembershipPolicy)(nil), // 4: xmtp.mls.message_contents.MembershipPolicy + (*MembershipPolicy_AndCondition)(nil), // 5: xmtp.mls.message_contents.MembershipPolicy.AndCondition + (*MembershipPolicy_AnyCondition)(nil), // 6: xmtp.mls.message_contents.MembershipPolicy.AnyCondition +} +var file_mls_message_contents_group_metadata_proto_depIdxs = []int32{ + 0, // 0: xmtp.mls.message_contents.GroupMetadataV1.conversation_type:type_name -> xmtp.mls.message_contents.ConversationType + 3, // 1: xmtp.mls.message_contents.GroupMetadataV1.policies:type_name -> xmtp.mls.message_contents.PolicySet + 4, // 2: xmtp.mls.message_contents.PolicySet.add_member_policy:type_name -> xmtp.mls.message_contents.MembershipPolicy + 4, // 3: xmtp.mls.message_contents.PolicySet.remove_member_policy:type_name -> xmtp.mls.message_contents.MembershipPolicy + 1, // 4: xmtp.mls.message_contents.MembershipPolicy.base:type_name -> xmtp.mls.message_contents.MembershipPolicy.BasePolicy + 5, // 5: xmtp.mls.message_contents.MembershipPolicy.and_condition:type_name -> xmtp.mls.message_contents.MembershipPolicy.AndCondition + 6, // 6: xmtp.mls.message_contents.MembershipPolicy.any_condition:type_name -> xmtp.mls.message_contents.MembershipPolicy.AnyCondition + 4, // 7: xmtp.mls.message_contents.MembershipPolicy.AndCondition.policies:type_name -> xmtp.mls.message_contents.MembershipPolicy + 4, // 8: xmtp.mls.message_contents.MembershipPolicy.AnyCondition.policies:type_name -> xmtp.mls.message_contents.MembershipPolicy + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_mls_message_contents_group_metadata_proto_init() } +func file_mls_message_contents_group_metadata_proto_init() { + if File_mls_message_contents_group_metadata_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_message_contents_group_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMetadataV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_group_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolicySet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_group_metadata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_group_metadata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipPolicy_AndCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_group_metadata_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipPolicy_AnyCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mls_message_contents_group_metadata_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*MembershipPolicy_Base)(nil), + (*MembershipPolicy_AndCondition_)(nil), + (*MembershipPolicy_AnyCondition_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_message_contents_group_metadata_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mls_message_contents_group_metadata_proto_goTypes, + DependencyIndexes: file_mls_message_contents_group_metadata_proto_depIdxs, + EnumInfos: file_mls_message_contents_group_metadata_proto_enumTypes, + MessageInfos: file_mls_message_contents_group_metadata_proto_msgTypes, + }.Build() + File_mls_message_contents_group_metadata_proto = out.File + file_mls_message_contents_group_metadata_proto_rawDesc = nil + file_mls_message_contents_group_metadata_proto_goTypes = nil + file_mls_message_contents_group_metadata_proto_depIdxs = nil +} diff --git a/pkg/proto/mls/message_contents/transcript_messages.pb.go b/pkg/proto/mls/message_contents/transcript_messages.pb.go new file mode 100644 index 00000000..2b04be13 --- /dev/null +++ b/pkg/proto/mls/message_contents/transcript_messages.pb.go @@ -0,0 +1,304 @@ +// Message content encoding structures + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls/message_contents/transcript_messages.proto + +package message_contents + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A group member and affected installation IDs +type MembershipChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationIds [][]byte `protobuf:"bytes,1,rep,name=installation_ids,json=installationIds,proto3" json:"installation_ids,omitempty"` + AccountAddress string `protobuf:"bytes,2,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + InitiatedByAccountAddress string `protobuf:"bytes,3,opt,name=initiated_by_account_address,json=initiatedByAccountAddress,proto3" json:"initiated_by_account_address,omitempty"` +} + +func (x *MembershipChange) Reset() { + *x = MembershipChange{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_transcript_messages_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipChange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipChange) ProtoMessage() {} + +func (x *MembershipChange) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_transcript_messages_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipChange.ProtoReflect.Descriptor instead. +func (*MembershipChange) Descriptor() ([]byte, []int) { + return file_mls_message_contents_transcript_messages_proto_rawDescGZIP(), []int{0} +} + +func (x *MembershipChange) GetInstallationIds() [][]byte { + if x != nil { + return x.InstallationIds + } + return nil +} + +func (x *MembershipChange) GetAccountAddress() string { + if x != nil { + return x.AccountAddress + } + return "" +} + +func (x *MembershipChange) GetInitiatedByAccountAddress() string { + if x != nil { + return x.InitiatedByAccountAddress + } + return "" +} + +// The group membership change proto +type GroupMembershipChanges struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Members that have been added in the commit + MembersAdded []*MembershipChange `protobuf:"bytes,1,rep,name=members_added,json=membersAdded,proto3" json:"members_added,omitempty"` + // Members that have been removed in the commit + MembersRemoved []*MembershipChange `protobuf:"bytes,2,rep,name=members_removed,json=membersRemoved,proto3" json:"members_removed,omitempty"` + // Installations that have been added in the commit, grouped by member + InstallationsAdded []*MembershipChange `protobuf:"bytes,3,rep,name=installations_added,json=installationsAdded,proto3" json:"installations_added,omitempty"` + // Installations removed in the commit, grouped by member + InstallationsRemoved []*MembershipChange `protobuf:"bytes,4,rep,name=installations_removed,json=installationsRemoved,proto3" json:"installations_removed,omitempty"` +} + +func (x *GroupMembershipChanges) Reset() { + *x = GroupMembershipChanges{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_message_contents_transcript_messages_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMembershipChanges) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMembershipChanges) ProtoMessage() {} + +func (x *GroupMembershipChanges) ProtoReflect() protoreflect.Message { + mi := &file_mls_message_contents_transcript_messages_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMembershipChanges.ProtoReflect.Descriptor instead. +func (*GroupMembershipChanges) Descriptor() ([]byte, []int) { + return file_mls_message_contents_transcript_messages_proto_rawDescGZIP(), []int{1} +} + +func (x *GroupMembershipChanges) GetMembersAdded() []*MembershipChange { + if x != nil { + return x.MembersAdded + } + return nil +} + +func (x *GroupMembershipChanges) GetMembersRemoved() []*MembershipChange { + if x != nil { + return x.MembersRemoved + } + return nil +} + +func (x *GroupMembershipChanges) GetInstallationsAdded() []*MembershipChange { + if x != nil { + return x.InstallationsAdded + } + return nil +} + +func (x *GroupMembershipChanges) GetInstallationsRemoved() []*MembershipChange { + if x != nil { + return x.InstallationsRemoved + } + return nil +} + +var File_mls_message_contents_transcript_messages_proto protoreflect.FileDescriptor + +var file_mls_message_contents_transcript_messages_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x6d, 0x6c, 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x19, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x10, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a, 0x1c, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x80, 0x03, 0x0a, 0x16, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x12, 0x50, 0x0a, 0x0d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0c, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x41, 0x64, 0x64, + 0x65, 0x64, 0x12, 0x54, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, + 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x5c, 0x0a, 0x13, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x65, 0x64, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x41, 0x64, 0x64, 0x65, 0x64, 0x12, 0x60, 0x0a, 0x15, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x52, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x42, 0xf7, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x17, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, + 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, + 0x73, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x4d, 0xaa, 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, 0x2e, + 0x4d, 0x6c, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0xca, 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0xe2, 0x02, + 0x24, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, + 0x73, 0x3a, 0x3a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_message_contents_transcript_messages_proto_rawDescOnce sync.Once + file_mls_message_contents_transcript_messages_proto_rawDescData = file_mls_message_contents_transcript_messages_proto_rawDesc +) + +func file_mls_message_contents_transcript_messages_proto_rawDescGZIP() []byte { + file_mls_message_contents_transcript_messages_proto_rawDescOnce.Do(func() { + file_mls_message_contents_transcript_messages_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_message_contents_transcript_messages_proto_rawDescData) + }) + return file_mls_message_contents_transcript_messages_proto_rawDescData +} + +var file_mls_message_contents_transcript_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_mls_message_contents_transcript_messages_proto_goTypes = []interface{}{ + (*MembershipChange)(nil), // 0: xmtp.mls.message_contents.MembershipChange + (*GroupMembershipChanges)(nil), // 1: xmtp.mls.message_contents.GroupMembershipChanges +} +var file_mls_message_contents_transcript_messages_proto_depIdxs = []int32{ + 0, // 0: xmtp.mls.message_contents.GroupMembershipChanges.members_added:type_name -> xmtp.mls.message_contents.MembershipChange + 0, // 1: xmtp.mls.message_contents.GroupMembershipChanges.members_removed:type_name -> xmtp.mls.message_contents.MembershipChange + 0, // 2: xmtp.mls.message_contents.GroupMembershipChanges.installations_added:type_name -> xmtp.mls.message_contents.MembershipChange + 0, // 3: xmtp.mls.message_contents.GroupMembershipChanges.installations_removed:type_name -> xmtp.mls.message_contents.MembershipChange + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_mls_message_contents_transcript_messages_proto_init() } +func file_mls_message_contents_transcript_messages_proto_init() { + if File_mls_message_contents_transcript_messages_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_message_contents_transcript_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_message_contents_transcript_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMembershipChanges); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_message_contents_transcript_messages_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mls_message_contents_transcript_messages_proto_goTypes, + DependencyIndexes: file_mls_message_contents_transcript_messages_proto_depIdxs, + MessageInfos: file_mls_message_contents_transcript_messages_proto_msgTypes, + }.Build() + File_mls_message_contents_transcript_messages_proto = out.File + file_mls_message_contents_transcript_messages_proto_rawDesc = nil + file_mls_message_contents_transcript_messages_proto_goTypes = nil + file_mls_message_contents_transcript_messages_proto_depIdxs = nil +} diff --git a/pkg/proto/mls_validation/v1/service.pb.go b/pkg/proto/mls_validation/v1/service.pb.go new file mode 100644 index 00000000..09f67501 --- /dev/null +++ b/pkg/proto/mls_validation/v1/service.pb.go @@ -0,0 +1,735 @@ +// Message API + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: mls_validation/v1/service.proto + +package mls_validationv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Contains a batch of serialized Key Packages +type ValidateKeyPackagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyPackages []*ValidateKeyPackagesRequest_KeyPackage `protobuf:"bytes,1,rep,name=key_packages,json=keyPackages,proto3" json:"key_packages,omitempty"` +} + +func (x *ValidateKeyPackagesRequest) Reset() { + *x = ValidateKeyPackagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateKeyPackagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateKeyPackagesRequest) ProtoMessage() {} + +func (x *ValidateKeyPackagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateKeyPackagesRequest.ProtoReflect.Descriptor instead. +func (*ValidateKeyPackagesRequest) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{0} +} + +func (x *ValidateKeyPackagesRequest) GetKeyPackages() []*ValidateKeyPackagesRequest_KeyPackage { + if x != nil { + return x.KeyPackages + } + return nil +} + +// Response to ValidateKeyPackagesRequest +type ValidateKeyPackagesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*ValidateKeyPackagesResponse_ValidationResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *ValidateKeyPackagesResponse) Reset() { + *x = ValidateKeyPackagesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateKeyPackagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateKeyPackagesResponse) ProtoMessage() {} + +func (x *ValidateKeyPackagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateKeyPackagesResponse.ProtoReflect.Descriptor instead. +func (*ValidateKeyPackagesResponse) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{1} +} + +func (x *ValidateKeyPackagesResponse) GetResponses() []*ValidateKeyPackagesResponse_ValidationResponse { + if x != nil { + return x.Responses + } + return nil +} + +// Contains a batch of serialized Group Messages +type ValidateGroupMessagesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupMessages []*ValidateGroupMessagesRequest_GroupMessage `protobuf:"bytes,1,rep,name=group_messages,json=groupMessages,proto3" json:"group_messages,omitempty"` +} + +func (x *ValidateGroupMessagesRequest) Reset() { + *x = ValidateGroupMessagesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateGroupMessagesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateGroupMessagesRequest) ProtoMessage() {} + +func (x *ValidateGroupMessagesRequest) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateGroupMessagesRequest.ProtoReflect.Descriptor instead. +func (*ValidateGroupMessagesRequest) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ValidateGroupMessagesRequest) GetGroupMessages() []*ValidateGroupMessagesRequest_GroupMessage { + if x != nil { + return x.GroupMessages + } + return nil +} + +// Response to ValidateGroupMessagesRequest +type ValidateGroupMessagesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Responses []*ValidateGroupMessagesResponse_ValidationResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` +} + +func (x *ValidateGroupMessagesResponse) Reset() { + *x = ValidateGroupMessagesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateGroupMessagesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateGroupMessagesResponse) ProtoMessage() {} + +func (x *ValidateGroupMessagesResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateGroupMessagesResponse.ProtoReflect.Descriptor instead. +func (*ValidateGroupMessagesResponse) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ValidateGroupMessagesResponse) GetResponses() []*ValidateGroupMessagesResponse_ValidationResponse { + if x != nil { + return x.Responses + } + return nil +} + +// Wrapper for each key package +type ValidateKeyPackagesRequest_KeyPackage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyPackageBytesTlsSerialized []byte `protobuf:"bytes,1,opt,name=key_package_bytes_tls_serialized,json=keyPackageBytesTlsSerialized,proto3" json:"key_package_bytes_tls_serialized,omitempty"` +} + +func (x *ValidateKeyPackagesRequest_KeyPackage) Reset() { + *x = ValidateKeyPackagesRequest_KeyPackage{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateKeyPackagesRequest_KeyPackage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateKeyPackagesRequest_KeyPackage) ProtoMessage() {} + +func (x *ValidateKeyPackagesRequest_KeyPackage) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateKeyPackagesRequest_KeyPackage.ProtoReflect.Descriptor instead. +func (*ValidateKeyPackagesRequest_KeyPackage) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *ValidateKeyPackagesRequest_KeyPackage) GetKeyPackageBytesTlsSerialized() []byte { + if x != nil { + return x.KeyPackageBytesTlsSerialized + } + return nil +} + +// An individual response to one key package +type ValidateKeyPackagesResponse_ValidationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsOk bool `protobuf:"varint,1,opt,name=is_ok,json=isOk,proto3" json:"is_ok,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + InstallationId []byte `protobuf:"bytes,3,opt,name=installation_id,json=installationId,proto3" json:"installation_id,omitempty"` + AccountAddress string `protobuf:"bytes,4,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + CredentialIdentityBytes []byte `protobuf:"bytes,5,opt,name=credential_identity_bytes,json=credentialIdentityBytes,proto3" json:"credential_identity_bytes,omitempty"` + Expiration uint64 `protobuf:"varint,6,opt,name=expiration,proto3" json:"expiration,omitempty"` +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) Reset() { + *x = ValidateKeyPackagesResponse_ValidationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateKeyPackagesResponse_ValidationResponse) ProtoMessage() {} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateKeyPackagesResponse_ValidationResponse.ProtoReflect.Descriptor instead. +func (*ValidateKeyPackagesResponse_ValidationResponse) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) GetIsOk() bool { + if x != nil { + return x.IsOk + } + return false +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) GetInstallationId() []byte { + if x != nil { + return x.InstallationId + } + return nil +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) GetAccountAddress() string { + if x != nil { + return x.AccountAddress + } + return "" +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) GetCredentialIdentityBytes() []byte { + if x != nil { + return x.CredentialIdentityBytes + } + return nil +} + +func (x *ValidateKeyPackagesResponse_ValidationResponse) GetExpiration() uint64 { + if x != nil { + return x.Expiration + } + return 0 +} + +// Wrapper for each message +type ValidateGroupMessagesRequest_GroupMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupMessageBytesTlsSerialized []byte `protobuf:"bytes,1,opt,name=group_message_bytes_tls_serialized,json=groupMessageBytesTlsSerialized,proto3" json:"group_message_bytes_tls_serialized,omitempty"` +} + +func (x *ValidateGroupMessagesRequest_GroupMessage) Reset() { + *x = ValidateGroupMessagesRequest_GroupMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateGroupMessagesRequest_GroupMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateGroupMessagesRequest_GroupMessage) ProtoMessage() {} + +func (x *ValidateGroupMessagesRequest_GroupMessage) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateGroupMessagesRequest_GroupMessage.ProtoReflect.Descriptor instead. +func (*ValidateGroupMessagesRequest_GroupMessage) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *ValidateGroupMessagesRequest_GroupMessage) GetGroupMessageBytesTlsSerialized() []byte { + if x != nil { + return x.GroupMessageBytesTlsSerialized + } + return nil +} + +// An individual response to one message +type ValidateGroupMessagesResponse_ValidationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsOk bool `protobuf:"varint,1,opt,name=is_ok,json=isOk,proto3" json:"is_ok,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + GroupId string `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` +} + +func (x *ValidateGroupMessagesResponse_ValidationResponse) Reset() { + *x = ValidateGroupMessagesResponse_ValidationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_validation_v1_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateGroupMessagesResponse_ValidationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateGroupMessagesResponse_ValidationResponse) ProtoMessage() {} + +func (x *ValidateGroupMessagesResponse_ValidationResponse) ProtoReflect() protoreflect.Message { + mi := &file_mls_validation_v1_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateGroupMessagesResponse_ValidationResponse.ProtoReflect.Descriptor instead. +func (*ValidateGroupMessagesResponse_ValidationResponse) Descriptor() ([]byte, []int) { + return file_mls_validation_v1_service_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ValidateGroupMessagesResponse_ValidationResponse) GetIsOk() bool { + if x != nil { + return x.IsOk + } + return false +} + +func (x *ValidateGroupMessagesResponse_ValidationResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *ValidateGroupMessagesResponse_ValidationResponse) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +var File_mls_validation_v1_service_proto protoreflect.FileDescriptor + +var file_mls_validation_v1_service_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x16, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xd4, 0x01, 0x0a, 0x1a, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x60, 0x0a, 0x0c, 0x6b, 0x65, 0x79, 0x5f, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x6b, + 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x1a, 0x54, 0x0a, 0x0a, 0x4b, 0x65, + 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x46, 0x0a, 0x20, 0x6b, 0x65, 0x79, 0x5f, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x74, 0x6c, + 0x73, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x1c, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x54, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, + 0x22, 0x82, 0x03, 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, + 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x64, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0xfc, 0x01, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x13, 0x0a, + 0x05, 0x69, 0x73, 0x5f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, + 0x4f, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x68, 0x0a, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x1a, 0x5a, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x4a, 0x0a, 0x22, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, + 0x6c, 0x73, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0xf2, 0x01, 0x0a, + 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x48, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x1a, 0x69, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x13, 0x0a, 0x05, + 0x69, 0x73, 0x5f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, + 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x32, 0x9b, 0x02, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x70, 0x69, 0x12, 0x80, 0x01, 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x32, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, + 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x33, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x86, 0x01, 0x0a, 0x15, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x12, 0x34, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0xeb, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6c, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x58, 0xaa, + 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, + 0x6c, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x21, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mls_validation_v1_service_proto_rawDescOnce sync.Once + file_mls_validation_v1_service_proto_rawDescData = file_mls_validation_v1_service_proto_rawDesc +) + +func file_mls_validation_v1_service_proto_rawDescGZIP() []byte { + file_mls_validation_v1_service_proto_rawDescOnce.Do(func() { + file_mls_validation_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_mls_validation_v1_service_proto_rawDescData) + }) + return file_mls_validation_v1_service_proto_rawDescData +} + +var file_mls_validation_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_mls_validation_v1_service_proto_goTypes = []interface{}{ + (*ValidateKeyPackagesRequest)(nil), // 0: xmtp.mls_validation.v1.ValidateKeyPackagesRequest + (*ValidateKeyPackagesResponse)(nil), // 1: xmtp.mls_validation.v1.ValidateKeyPackagesResponse + (*ValidateGroupMessagesRequest)(nil), // 2: xmtp.mls_validation.v1.ValidateGroupMessagesRequest + (*ValidateGroupMessagesResponse)(nil), // 3: xmtp.mls_validation.v1.ValidateGroupMessagesResponse + (*ValidateKeyPackagesRequest_KeyPackage)(nil), // 4: xmtp.mls_validation.v1.ValidateKeyPackagesRequest.KeyPackage + (*ValidateKeyPackagesResponse_ValidationResponse)(nil), // 5: xmtp.mls_validation.v1.ValidateKeyPackagesResponse.ValidationResponse + (*ValidateGroupMessagesRequest_GroupMessage)(nil), // 6: xmtp.mls_validation.v1.ValidateGroupMessagesRequest.GroupMessage + (*ValidateGroupMessagesResponse_ValidationResponse)(nil), // 7: xmtp.mls_validation.v1.ValidateGroupMessagesResponse.ValidationResponse +} +var file_mls_validation_v1_service_proto_depIdxs = []int32{ + 4, // 0: xmtp.mls_validation.v1.ValidateKeyPackagesRequest.key_packages:type_name -> xmtp.mls_validation.v1.ValidateKeyPackagesRequest.KeyPackage + 5, // 1: xmtp.mls_validation.v1.ValidateKeyPackagesResponse.responses:type_name -> xmtp.mls_validation.v1.ValidateKeyPackagesResponse.ValidationResponse + 6, // 2: xmtp.mls_validation.v1.ValidateGroupMessagesRequest.group_messages:type_name -> xmtp.mls_validation.v1.ValidateGroupMessagesRequest.GroupMessage + 7, // 3: xmtp.mls_validation.v1.ValidateGroupMessagesResponse.responses:type_name -> xmtp.mls_validation.v1.ValidateGroupMessagesResponse.ValidationResponse + 0, // 4: xmtp.mls_validation.v1.ValidationApi.ValidateKeyPackages:input_type -> xmtp.mls_validation.v1.ValidateKeyPackagesRequest + 2, // 5: xmtp.mls_validation.v1.ValidationApi.ValidateGroupMessages:input_type -> xmtp.mls_validation.v1.ValidateGroupMessagesRequest + 1, // 6: xmtp.mls_validation.v1.ValidationApi.ValidateKeyPackages:output_type -> xmtp.mls_validation.v1.ValidateKeyPackagesResponse + 3, // 7: xmtp.mls_validation.v1.ValidationApi.ValidateGroupMessages:output_type -> xmtp.mls_validation.v1.ValidateGroupMessagesResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_mls_validation_v1_service_proto_init() } +func file_mls_validation_v1_service_proto_init() { + if File_mls_validation_v1_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mls_validation_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateKeyPackagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateKeyPackagesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateGroupMessagesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateGroupMessagesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateKeyPackagesRequest_KeyPackage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateKeyPackagesResponse_ValidationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateGroupMessagesRequest_GroupMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_validation_v1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateGroupMessagesResponse_ValidationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mls_validation_v1_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mls_validation_v1_service_proto_goTypes, + DependencyIndexes: file_mls_validation_v1_service_proto_depIdxs, + MessageInfos: file_mls_validation_v1_service_proto_msgTypes, + }.Build() + File_mls_validation_v1_service_proto = out.File + file_mls_validation_v1_service_proto_rawDesc = nil + file_mls_validation_v1_service_proto_goTypes = nil + file_mls_validation_v1_service_proto_depIdxs = nil +} diff --git a/pkg/proto/mls_validation/v1/service_grpc.pb.go b/pkg/proto/mls_validation/v1/service_grpc.pb.go new file mode 100644 index 00000000..a0e21c24 --- /dev/null +++ b/pkg/proto/mls_validation/v1/service_grpc.pb.go @@ -0,0 +1,152 @@ +// Message API + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: mls_validation/v1/service.proto + +package mls_validationv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ValidationApi_ValidateKeyPackages_FullMethodName = "/xmtp.mls_validation.v1.ValidationApi/ValidateKeyPackages" + ValidationApi_ValidateGroupMessages_FullMethodName = "/xmtp.mls_validation.v1.ValidationApi/ValidateGroupMessages" +) + +// ValidationApiClient is the client API for ValidationApi service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ValidationApiClient interface { + // Validates and parses a batch of key packages and returns relevant details + ValidateKeyPackages(ctx context.Context, in *ValidateKeyPackagesRequest, opts ...grpc.CallOption) (*ValidateKeyPackagesResponse, error) + // Validates and parses a group message and returns relevant details + ValidateGroupMessages(ctx context.Context, in *ValidateGroupMessagesRequest, opts ...grpc.CallOption) (*ValidateGroupMessagesResponse, error) +} + +type validationApiClient struct { + cc grpc.ClientConnInterface +} + +func NewValidationApiClient(cc grpc.ClientConnInterface) ValidationApiClient { + return &validationApiClient{cc} +} + +func (c *validationApiClient) ValidateKeyPackages(ctx context.Context, in *ValidateKeyPackagesRequest, opts ...grpc.CallOption) (*ValidateKeyPackagesResponse, error) { + out := new(ValidateKeyPackagesResponse) + err := c.cc.Invoke(ctx, ValidationApi_ValidateKeyPackages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *validationApiClient) ValidateGroupMessages(ctx context.Context, in *ValidateGroupMessagesRequest, opts ...grpc.CallOption) (*ValidateGroupMessagesResponse, error) { + out := new(ValidateGroupMessagesResponse) + err := c.cc.Invoke(ctx, ValidationApi_ValidateGroupMessages_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ValidationApiServer is the server API for ValidationApi service. +// All implementations must embed UnimplementedValidationApiServer +// for forward compatibility +type ValidationApiServer interface { + // Validates and parses a batch of key packages and returns relevant details + ValidateKeyPackages(context.Context, *ValidateKeyPackagesRequest) (*ValidateKeyPackagesResponse, error) + // Validates and parses a group message and returns relevant details + ValidateGroupMessages(context.Context, *ValidateGroupMessagesRequest) (*ValidateGroupMessagesResponse, error) + mustEmbedUnimplementedValidationApiServer() +} + +// UnimplementedValidationApiServer must be embedded to have forward compatible implementations. +type UnimplementedValidationApiServer struct { +} + +func (UnimplementedValidationApiServer) ValidateKeyPackages(context.Context, *ValidateKeyPackagesRequest) (*ValidateKeyPackagesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateKeyPackages not implemented") +} +func (UnimplementedValidationApiServer) ValidateGroupMessages(context.Context, *ValidateGroupMessagesRequest) (*ValidateGroupMessagesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateGroupMessages not implemented") +} +func (UnimplementedValidationApiServer) mustEmbedUnimplementedValidationApiServer() {} + +// UnsafeValidationApiServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ValidationApiServer will +// result in compilation errors. +type UnsafeValidationApiServer interface { + mustEmbedUnimplementedValidationApiServer() +} + +func RegisterValidationApiServer(s grpc.ServiceRegistrar, srv ValidationApiServer) { + s.RegisterService(&ValidationApi_ServiceDesc, srv) +} + +func _ValidationApi_ValidateKeyPackages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateKeyPackagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidationApiServer).ValidateKeyPackages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ValidationApi_ValidateKeyPackages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidationApiServer).ValidateKeyPackages(ctx, req.(*ValidateKeyPackagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ValidationApi_ValidateGroupMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateGroupMessagesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ValidationApiServer).ValidateGroupMessages(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ValidationApi_ValidateGroupMessages_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ValidationApiServer).ValidateGroupMessages(ctx, req.(*ValidateGroupMessagesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ValidationApi_ServiceDesc is the grpc.ServiceDesc for ValidationApi service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ValidationApi_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "xmtp.mls_validation.v1.ValidationApi", + HandlerType: (*ValidationApiServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ValidateKeyPackages", + Handler: _ValidationApi_ValidateKeyPackages_Handler, + }, + { + MethodName: "ValidateGroupMessages", + Handler: _ValidationApi_ValidateGroupMessages_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "mls_validation/v1/service.proto", +} diff --git a/pkg/proto/openapi/keystore_api/v1/keystore.swagger.json b/pkg/proto/openapi/keystore_api/v1/keystore.swagger.json new file mode 100644 index 00000000..a1d03007 --- /dev/null +++ b/pkg/proto/openapi/keystore_api/v1/keystore.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "keystore_api/v1/keystore.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_api/v1/authn.swagger.json b/pkg/proto/openapi/message_api/v1/authn.swagger.json new file mode 100644 index 00000000..ab7feabf --- /dev/null +++ b/pkg/proto/openapi/message_api/v1/authn.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_api/v1/authn.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_api/v1/message_api.swagger.json b/pkg/proto/openapi/message_api/v1/message_api.swagger.json new file mode 100644 index 00000000..8422b003 --- /dev/null +++ b/pkg/proto/openapi/message_api/v1/message_api.swagger.json @@ -0,0 +1,400 @@ +{ + "swagger": "2.0", + "info": { + "title": "MessageApi", + "version": "1.0" + }, + "tags": [ + { + "name": "MessageApi" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/message/v1/batch-query": { + "post": { + "summary": "BatchQuery containing a set of queries to be processed", + "operationId": "MessageApi_BatchQuery", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1BatchQueryResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1BatchQueryRequest" + } + } + ], + "tags": [ + "MessageApi" + ] + } + }, + "/message/v1/publish": { + "post": { + "summary": "Publish messages to the network", + "operationId": "MessageApi_Publish", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PublishResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1PublishRequest" + } + } + ], + "tags": [ + "MessageApi" + ] + } + }, + "/message/v1/query": { + "post": { + "summary": "Query the store for messages", + "operationId": "MessageApi_Query", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1QueryResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1QueryRequest" + } + } + ], + "tags": [ + "MessageApi" + ] + } + }, + "/message/v1/subscribe": { + "post": { + "summary": "Subscribe to a stream of new envelopes matching a predicate", + "operationId": "MessageApi_Subscribe", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/v1Envelope" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of v1Envelope" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SubscribeRequest" + } + } + ], + "tags": [ + "MessageApi" + ] + } + }, + "/message/v1/subscribe-all": { + "post": { + "summary": "Subscribe to a stream of all messages", + "operationId": "MessageApi_SubscribeAll", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/v1Envelope" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of v1Envelope" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SubscribeAllRequest" + } + } + ], + "tags": [ + "MessageApi" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1BatchQueryRequest": { + "type": "object", + "properties": { + "requests": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QueryRequest" + } + } + }, + "title": "BatchQuery" + }, + "v1BatchQueryResponse": { + "type": "object", + "properties": { + "responses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1QueryResponse" + } + } + }, + "title": "Response containing a list of QueryResponse messages" + }, + "v1Cursor": { + "type": "object", + "properties": { + "index": { + "$ref": "#/definitions/v1IndexCursor" + } + }, + "title": "Wrapper for potentially multiple types of cursor" + }, + "v1Envelope": { + "type": "object", + "properties": { + "contentTopic": { + "type": "string", + "description": "The topic the message belongs to,\nIf the message includes the topic as well\nit MUST be the same as the topic in the envelope." + }, + "timestampNs": { + "type": "string", + "format": "uint64", + "description": "Message creation timestamp\nIf the message includes the timestamp as well\nit MUST be equivalent to the timestamp in the envelope." + }, + "message": { + "type": "string", + "format": "byte" + } + }, + "description": "Envelope encapsulates a message while in transit." + }, + "v1IndexCursor": { + "type": "object", + "properties": { + "digest": { + "type": "string", + "format": "byte" + }, + "senderTimeNs": { + "type": "string", + "format": "uint64" + } + }, + "title": "This is based off of the go-waku Index type, but with the\nreceiverTime and pubsubTopic removed for simplicity.\nBoth removed fields are optional" + }, + "v1PublishRequest": { + "type": "object", + "properties": { + "envelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Envelope" + } + } + }, + "title": "Publish" + }, + "v1PublishResponse": { + "type": "object", + "title": "Empty message as a response for Publish" + }, + "v1QueryRequest": { + "type": "object", + "properties": { + "contentTopics": { + "type": "array", + "items": { + "type": "string" + } + }, + "startTimeNs": { + "type": "string", + "format": "uint64" + }, + "endTimeNs": { + "type": "string", + "format": "uint64" + }, + "pagingInfo": { + "$ref": "#/definitions/xmtpmessage_apiv1PagingInfo" + } + }, + "title": "Query" + }, + "v1QueryResponse": { + "type": "object", + "properties": { + "envelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Envelope" + } + }, + "pagingInfo": { + "$ref": "#/definitions/xmtpmessage_apiv1PagingInfo" + } + }, + "title": "The response, containing envelopes, for a query" + }, + "v1SubscribeAllRequest": { + "type": "object", + "title": "SubscribeAll" + }, + "v1SubscribeRequest": { + "type": "object", + "properties": { + "contentTopics": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "Subscribe" + }, + "xmtpmessage_apiv1PagingInfo": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int64", + "title": "Note: this is a uint32, while go-waku's pageSize is a uint64" + }, + "cursor": { + "$ref": "#/definitions/v1Cursor" + }, + "direction": { + "$ref": "#/definitions/xmtpmessage_apiv1SortDirection" + } + }, + "title": "This is based off of the go-waku PagingInfo struct, but with the direction\nchanged to our SortDirection enum format" + }, + "xmtpmessage_apiv1SortDirection": { + "type": "string", + "enum": [ + "SORT_DIRECTION_UNSPECIFIED", + "SORT_DIRECTION_ASCENDING", + "SORT_DIRECTION_DESCENDING" + ], + "default": "SORT_DIRECTION_UNSPECIFIED", + "title": "Sort direction" + } + } +} diff --git a/pkg/proto/openapi/message_contents/ciphertext.swagger.json b/pkg/proto/openapi/message_contents/ciphertext.swagger.json new file mode 100644 index 00000000..061e4559 --- /dev/null +++ b/pkg/proto/openapi/message_contents/ciphertext.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/ciphertext.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/composite.swagger.json b/pkg/proto/openapi/message_contents/composite.swagger.json new file mode 100644 index 00000000..52a4d560 --- /dev/null +++ b/pkg/proto/openapi/message_contents/composite.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/composite.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/contact.swagger.json b/pkg/proto/openapi/message_contents/contact.swagger.json new file mode 100644 index 00000000..68c1467f --- /dev/null +++ b/pkg/proto/openapi/message_contents/contact.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/contact.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/content.swagger.json b/pkg/proto/openapi/message_contents/content.swagger.json new file mode 100644 index 00000000..fbc56136 --- /dev/null +++ b/pkg/proto/openapi/message_contents/content.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/content.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/conversation_reference.swagger.json b/pkg/proto/openapi/message_contents/conversation_reference.swagger.json new file mode 100644 index 00000000..a8e15980 --- /dev/null +++ b/pkg/proto/openapi/message_contents/conversation_reference.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/conversation_reference.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/ecies.swagger.json b/pkg/proto/openapi/message_contents/ecies.swagger.json new file mode 100644 index 00000000..0fa331aa --- /dev/null +++ b/pkg/proto/openapi/message_contents/ecies.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/ecies.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/invitation.swagger.json b/pkg/proto/openapi/message_contents/invitation.swagger.json new file mode 100644 index 00000000..2e79efcc --- /dev/null +++ b/pkg/proto/openapi/message_contents/invitation.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/invitation.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/message.swagger.json b/pkg/proto/openapi/message_contents/message.swagger.json new file mode 100644 index 00000000..550e2736 --- /dev/null +++ b/pkg/proto/openapi/message_contents/message.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/message.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/private_key.swagger.json b/pkg/proto/openapi/message_contents/private_key.swagger.json new file mode 100644 index 00000000..0470b530 --- /dev/null +++ b/pkg/proto/openapi/message_contents/private_key.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/private_key.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/private_preferences.swagger.json b/pkg/proto/openapi/message_contents/private_preferences.swagger.json new file mode 100644 index 00000000..cb316790 --- /dev/null +++ b/pkg/proto/openapi/message_contents/private_preferences.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/private_preferences.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/public_key.swagger.json b/pkg/proto/openapi/message_contents/public_key.swagger.json new file mode 100644 index 00000000..74f4511d --- /dev/null +++ b/pkg/proto/openapi/message_contents/public_key.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/public_key.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/signature.swagger.json b/pkg/proto/openapi/message_contents/signature.swagger.json new file mode 100644 index 00000000..438e408e --- /dev/null +++ b/pkg/proto/openapi/message_contents/signature.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/signature.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/message_contents/signed_payload.swagger.json b/pkg/proto/openapi/message_contents/signed_payload.swagger.json new file mode 100644 index 00000000..e75dcbb1 --- /dev/null +++ b/pkg/proto/openapi/message_contents/signed_payload.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "message_contents/signed_payload.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls/api/v1/mls.swagger.json b/pkg/proto/openapi/mls/api/v1/mls.swagger.json new file mode 100644 index 00000000..9fe72050 --- /dev/null +++ b/pkg/proto/openapi/mls/api/v1/mls.swagger.json @@ -0,0 +1,925 @@ +{ + "swagger": "2.0", + "info": { + "title": "MlsApi", + "version": "1.0" + }, + "tags": [ + { + "name": "MlsApi" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/mls/v1/fetch-key-packages": { + "post": { + "summary": "Get one or more Key Packages by installation_id", + "operationId": "MlsApi_FetchKeyPackages", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FetchKeyPackagesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1FetchKeyPackagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/get-identity-updates": { + "post": { + "summary": "Used to check for changes related to members of a group.\nWould return an array of any new installations associated with the wallet\naddress, and any revocations that have happened.", + "operationId": "MlsApi_GetIdentityUpdates", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetIdentityUpdatesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetIdentityUpdatesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/query-group-messages": { + "post": { + "summary": "Query stored group messages", + "operationId": "MlsApi_QueryGroupMessages", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1QueryGroupMessagesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1QueryGroupMessagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/query-welcome-messages": { + "post": { + "summary": "Query stored group messages", + "operationId": "MlsApi_QueryWelcomeMessages", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1QueryWelcomeMessagesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1QueryWelcomeMessagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/register-installation": { + "post": { + "summary": "Register a new installation, which would be validated before storage", + "operationId": "MlsApi_RegisterInstallation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RegisterInstallationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RegisterInstallationRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/revoke-installation": { + "post": { + "summary": "Would delete all key packages associated with the installation and mark\nthe installation as having been revoked", + "operationId": "MlsApi_RevokeInstallation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": {} + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RevokeInstallationRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/send-group-messages": { + "post": { + "summary": "Send a MLS payload, that would be validated before being stored to the\nnetwork", + "operationId": "MlsApi_SendGroupMessages", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": {} + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SendGroupMessagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/send-welcome-messages": { + "post": { + "summary": "Send a batch of welcome messages", + "operationId": "MlsApi_SendWelcomeMessages", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": {} + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SendWelcomeMessagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/subscribe-group-messages": { + "post": { + "summary": "Subscribe stream of new group messages", + "operationId": "MlsApi_SubscribeGroupMessages", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/apiv1GroupMessage" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of apiv1GroupMessage" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SubscribeGroupMessagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/subscribe-welcome-messages": { + "post": { + "summary": "Subscribe stream of new welcome messages", + "operationId": "MlsApi_SubscribeWelcomeMessages", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/v1WelcomeMessage" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of v1WelcomeMessage" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SubscribeWelcomeMessagesRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + }, + "/mls/v1/upload-key-package": { + "post": { + "summary": "Upload a new KeyPackage, which would be validated before storage", + "operationId": "MlsApi_UploadKeyPackage", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": {} + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UploadKeyPackageRequest" + } + } + ], + "tags": [ + "MlsApi" + ] + } + } + }, + "definitions": { + "GetIdentityUpdatesResponseNewInstallationUpdate": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + }, + "credentialIdentity": { + "type": "string", + "format": "byte" + } + }, + "title": "A new installation key was seen for the first time by the nodes" + }, + "GetIdentityUpdatesResponseRevokedInstallationUpdate": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + } + }, + "title": "An installation was revoked" + }, + "GetIdentityUpdatesResponseUpdate": { + "type": "object", + "properties": { + "timestampNs": { + "type": "string", + "format": "uint64" + }, + "newInstallation": { + "$ref": "#/definitions/GetIdentityUpdatesResponseNewInstallationUpdate" + }, + "revokedInstallation": { + "$ref": "#/definitions/GetIdentityUpdatesResponseRevokedInstallationUpdate" + } + }, + "title": "A wrapper for any update to the wallet" + }, + "GetIdentityUpdatesResponseWalletUpdates": { + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/GetIdentityUpdatesResponseUpdate" + } + } + }, + "title": "A wrapper for the updates for a single wallet" + }, + "SignatureECDSACompact": { + "type": "object", + "properties": { + "bytes": { + "type": "string", + "format": "byte", + "title": "compact representation [ R || S ], 64 bytes" + }, + "recovery": { + "type": "integer", + "format": "int64", + "title": "recovery bit" + } + }, + "title": "ECDSA signature bytes and the recovery bit" + }, + "SignatureWalletECDSACompact": { + "type": "object", + "properties": { + "bytes": { + "type": "string", + "format": "byte", + "title": "compact representation [ R || S ], 64 bytes" + }, + "recovery": { + "type": "integer", + "format": "int64", + "title": "recovery bit" + } + }, + "description": "ECDSA signature bytes and the recovery bit\nproduced by xmtp-js::PublicKey.signWithWallet function, i.e.\nEIP-191 signature of a \"Create Identity\" message with the key embedded.\nUsed to sign identity keys." + }, + "apiv1GroupMessage": { + "type": "object", + "properties": { + "v1": { + "$ref": "#/definitions/v1GroupMessageV1" + } + }, + "title": "Full representation of a group message" + }, + "message_contentsSignature": { + "type": "object", + "properties": { + "ecdsaCompact": { + "$ref": "#/definitions/SignatureECDSACompact" + }, + "walletEcdsaCompact": { + "$ref": "#/definitions/SignatureWalletECDSACompact" + } + }, + "description": "Signature represents a generalized public key signature,\ndefined as a union to support cryptographic algorithm agility." + }, + "mlsapiv1PagingInfo": { + "type": "object", + "properties": { + "direction": { + "$ref": "#/definitions/mlsapiv1SortDirection" + }, + "limit": { + "type": "integer", + "format": "int64" + }, + "idCursor": { + "type": "string", + "format": "uint64" + } + }, + "title": "Pagination config for queries" + }, + "mlsapiv1SortDirection": { + "type": "string", + "enum": [ + "SORT_DIRECTION_UNSPECIFIED", + "SORT_DIRECTION_ASCENDING", + "SORT_DIRECTION_DESCENDING" + ], + "default": "SORT_DIRECTION_UNSPECIFIED", + "title": "Sort direction for queries" + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1FetchKeyPackagesRequest": { + "type": "object", + "properties": { + "installationKeys": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + }, + "title": "The caller can provide an array of installation keys, and the API\nwill return one key package for each installation associated with each\ninstallation key" + } + }, + "title": "Fetch one or more key packages" + }, + "v1FetchKeyPackagesResponse": { + "type": "object", + "properties": { + "keyPackages": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1FetchKeyPackagesResponseKeyPackage" + }, + "description": "Returns one key package per installation in the original order of the\nrequest. If any installations are missing key packages, an empty entry is\nleft in their respective spots in the array." + } + }, + "title": "The response to a FetchKeyPackagesRequest" + }, + "v1FetchKeyPackagesResponseKeyPackage": { + "type": "object", + "properties": { + "keyPackageTlsSerialized": { + "type": "string", + "format": "byte" + } + }, + "title": "An individual key package" + }, + "v1GetIdentityUpdatesRequest": { + "type": "object", + "properties": { + "accountAddresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "startTimeNs": { + "type": "string", + "format": "uint64" + } + }, + "title": "Get all updates for an identity since the specified time" + }, + "v1GetIdentityUpdatesResponse": { + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/GetIdentityUpdatesResponseWalletUpdates" + }, + "title": "A list of updates (or empty objects if no changes) in the original order\nof the request" + } + }, + "title": "Used to get any new or revoked installations for a list of wallet addresses" + }, + "v1GroupMessageInput": { + "type": "object", + "properties": { + "v1": { + "$ref": "#/definitions/v1GroupMessageInputV1" + } + }, + "title": "Input type for a group message" + }, + "v1GroupMessageInputV1": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte" + } + }, + "title": "Version 1 of the GroupMessageInput payload format" + }, + "v1GroupMessageV1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uint64" + }, + "createdNs": { + "type": "string", + "format": "uint64" + }, + "groupId": { + "type": "string", + "format": "byte" + }, + "data": { + "type": "string", + "format": "byte" + } + }, + "title": "Version 1 of the GroupMessage format" + }, + "v1KeyPackageUpload": { + "type": "object", + "properties": { + "keyPackageTlsSerialized": { + "type": "string", + "format": "byte", + "description": "The owner's wallet address would be extracted from the identity\ncredential in the key package, and all signatures would be validated." + } + }, + "description": "This would be a serialized MLS key package that the node would\n parse, validate, and then store.", + "title": "A wrapper around the Key Package bytes" + }, + "v1QueryGroupMessagesRequest": { + "type": "object", + "properties": { + "groupId": { + "type": "string", + "format": "byte" + }, + "pagingInfo": { + "$ref": "#/definitions/mlsapiv1PagingInfo" + } + }, + "title": "Request for group message queries" + }, + "v1QueryGroupMessagesResponse": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiv1GroupMessage" + } + }, + "pagingInfo": { + "$ref": "#/definitions/mlsapiv1PagingInfo" + } + }, + "title": "Response for group message queries" + }, + "v1QueryWelcomeMessagesRequest": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + }, + "pagingInfo": { + "$ref": "#/definitions/mlsapiv1PagingInfo" + } + }, + "title": "Request for welcome message queries" + }, + "v1QueryWelcomeMessagesResponse": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WelcomeMessage" + } + }, + "pagingInfo": { + "$ref": "#/definitions/mlsapiv1PagingInfo" + } + }, + "title": "Response for welcome message queries" + }, + "v1RegisterInstallationRequest": { + "type": "object", + "properties": { + "keyPackage": { + "$ref": "#/definitions/v1KeyPackageUpload", + "title": "The Key Package contains all information needed to register an installation" + } + }, + "title": "Register a new installation" + }, + "v1RegisterInstallationResponse": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + } + }, + "title": "The response to a RegisterInstallationRequest" + }, + "v1RevokeInstallationRequest": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + }, + "walletSignature": { + "$ref": "#/definitions/message_contentsSignature", + "title": "All revocations must be validated with a wallet signature over the\ninstallation_id being revoked (and some sort of standard prologue)" + } + }, + "title": "Revoke an installation" + }, + "v1SendGroupMessagesRequest": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1GroupMessageInput" + } + } + }, + "title": "Send a batch of MLS messages" + }, + "v1SendWelcomeMessagesRequest": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WelcomeMessageInput" + } + } + }, + "title": "Send a batch of welcome messages" + }, + "v1SubscribeGroupMessagesRequest": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SubscribeGroupMessagesRequestFilter" + } + } + }, + "title": "Request for subscribing to group messages" + }, + "v1SubscribeGroupMessagesRequestFilter": { + "type": "object", + "properties": { + "groupId": { + "type": "string", + "format": "byte" + }, + "idCursor": { + "type": "string", + "format": "uint64" + } + }, + "title": "Subscription filter" + }, + "v1SubscribeWelcomeMessagesRequest": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SubscribeWelcomeMessagesRequestFilter" + } + } + }, + "title": "Request for subscribing to welcome messages" + }, + "v1SubscribeWelcomeMessagesRequestFilter": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + }, + "idCursor": { + "type": "string", + "format": "uint64" + } + }, + "title": "Subscription filter" + }, + "v1UploadKeyPackageRequest": { + "type": "object", + "properties": { + "keyPackage": { + "$ref": "#/definitions/v1KeyPackageUpload", + "title": "An individual key package upload request" + } + }, + "title": "Upload a new key packages" + }, + "v1WelcomeMessage": { + "type": "object", + "properties": { + "v1": { + "$ref": "#/definitions/v1WelcomeMessageV1" + } + }, + "title": "Full representation of a welcome message" + }, + "v1WelcomeMessageInput": { + "type": "object", + "properties": { + "v1": { + "$ref": "#/definitions/v1WelcomeMessageInputV1" + } + }, + "title": "Input type for a welcome message" + }, + "v1WelcomeMessageInputV1": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + }, + "data": { + "type": "string", + "format": "byte" + } + }, + "title": "Version 1 of the WelcomeMessageInput format" + }, + "v1WelcomeMessageV1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uint64" + }, + "createdNs": { + "type": "string", + "format": "uint64" + }, + "installationKey": { + "type": "string", + "format": "byte" + }, + "data": { + "type": "string", + "format": "byte" + } + }, + "title": "Version 1 of the WelcomeMessage format" + } + } +} diff --git a/pkg/proto/openapi/mls/database/intents.swagger.json b/pkg/proto/openapi/mls/database/intents.swagger.json new file mode 100644 index 00000000..fe25a98f --- /dev/null +++ b/pkg/proto/openapi/mls/database/intents.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls/database/intents.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls/message_contents/association.swagger.json b/pkg/proto/openapi/mls/message_contents/association.swagger.json new file mode 100644 index 00000000..775a7ac8 --- /dev/null +++ b/pkg/proto/openapi/mls/message_contents/association.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls/message_contents/association.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls/message_contents/content.swagger.json b/pkg/proto/openapi/mls/message_contents/content.swagger.json new file mode 100644 index 00000000..19b2b0c6 --- /dev/null +++ b/pkg/proto/openapi/mls/message_contents/content.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls/message_contents/content.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls/message_contents/credential.swagger.json b/pkg/proto/openapi/mls/message_contents/credential.swagger.json new file mode 100644 index 00000000..781e3809 --- /dev/null +++ b/pkg/proto/openapi/mls/message_contents/credential.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls/message_contents/credential.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls/message_contents/group_metadata.swagger.json b/pkg/proto/openapi/mls/message_contents/group_metadata.swagger.json new file mode 100644 index 00000000..70c1998d --- /dev/null +++ b/pkg/proto/openapi/mls/message_contents/group_metadata.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls/message_contents/group_metadata.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls/message_contents/transcript_messages.swagger.json b/pkg/proto/openapi/mls/message_contents/transcript_messages.swagger.json new file mode 100644 index 00000000..1b8d1742 --- /dev/null +++ b/pkg/proto/openapi/mls/message_contents/transcript_messages.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls/message_contents/transcript_messages.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/mls_validation/v1/service.swagger.json b/pkg/proto/openapi/mls_validation/v1/service.swagger.json new file mode 100644 index 00000000..9a0048c7 --- /dev/null +++ b/pkg/proto/openapi/mls_validation/v1/service.swagger.json @@ -0,0 +1,137 @@ +{ + "swagger": "2.0", + "info": { + "title": "mls_validation/v1/service.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "ValidationApi" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1ValidateGroupMessagesRequestGroupMessage": { + "type": "object", + "properties": { + "groupMessageBytesTlsSerialized": { + "type": "string", + "format": "byte" + } + }, + "title": "Wrapper for each message" + }, + "v1ValidateGroupMessagesResponse": { + "type": "object", + "properties": { + "responses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ValidateGroupMessagesResponseValidationResponse" + } + } + }, + "title": "Response to ValidateGroupMessagesRequest" + }, + "v1ValidateGroupMessagesResponseValidationResponse": { + "type": "object", + "properties": { + "isOk": { + "type": "boolean" + }, + "errorMessage": { + "type": "string" + }, + "groupId": { + "type": "string" + } + }, + "title": "An individual response to one message" + }, + "v1ValidateKeyPackagesRequestKeyPackage": { + "type": "object", + "properties": { + "keyPackageBytesTlsSerialized": { + "type": "string", + "format": "byte" + } + }, + "title": "Wrapper for each key package" + }, + "v1ValidateKeyPackagesResponse": { + "type": "object", + "properties": { + "responses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ValidateKeyPackagesResponseValidationResponse" + } + } + }, + "title": "Response to ValidateKeyPackagesRequest" + }, + "v1ValidateKeyPackagesResponseValidationResponse": { + "type": "object", + "properties": { + "isOk": { + "type": "boolean" + }, + "errorMessage": { + "type": "string" + }, + "installationId": { + "type": "string", + "format": "byte" + }, + "accountAddress": { + "type": "string" + }, + "credentialIdentityBytes": { + "type": "string", + "format": "byte" + }, + "expiration": { + "type": "string", + "format": "uint64" + } + }, + "title": "An individual response to one key package" + } + } +} diff --git a/pkg/proto/openapi/openapi.go b/pkg/proto/openapi/openapi.go new file mode 100644 index 00000000..1cf197ad --- /dev/null +++ b/pkg/proto/openapi/openapi.go @@ -0,0 +1,8 @@ +package openapi + +import ( + _ "embed" +) + +//go:embed message_api/v1/message_api.swagger.json +var JSON []byte diff --git a/pkg/store/cleaner_test.go b/pkg/store/cleaner_test.go index 300b2e1d..a44039ed 100644 --- a/pkg/store/cleaner_test.go +++ b/pkg/store/cleaner_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/stretchr/testify/require" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" test "github.com/xmtp/xmtp-node-go/pkg/testing" ) diff --git a/pkg/store/query.go b/pkg/store/query.go index d668be87..ca08fc39 100644 --- a/pkg/store/query.go +++ b/pkg/store/query.go @@ -5,7 +5,7 @@ import ( "database/sql" sqlBuilder "github.com/huandu/go-sqlbuilder" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" ) func (s *Store) Query(query *messagev1.QueryRequest) (res *messagev1.QueryResponse, err error) { diff --git a/pkg/store/query_test.go b/pkg/store/query_test.go index 5d084e4a..ff7fcd42 100644 --- a/pkg/store/query_test.go +++ b/pkg/store/query_test.go @@ -6,7 +6,7 @@ import ( _ "github.com/mattn/go-sqlite3" // Blank import to register the sqlite3 driver "github.com/stretchr/testify/require" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" test "github.com/xmtp/xmtp-node-go/pkg/testing" ) diff --git a/pkg/store/store.go b/pkg/store/store.go index 71e17d9a..20315483 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -10,10 +10,10 @@ import ( "github.com/uptrace/bun/dialect/pgdialect" "github.com/uptrace/bun/driver/pgdriver" "github.com/uptrace/bun/migrate" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/logging" "github.com/xmtp/xmtp-node-go/pkg/metrics" "github.com/xmtp/xmtp-node-go/pkg/migrations/messages" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" "github.com/xmtp/xmtp-node-go/pkg/tracing" "go.uber.org/zap" ) diff --git a/pkg/store/store_test.go b/pkg/store/store_test.go index cd71c420..b3adad2d 100644 --- a/pkg/store/store_test.go +++ b/pkg/store/store_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/require" - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" test "github.com/xmtp/xmtp-node-go/pkg/testing" ) diff --git a/pkg/testing/message.go b/pkg/testing/message.go index 8340dc85..7efe9169 100644 --- a/pkg/testing/message.go +++ b/pkg/testing/message.go @@ -1,7 +1,7 @@ package testing import ( - messagev1 "github.com/xmtp/proto/v3/go/message_api/v1" + messagev1 "github.com/xmtp/xmtp-node-go/pkg/proto/message_api/v1" ) func NewEnvelope(contentTopic string, timestamp uint64, content string) *messagev1.Envelope { From c67cf484c06fced175c97cddf7bd2627d5087ef0 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:03:07 -0800 Subject: [PATCH 10/20] Update protos --- pkg/proto/mls/api/v1/mls.pb.go | 699 +++++++++--------- pkg/proto/openapi/mls/api/v1/mls.swagger.json | 16 + 2 files changed, 386 insertions(+), 329 deletions(-) diff --git a/pkg/proto/mls/api/v1/mls.pb.go b/pkg/proto/mls/api/v1/mls.pb.go index 6b02d3a8..b1e3dc06 100644 --- a/pkg/proto/mls/api/v1/mls.pb.go +++ b/pkg/proto/mls/api/v1/mls.pb.go @@ -1300,6 +1300,7 @@ type WelcomeMessage_V1 struct { CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` InstallationKey []byte `protobuf:"bytes,3,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + HpkePublicKey []byte `protobuf:"bytes,5,opt,name=hpke_public_key,json=hpkePublicKey,proto3" json:"hpke_public_key,omitempty"` } func (x *WelcomeMessage_V1) Reset() { @@ -1362,6 +1363,13 @@ func (x *WelcomeMessage_V1) GetData() []byte { return nil } +func (x *WelcomeMessage_V1) GetHpkePublicKey() []byte { + if x != nil { + return x.HpkePublicKey + } + return nil +} + // Version 1 of the WelcomeMessageInput format type WelcomeMessageInput_V1 struct { state protoimpl.MessageState @@ -1370,6 +1378,7 @@ type WelcomeMessageInput_V1 struct { InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + HpkePublicKey []byte `protobuf:"bytes,3,opt,name=hpke_public_key,json=hpkePublicKey,proto3" json:"hpke_public_key,omitempty"` } func (x *WelcomeMessageInput_V1) Reset() { @@ -1418,16 +1427,24 @@ func (x *WelcomeMessageInput_V1) GetData() []byte { return nil } +func (x *WelcomeMessageInput_V1) GetHpkePublicKey() []byte { + if x != nil { + return x.HpkePublicKey + } + return nil +} + // Version 1 of the GroupMessage format type GroupMessage_V1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` - GroupId []byte `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedNs uint64 `protobuf:"varint,2,opt,name=created_ns,json=createdNs,proto3" json:"created_ns,omitempty"` + GroupId []byte `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + SenderHmac []byte `protobuf:"bytes,5,opt,name=sender_hmac,json=senderHmac,proto3" json:"sender_hmac,omitempty"` } func (x *GroupMessage_V1) Reset() { @@ -1490,13 +1507,21 @@ func (x *GroupMessage_V1) GetData() []byte { return nil } +func (x *GroupMessage_V1) GetSenderHmac() []byte { + if x != nil { + return x.SenderHmac + } + return nil +} + // Version 1 of the GroupMessageInput payload format type GroupMessageInput_V1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + SenderHmac []byte `protobuf:"bytes,2,opt,name=sender_hmac,json=senderHmac,proto3" json:"sender_hmac,omitempty"` } func (x *GroupMessageInput_V1) Reset() { @@ -1538,6 +1563,13 @@ func (x *GroupMessageInput_V1) GetData() []byte { return nil } +func (x *GroupMessageInput_V1) GetSenderHmac() []byte { + if x != nil { + return x.SenderHmac + } + return nil +} + // An individual key package type FetchKeyPackagesResponse_KeyPackage struct { state protoimpl.MessageState @@ -1956,346 +1988,355 @@ var file_mls_api_v1_mls_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x0e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x01, 0x0a, 0x0e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x72, 0x0a, - 0x02, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x4e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa0, 0x01, 0x0a, - 0x13, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x12, 0x39, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, - 0x43, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0xb1, 0x01, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x32, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x31, 0x48, 0x00, - 0x52, 0x02, 0x76, 0x31, 0x1a, 0x62, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, - 0x31, 0x1a, 0x18, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x18, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x1a, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, - 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x10, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x6b, 0x65, 0x79, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, - 0x7a, 0x65, 0x64, 0x22, 0x61, 0x0a, 0x1b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, - 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0x49, 0x0a, 0x1c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, - 0x79, 0x22, 0x5d, 0x0a, 0x17, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0b, - 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x22, 0x46, 0x0a, 0x17, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xbe, 0x01, 0x0a, 0x18, 0x46, 0x65, 0x74, - 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, - 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x1a, 0x49, - 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x1a, - 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, - 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x17, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x6c, 0x73, 0x53, - 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x19, 0x52, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, - 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x10, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, - 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0x6c, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x73, 0x22, 0xaf, 0x05, - 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x07, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x9a, 0x01, + 0x0a, 0x02, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x4e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0f, 0x68, 0x70, 0x6b, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x68, 0x70, 0x6b, + 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc8, 0x01, 0x0a, 0x13, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x39, 0x0a, + 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, + 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, + 0x56, 0x31, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x6b, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x29, + 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x26, 0x0a, + 0x0f, 0x68, 0x70, 0x6b, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x68, 0x70, 0x6b, 0x65, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x22, 0xd3, 0x01, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x32, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x1a, 0x73, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x46, 0x0a, 0x19, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, - 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x9f, - 0x02, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x73, 0x12, 0x6e, 0x0a, 0x10, - 0x6e, 0x65, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x65, 0x77, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x6e, 0x65, 0x77, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x0a, 0x14, - 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, - 0x1a, 0x5d, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x22, - 0x7d, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, - 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x74, - 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, - 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, - 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x3c, - 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x86, 0x01, 0x0a, - 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x31, 0x48, + 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x83, 0x01, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x6d, 0x61, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x6d, 0x61, 0x63, 0x42, 0x09, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x37, 0x0a, 0x02, + 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x56, 0x31, 0x48, + 0x00, 0x52, 0x02, 0x76, 0x31, 0x1a, 0x39, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x6d, 0x61, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x6d, 0x61, 0x63, + 0x42, 0x09, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x18, 0x53, + 0x65, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x1a, 0x53, 0x65, 0x6e, 0x64, 0x57, + 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x10, 0x4b, 0x65, 0x79, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x6b, + 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x17, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x6c, 0x73, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x61, 0x0a, 0x1b, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x0a, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0x49, 0x0a, 0x1c, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x22, 0x5d, 0x0a, 0x17, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0x46, 0x0a, 0x17, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, + 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xbe, 0x01, + 0x0a, 0x18, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x6b, 0x65, + 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x34, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x73, 0x1a, 0x49, 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x54, 0x6c, 0x73, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x93, + 0x01, 0x0a, 0x19, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, - 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, - 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x10, 0x77, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x52, 0x0f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x22, 0x6c, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x22, + 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x4e, 0x73, 0x22, 0xaf, 0x05, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x53, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x07, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x73, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x46, 0x0a, 0x19, 0x52, + 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x1a, 0x9f, 0x02, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, + 0x73, 0x12, 0x6e, 0x0a, 0x10, 0x6e, 0x65, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x65, 0x77, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, + 0x52, 0x0f, 0x6e, 0x65, 0x77, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x7a, 0x0a, 0x14, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x45, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, + 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x1a, 0x5d, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, + 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x22, 0x7d, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, 0x72, + 0x73, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, 0x72, + 0x73, 0x6f, 0x72, 0x22, 0x74, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x0b, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x1a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, - 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x19, - 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, - 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, - 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0xc6, 0x01, 0x0a, 0x1f, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x07, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x50, 0x0a, - 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, - 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x2a, - 0x6c, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1d, - 0x0a, 0x19, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x32, 0xcd, 0x0c, - 0x0a, 0x06, 0x4d, 0x6c, 0x73, 0x41, 0x70, 0x69, 0x12, 0x7e, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x2e, + 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, + 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x3c, 0x0a, 0x0b, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x6e, - 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x12, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, + 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0xc6, 0x01, 0x0a, 0x1f, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x51, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x37, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, + 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x73, 0x1a, 0x50, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x64, 0x5f, 0x63, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x64, 0x43, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x2a, 0x6c, 0x0a, 0x0d, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, + 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, + 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, + 0x47, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, + 0x10, 0x02, 0x32, 0xcd, 0x0c, 0x0a, 0x06, 0x4d, 0x6c, 0x73, 0x41, 0x70, 0x69, 0x12, 0x7e, 0x0a, + 0x11, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x12, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, - 0x22, 0x1d, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2d, 0x77, - 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, - 0x9d, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, - 0x22, 0x1d, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x7b, 0x0a, 0x10, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x12, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, - 0x22, 0x1a, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x8e, 0x01, 0x0a, - 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x73, 0x12, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, - 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, - 0x2a, 0x22, 0x1a, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, - 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x80, 0x01, - 0x0a, 0x12, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, - 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x76, - 0x6f, 0x6b, 0x65, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x96, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, - 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x6d, 0x6c, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x12, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, - 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x6d, 0x74, 0x70, - 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, + 0x22, 0x1b, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x2d, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x84, 0x01, + 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, + 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x65, 0x6e, 0x64, 0x2d, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7b, 0x0a, 0x10, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, + 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x10, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, + 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, + 0x66, 0x65, 0x74, 0x63, 0x68, 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x6f, + 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x26, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x96, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, + 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, + 0x22, 0x1c, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x96, + 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, + 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, - 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2d, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, + 0x12, 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, + 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2d, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, + 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x30, + 0x01, 0x12, 0x9e, 0x01, 0x0a, 0x18, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, + 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2b, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x30, 0x01, 0x12, 0x9e, 0x01, 0x0a, - 0x18, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, - 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, - 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, - 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2d, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x77, 0x65, 0x6c, 0x63, 0x6f, - 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x30, 0x01, 0x42, 0xc9, 0x01, - 0x92, 0x41, 0x0f, 0x12, 0x0d, 0x0a, 0x06, 0x4d, 0x6c, 0x73, 0x41, 0x70, 0x69, 0x32, 0x03, 0x31, - 0x2e, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4d, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, - 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x58, - 0x4d, 0x41, 0xaa, 0x02, 0x0f, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, 0x6c, 0x73, 0x2e, 0x41, 0x70, - 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, - 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, - 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, - 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x6d, + 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, + 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, + 0x30, 0x01, 0x42, 0xc9, 0x01, 0x92, 0x41, 0x0f, 0x12, 0x0d, 0x0a, 0x06, 0x4d, 0x6c, 0x73, 0x41, + 0x70, 0x69, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4d, 0x6c, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2d, 0x6e, + 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x41, 0xaa, 0x02, 0x0f, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, + 0x6c, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x58, 0x6d, 0x74, 0x70, + 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x58, 0x6d, + 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x58, 0x6d, 0x74, 0x70, + 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/proto/openapi/mls/api/v1/mls.swagger.json b/pkg/proto/openapi/mls/api/v1/mls.swagger.json index 9fe72050..f4562acb 100644 --- a/pkg/proto/openapi/mls/api/v1/mls.swagger.json +++ b/pkg/proto/openapi/mls/api/v1/mls.swagger.json @@ -647,6 +647,10 @@ "data": { "type": "string", "format": "byte" + }, + "senderHmac": { + "type": "string", + "format": "byte" } }, "title": "Version 1 of the GroupMessageInput payload format" @@ -669,6 +673,10 @@ "data": { "type": "string", "format": "byte" + }, + "senderHmac": { + "type": "string", + "format": "byte" } }, "title": "Version 1 of the GroupMessage format" @@ -895,6 +903,10 @@ "data": { "type": "string", "format": "byte" + }, + "hpkePublicKey": { + "type": "string", + "format": "byte" } }, "title": "Version 1 of the WelcomeMessageInput format" @@ -917,6 +929,10 @@ "data": { "type": "string", "format": "byte" + }, + "hpkePublicKey": { + "type": "string", + "format": "byte" } }, "title": "Version 1 of the WelcomeMessage format" From 04e8704bfc6aaf38484022d7d8b47a85d75ef6cc Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:18:05 -0800 Subject: [PATCH 11/20] Add hpke pub key --- go.mod | 2 +- go.sum | 2 -- .../mls/20240122230601_add-hpke-key.down.sql | 4 +++ .../mls/20240122230601_add-hpke-key.up.sql | 4 +++ pkg/mls/api/v1/service.go | 2 +- pkg/mls/store/models.go | 1 + pkg/mls/store/store.go | 13 +++---- pkg/mls/store/store_test.go | 36 ++++++++++--------- 8 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 pkg/migrations/mls/20240122230601_add-hpke-key.down.sql create mode 100644 pkg/migrations/mls/20240122230601_add-hpke-key.up.sql diff --git a/go.mod b/go.mod index faead68f..8a974cf6 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,7 @@ require ( go.uber.org/mock v0.4.0 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 + google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 google.golang.org/grpc v1.53.0 google.golang.org/protobuf v1.31.0 gopkg.in/DataDog/dd-trace-go.v1 v1.40.1 @@ -177,7 +178,6 @@ require ( golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect golang.org/x/tools v0.12.1-0.20230818130535-1517d1a3ba60 // indirect golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect - google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 4c90c10e..774f616a 100644 --- a/go.sum +++ b/go.sum @@ -1146,8 +1146,6 @@ github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3 h1:wzUffJGCTBGXIDyNU+1UBu1fn2Nzo+OQzM1pLrheh58= github.com/xmtp/go-msgio v0.2.1-0.20220510223757-25a701b79cd3/go.mod h1:bJREWk+NDnZYjgLQdAi8SUWuq/5pkMme4GqiffEhUF4= -github.com/xmtp/proto/v3 v3.37.1-0.20240112125235-f02fe8d0f1a0 h1:eGNiXDTiXcXTf5ne4HACbqbHaQrVlRz2hwcn05E7v8U= -github.com/xmtp/proto/v3 v3.37.1-0.20240112125235-f02fe8d0f1a0/go.mod h1:NF2zAjtNpVIhS4tFG19g4L1tJcPZHm81oeDFXltmOiY= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yoheimuta/go-protoparser/v4 v4.6.0 h1:uvz1e9/5Ihsm4Ku8AJeDImTpirKmIxubZdSn0QJNdnw= github.com/yoheimuta/go-protoparser/v4 v4.6.0/go.mod h1:AHNNnSWnb0UoL4QgHPiOAg2BniQceFscPI5X/BZNHl8= diff --git a/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql b/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql new file mode 100644 index 00000000..4e20cfc9 --- /dev/null +++ b/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql @@ -0,0 +1,4 @@ +SET statement_timeout = 0; + +ALTER TABLE welcome_messages +REMOVE COLUMN IF EXISTS hpke_public_key BYTEA; diff --git a/pkg/migrations/mls/20240122230601_add-hpke-key.up.sql b/pkg/migrations/mls/20240122230601_add-hpke-key.up.sql new file mode 100644 index 00000000..0d3bc54b --- /dev/null +++ b/pkg/migrations/mls/20240122230601_add-hpke-key.up.sql @@ -0,0 +1,4 @@ +SET statement_timeout = 0; + +ALTER TABLE welcome_messages +ADD COLUMN hpke_public_key BYTEA; diff --git a/pkg/mls/api/v1/service.go b/pkg/mls/api/v1/service.go index 348c149c..3da8fd55 100644 --- a/pkg/mls/api/v1/service.go +++ b/pkg/mls/api/v1/service.go @@ -295,7 +295,7 @@ func (s *Service) SendWelcomeMessages(ctx context.Context, req *mlsv1.SendWelcom // TODO: Wrap this in a transaction so publishing is all or nothing for _, input := range req.Messages { - msg, err := s.store.InsertWelcomeMessage(ctx, input.GetV1().InstallationKey, input.GetV1().Data) + msg, err := s.store.InsertWelcomeMessage(ctx, input.GetV1().InstallationKey, input.GetV1().Data, input.GetV1().HpkePublicKey) if err != nil { if mlsstore.IsAlreadyExistsError(err) { continue diff --git a/pkg/mls/store/models.go b/pkg/mls/store/models.go index d9ceccea..3ee22dd2 100644 --- a/pkg/mls/store/models.go +++ b/pkg/mls/store/models.go @@ -36,4 +36,5 @@ type WelcomeMessage struct { CreatedAt time.Time `bun:",notnull"` InstallationKey []byte `bun:",notnull,type:bytea"` Data []byte `bun:",notnull,type:bytea"` + HpkePublicKey []byte `bun:",notnull,type:bytea"` } diff --git a/pkg/mls/store/store.go b/pkg/mls/store/store.go index 34d48207..5654e059 100644 --- a/pkg/mls/store/store.go +++ b/pkg/mls/store/store.go @@ -29,7 +29,7 @@ type MlsStore interface { FetchKeyPackages(ctx context.Context, installationIds [][]byte) ([]*Installation, error) GetIdentityUpdates(ctx context.Context, walletAddresses []string, startTimeNs int64) (map[string]IdentityUpdateList, error) InsertGroupMessage(ctx context.Context, groupId []byte, data []byte) (*GroupMessage, error) - InsertWelcomeMessage(ctx context.Context, installationId []byte, data []byte) (*WelcomeMessage, error) + InsertWelcomeMessage(ctx context.Context, installationId []byte, data []byte, hpkePublicKey []byte) (*WelcomeMessage, error) QueryGroupMessagesV1(ctx context.Context, query *mlsv1.QueryGroupMessagesRequest) (*mlsv1.QueryGroupMessagesResponse, error) QueryWelcomeMessagesV1(ctx context.Context, query *mlsv1.QueryWelcomeMessagesRequest) (*mlsv1.QueryWelcomeMessagesResponse, error) } @@ -193,13 +193,13 @@ func (s *Store) InsertGroupMessage(ctx context.Context, groupId []byte, data []b return &message, nil } -func (s *Store) InsertWelcomeMessage(ctx context.Context, installationId []byte, data []byte) (*WelcomeMessage, error) { +func (s *Store) InsertWelcomeMessage(ctx context.Context, installationId []byte, data []byte, hpkePublicKey []byte) (*WelcomeMessage, error) { message := WelcomeMessage{ Data: data, } var id uint64 - err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash) VALUES (?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...))).Scan(&id) + err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash, hpkePublicKey) VALUES (?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...)), hpkePublicKey).Scan(&id) if err != nil { if strings.Contains(err.Error(), "duplicate key value violates unique constraint") { return nil, NewAlreadyExistsError(err) @@ -328,9 +328,10 @@ func (s *Store) QueryWelcomeMessagesV1(ctx context.Context, req *mlsv1.QueryWelc messages = append(messages, &mlsv1.WelcomeMessage{ Version: &mlsv1.WelcomeMessage_V1_{ V1: &mlsv1.WelcomeMessage_V1{ - Id: msg.Id, - CreatedNs: uint64(msg.CreatedAt.UnixNano()), - Data: msg.Data, + Id: msg.Id, + CreatedNs: uint64(msg.CreatedAt.UnixNano()), + Data: msg.Data, + HpkePublicKey: msg.HpkePublicKey, }, }, }) diff --git a/pkg/mls/store/store_test.go b/pkg/mls/store/store_test.go index 9f196110..379584f0 100644 --- a/pkg/mls/store/store_test.go +++ b/pkg/mls/store/store_test.go @@ -237,13 +237,14 @@ func TestInsertWelcomeMessage_Single(t *testing.T) { defer cleanup() ctx := context.Background() - msg, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data")) + msg, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data"), []byte("hpke")) require.NoError(t, err) require.NotNil(t, msg) require.Equal(t, uint64(1), msg.Id) require.True(t, msg.CreatedAt.Before(time.Now().UTC()) && msg.CreatedAt.After(started)) require.Equal(t, []byte("installation"), msg.InstallationKey) require.Equal(t, []byte("data"), msg.Data) + require.Equal(t, []byte("hpke"), msg.HpkePublicKey) msgs := make([]*WelcomeMessage, 0) err = store.db.NewSelect().Model(&msgs).Scan(ctx) @@ -257,11 +258,11 @@ func TestInsertWelcomeMessage_Duplicate(t *testing.T) { defer cleanup() ctx := context.Background() - msg, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data")) + msg, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data"), []byte("hpke")) require.NoError(t, err) require.NotNil(t, msg) - msg, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data")) + msg, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data"), []byte("hpke")) require.Nil(t, msg) require.IsType(t, &AlreadyExistsError{}, err) require.True(t, IsAlreadyExistsError(err)) @@ -272,11 +273,11 @@ func TestInsertWelcomeMessage_ManyOrderedByTime(t *testing.T) { defer cleanup() ctx := context.Background() - _, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data1")) + _, err := store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data1"), []byte("hpke")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data2")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data2"), []byte("hpke")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data3")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation"), []byte("data3"), []byte("hpke")) require.NoError(t, err) msgs := make([]*WelcomeMessage, 0) @@ -361,11 +362,11 @@ func TestQueryWelcomeMessagesV1_Filter(t *testing.T) { defer cleanup() ctx := context.Background() - _, err := store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("data1")) + _, err := store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("data1"), []byte("hpke1")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("data2")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("data2"), []byte("hpke2")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("data3")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("data3"), []byte("hpke3")) require.NoError(t, err) resp, err := store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ @@ -381,6 +382,7 @@ func TestQueryWelcomeMessagesV1_Filter(t *testing.T) { require.Len(t, resp.Messages, 2) require.Equal(t, []byte("data3"), resp.Messages[0].GetV1().Data) require.Equal(t, []byte("data1"), resp.Messages[1].GetV1().Data) + require.Equal(t, []byte("hpke3"), resp.Messages[0].GetV1().HpkePublicKey) resp, err = store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ InstallationKey: []byte("installation2"), @@ -502,21 +504,21 @@ func TestQueryWelcomeMessagesV1_Paginate(t *testing.T) { defer cleanup() ctx := context.Background() - _, err := store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content1")) + _, err := store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content1"), []byte("hpke1")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("content2")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("content2"), []byte("hpke2")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content3")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content3"), []byte("hpke3")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("content4")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation2"), []byte("content4"), []byte("hpke4")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content5")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content5"), []byte("hpke5")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content6")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content6"), []byte("hpke6")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content7")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content7"), []byte("hpke7")) require.NoError(t, err) - _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content8")) + _, err = store.InsertWelcomeMessage(ctx, []byte("installation1"), []byte("content8"), []byte("hpke8")) require.NoError(t, err) resp, err := store.QueryWelcomeMessagesV1(ctx, &mlsv1.QueryWelcomeMessagesRequest{ From 711074300dd8f4fd88219d6e908309c2fce348b4 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:23:49 -0800 Subject: [PATCH 12/20] Specify column --- pkg/mls/store/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mls/store/models.go b/pkg/mls/store/models.go index 3ee22dd2..83ea0d09 100644 --- a/pkg/mls/store/models.go +++ b/pkg/mls/store/models.go @@ -36,5 +36,5 @@ type WelcomeMessage struct { CreatedAt time.Time `bun:",notnull"` InstallationKey []byte `bun:",notnull,type:bytea"` Data []byte `bun:",notnull,type:bytea"` - HpkePublicKey []byte `bun:",notnull,type:bytea"` + HpkePublicKey []byte `bun:"hpke_public_key,notnull,type:bytea"` } From 372fecb0da00485b1720e11e7d41d8baf9dc4cec Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:24:49 -0800 Subject: [PATCH 13/20] Fix field name --- pkg/mls/store/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mls/store/store.go b/pkg/mls/store/store.go index 5654e059..31918759 100644 --- a/pkg/mls/store/store.go +++ b/pkg/mls/store/store.go @@ -199,7 +199,7 @@ func (s *Store) InsertWelcomeMessage(ctx context.Context, installationId []byte, } var id uint64 - err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash, hpkePublicKey) VALUES (?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...)), hpkePublicKey).Scan(&id) + err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash, hpke_public_key) VALUES (?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...)), hpkePublicKey).Scan(&id) if err != nil { if strings.Contains(err.Error(), "duplicate key value violates unique constraint") { return nil, NewAlreadyExistsError(err) From 15c213d63db3c47bcf0434efe08bf9e2750ca66e Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:27:50 -0800 Subject: [PATCH 14/20] Fix migration --- pkg/migrations/mls/20240122230601_add-hpke-key.down.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql b/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql index 4e20cfc9..e418afea 100644 --- a/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql +++ b/pkg/migrations/mls/20240122230601_add-hpke-key.down.sql @@ -1,4 +1,4 @@ SET statement_timeout = 0; ALTER TABLE welcome_messages -REMOVE COLUMN IF EXISTS hpke_public_key BYTEA; +DROP COLUMN IF EXISTS hpke_public_key BYTEA; From b510fe9cd6802fab624d06775413f2c0fab440ec Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:11:40 -0800 Subject: [PATCH 15/20] Add data to test --- pkg/mls/api/v1/service_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/mls/api/v1/service_test.go b/pkg/mls/api/v1/service_test.go index a13495ca..45308261 100644 --- a/pkg/mls/api/v1/service_test.go +++ b/pkg/mls/api/v1/service_test.go @@ -271,6 +271,7 @@ func TestSendWelcomeMessages(t *testing.T) { V1: &mlsv1.WelcomeMessageInput_V1{ InstallationKey: []byte(installationId), Data: []byte("test"), + HpkePublicKey: []byte("test"), }, }, }, From 62ac14b2ade6cedba36a151d0ba125b80756a5e1 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:14:27 -0800 Subject: [PATCH 16/20] Do more validations on welcome messages --- pkg/mls/api/v1/service.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/mls/api/v1/service.go b/pkg/mls/api/v1/service.go index 3da8fd55..01bb9574 100644 --- a/pkg/mls/api/v1/service.go +++ b/pkg/mls/api/v1/service.go @@ -474,10 +474,19 @@ func validateSendWelcomeMessagesRequest(req *mlsv1.SendWelcomeMessagesRequest) e if req == nil || len(req.Messages) == 0 { return status.Errorf(codes.InvalidArgument, "no welcome messages to send") } + for _, input := range req.Messages { if input == nil || input.GetV1() == nil { return status.Errorf(codes.InvalidArgument, "invalid welcome message") } + + v1 := input.GetV1() + if v1.Data == nil || v1.InstallationKey == nil || v1.HpkePublicKey == nil { + return status.Errorf(codes.InvalidArgument, "invalid welcome message") + } + if len(v1.Data) == 0 || len(v1.InstallationKey) == 0 || len(v1.HpkePublicKey) == 0 { + return status.Errorf(codes.InvalidArgument, "invalid welcome message") + } } return nil } From e80213610942fc1613b0fac4393d0c5938ff453c Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:15:03 -0800 Subject: [PATCH 17/20] Simplify check --- pkg/mls/api/v1/service.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/mls/api/v1/service.go b/pkg/mls/api/v1/service.go index 01bb9574..581ea38a 100644 --- a/pkg/mls/api/v1/service.go +++ b/pkg/mls/api/v1/service.go @@ -481,9 +481,6 @@ func validateSendWelcomeMessagesRequest(req *mlsv1.SendWelcomeMessagesRequest) e } v1 := input.GetV1() - if v1.Data == nil || v1.InstallationKey == nil || v1.HpkePublicKey == nil { - return status.Errorf(codes.InvalidArgument, "invalid welcome message") - } if len(v1.Data) == 0 || len(v1.InstallationKey) == 0 || len(v1.HpkePublicKey) == 0 { return status.Errorf(codes.InvalidArgument, "invalid welcome message") } From 07e52b59296c549396e84758bc9b8fdf1fec765c Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:31:15 -0800 Subject: [PATCH 18/20] Fix insert statement --- pkg/mls/store/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mls/store/store.go b/pkg/mls/store/store.go index 31918759..8810f703 100644 --- a/pkg/mls/store/store.go +++ b/pkg/mls/store/store.go @@ -199,7 +199,7 @@ func (s *Store) InsertWelcomeMessage(ctx context.Context, installationId []byte, } var id uint64 - err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash, hpke_public_key) VALUES (?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...)), hpkePublicKey).Scan(&id) + err := s.db.QueryRow("INSERT INTO welcome_messages (installation_key, data, installation_key_data_hash, hpke_public_key) VALUES (?, ?, ?, ?) RETURNING id", installationId, data, sha256.Sum256(append(installationId, data...)), hpkePublicKey).Scan(&id) if err != nil { if strings.Contains(err.Error(), "duplicate key value violates unique constraint") { return nil, NewAlreadyExistsError(err) From 3e6947b05c6796c8bef93c9d32c90dc146fbb07d Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Mon, 22 Jan 2024 20:00:17 -0800 Subject: [PATCH 19/20] Push up mls image --- .github/workflows/push-mls.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-mls.yml b/.github/workflows/push-mls.yml index d55e127c..6508642b 100644 --- a/.github/workflows/push-mls.yml +++ b/.github/workflows/push-mls.yml @@ -2,7 +2,8 @@ name: Push MLS Container on: push: branches: - - mls + # - mls + - nm/add-hpke-public-key jobs: deploy: concurrency: main @@ -28,7 +29,7 @@ jobs: - name: Push id: push run: | - export DOCKER_IMAGE_TAG=mls + export DOCKER_IMAGE_TAG=mls-dev IMAGE_TO_DEPLOY=xmtp/node-go@$(dev/docker/build) echo Successfully pushed $IMAGE_TO_DEPLOY echo "docker_image=${IMAGE_TO_DEPLOY}" >> $GITHUB_OUTPUT From eb71746b9736917eaac8bf7288ddb87049fe5670 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:29:43 -0800 Subject: [PATCH 20/20] Add new generated file --- pkg/proto/mls/database/intents.pb.go | 153 ++++++++++++++++++++------- 1 file changed, 116 insertions(+), 37 deletions(-) diff --git a/pkg/proto/mls/database/intents.pb.go b/pkg/proto/mls/database/intents.pb.go index 420ecd00..df3672b8 100644 --- a/pkg/proto/mls/database/intents.pb.go +++ b/pkg/proto/mls/database/intents.pb.go @@ -618,20 +618,76 @@ func (x *RemoveMembersData_V1) GetAddressesOrInstallationIds() *AddressesOrInsta return nil } +// An installation +type PostCommitAction_Installation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstallationKey []byte `protobuf:"bytes,1,opt,name=installation_key,json=installationKey,proto3" json:"installation_key,omitempty"` + HpkePublicKey []byte `protobuf:"bytes,2,opt,name=hpke_public_key,json=hpkePublicKey,proto3" json:"hpke_public_key,omitempty"` +} + +func (x *PostCommitAction_Installation) Reset() { + *x = PostCommitAction_Installation{} + if protoimpl.UnsafeEnabled { + mi := &file_mls_database_intents_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostCommitAction_Installation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCommitAction_Installation) ProtoMessage() {} + +func (x *PostCommitAction_Installation) ProtoReflect() protoreflect.Message { + mi := &file_mls_database_intents_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PostCommitAction_Installation.ProtoReflect.Descriptor instead. +func (*PostCommitAction_Installation) Descriptor() ([]byte, []int) { + return file_mls_database_intents_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *PostCommitAction_Installation) GetInstallationKey() []byte { + if x != nil { + return x.InstallationKey + } + return nil +} + +func (x *PostCommitAction_Installation) GetHpkePublicKey() []byte { + if x != nil { + return x.HpkePublicKey + } + return nil +} + // SendWelcome message type PostCommitAction_SendWelcomes struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - InstallationIds [][]byte `protobuf:"bytes,1,rep,name=installation_ids,json=installationIds,proto3" json:"installation_ids,omitempty"` - WelcomeMessage []byte `protobuf:"bytes,2,opt,name=welcome_message,json=welcomeMessage,proto3" json:"welcome_message,omitempty"` + Installations []*PostCommitAction_Installation `protobuf:"bytes,1,rep,name=installations,proto3" json:"installations,omitempty"` + WelcomeMessage []byte `protobuf:"bytes,2,opt,name=welcome_message,json=welcomeMessage,proto3" json:"welcome_message,omitempty"` } func (x *PostCommitAction_SendWelcomes) Reset() { *x = PostCommitAction_SendWelcomes{} if protoimpl.UnsafeEnabled { - mi := &file_mls_database_intents_proto_msgTypes[10] + mi := &file_mls_database_intents_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -644,7 +700,7 @@ func (x *PostCommitAction_SendWelcomes) String() string { func (*PostCommitAction_SendWelcomes) ProtoMessage() {} func (x *PostCommitAction_SendWelcomes) ProtoReflect() protoreflect.Message { - mi := &file_mls_database_intents_proto_msgTypes[10] + mi := &file_mls_database_intents_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -657,12 +713,12 @@ func (x *PostCommitAction_SendWelcomes) ProtoReflect() protoreflect.Message { // Deprecated: Use PostCommitAction_SendWelcomes.ProtoReflect.Descriptor instead. func (*PostCommitAction_SendWelcomes) Descriptor() ([]byte, []int) { - return file_mls_database_intents_proto_rawDescGZIP(), []int{6, 0} + return file_mls_database_intents_proto_rawDescGZIP(), []int{6, 1} } -func (x *PostCommitAction_SendWelcomes) GetInstallationIds() [][]byte { +func (x *PostCommitAction_SendWelcomes) GetInstallations() []*PostCommitAction_Installation { if x != nil { - return x.InstallationIds + return x.Installations } return nil } @@ -736,33 +792,42 @@ var file_mls_database_intents_proto_rawDesc = []byte{ 0x4f, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x52, 0x1a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4f, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x42, 0x09, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd7, 0x01, 0x0a, 0x10, 0x50, 0x6f, 0x73, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xe8, 0x02, 0x0a, 0x10, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x57, 0x65, - 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x1a, 0x62, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x57, 0x65, - 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x5f, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x77, 0x65, 0x6c, 0x63, - 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x42, 0xc0, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x42, 0x0c, 0x49, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, - 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, - 0x65, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x44, 0xaa, 0x02, 0x11, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x4d, - 0x6c, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0xca, 0x02, 0x11, 0x58, 0x6d, - 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0xe2, - 0x02, 0x1d, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x44, 0x61, 0x74, 0x61, 0x62, - 0x61, 0x73, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x44, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x1a, 0x61, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, + 0x79, 0x12, 0x26, 0x0a, 0x0f, 0x68, 0x70, 0x6b, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x68, 0x70, 0x6b, 0x65, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x1a, 0x8f, 0x01, 0x0a, 0x0c, 0x53, 0x65, + 0x6e, 0x64, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x77, 0x65, 0x6c, + 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, + 0x69, 0x6e, 0x64, 0x42, 0xc0, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x42, 0x0c, 0x49, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, + 0x6d, 0x74, 0x70, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0xa2, 0x02, 0x03, 0x58, 0x4d, 0x44, 0xaa, 0x02, 0x11, 0x58, 0x6d, 0x74, 0x70, 0x2e, + 0x4d, 0x6c, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0xca, 0x02, 0x11, 0x58, + 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0xe2, 0x02, 0x1d, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x4d, 0x6c, 0x73, 0x5c, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x13, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x4d, 0x6c, 0x73, 0x3a, 0x3a, 0x44, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -777,7 +842,7 @@ func file_mls_database_intents_proto_rawDescGZIP() []byte { return file_mls_database_intents_proto_rawDescData } -var file_mls_database_intents_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_mls_database_intents_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_mls_database_intents_proto_goTypes = []interface{}{ (*SendMessageData)(nil), // 0: xmtp.mls.database.SendMessageData (*AccountAddresses)(nil), // 1: xmtp.mls.database.AccountAddresses @@ -789,7 +854,8 @@ var file_mls_database_intents_proto_goTypes = []interface{}{ (*SendMessageData_V1)(nil), // 7: xmtp.mls.database.SendMessageData.V1 (*AddMembersData_V1)(nil), // 8: xmtp.mls.database.AddMembersData.V1 (*RemoveMembersData_V1)(nil), // 9: xmtp.mls.database.RemoveMembersData.V1 - (*PostCommitAction_SendWelcomes)(nil), // 10: xmtp.mls.database.PostCommitAction.SendWelcomes + (*PostCommitAction_Installation)(nil), // 10: xmtp.mls.database.PostCommitAction.Installation + (*PostCommitAction_SendWelcomes)(nil), // 11: xmtp.mls.database.PostCommitAction.SendWelcomes } var file_mls_database_intents_proto_depIdxs = []int32{ 7, // 0: xmtp.mls.database.SendMessageData.v1:type_name -> xmtp.mls.database.SendMessageData.V1 @@ -797,14 +863,15 @@ var file_mls_database_intents_proto_depIdxs = []int32{ 2, // 2: xmtp.mls.database.AddressesOrInstallationIds.installation_ids:type_name -> xmtp.mls.database.InstallationIds 8, // 3: xmtp.mls.database.AddMembersData.v1:type_name -> xmtp.mls.database.AddMembersData.V1 9, // 4: xmtp.mls.database.RemoveMembersData.v1:type_name -> xmtp.mls.database.RemoveMembersData.V1 - 10, // 5: xmtp.mls.database.PostCommitAction.send_welcomes:type_name -> xmtp.mls.database.PostCommitAction.SendWelcomes + 11, // 5: xmtp.mls.database.PostCommitAction.send_welcomes:type_name -> xmtp.mls.database.PostCommitAction.SendWelcomes 3, // 6: xmtp.mls.database.AddMembersData.V1.addresses_or_installation_ids:type_name -> xmtp.mls.database.AddressesOrInstallationIds 3, // 7: xmtp.mls.database.RemoveMembersData.V1.addresses_or_installation_ids:type_name -> xmtp.mls.database.AddressesOrInstallationIds - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 10, // 8: xmtp.mls.database.PostCommitAction.SendWelcomes.installations:type_name -> xmtp.mls.database.PostCommitAction.Installation + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_mls_database_intents_proto_init() } @@ -934,6 +1001,18 @@ func file_mls_database_intents_proto_init() { } } file_mls_database_intents_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostCommitAction_Installation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mls_database_intents_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PostCommitAction_SendWelcomes); i { case 0: return &v.state @@ -968,7 +1047,7 @@ func file_mls_database_intents_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_mls_database_intents_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 0, },