Skip to content

Commit

Permalink
Re-generate protos against main
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhuaaa committed Apr 10, 2024
1 parent 734fb2e commit 81a56b1
Show file tree
Hide file tree
Showing 9 changed files with 798 additions and 406 deletions.
2 changes: 1 addition & 1 deletion dev/generate
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go generate ./...

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=nm/prototype-identity-apis,subdir=proto; then
if ! buf generate https://github.com/xmtp/proto.git#branch=main,subdir=proto; then
echo "Failed to generate protobuf definitions"
exit 1
fi
54 changes: 54 additions & 0 deletions pkg/identity/api/v1/service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package api

import (
"context"

mlsstore "github.com/xmtp/xmtp-node-go/pkg/mls/store"
api "github.com/xmtp/xmtp-node-go/pkg/proto/identity/api/v1"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

type Service struct {
api.UnimplementedIdentityApiServer

log *zap.Logger
store mlsstore.MlsStore

ctx context.Context
ctxCancel func()
}

func NewService(log *zap.Logger, store mlsstore.MlsStore) (s *Service, err error) {
s = &Service{
log: log.Named("identity"),
store: store,
}
s.ctx, s.ctxCancel = context.WithCancel(context.Background())

s.log.Info("Starting identity service")
return s, nil
}

func (s *Service) Close() {
s.log.Info("closing")

if s.ctxCancel != nil {
s.ctxCancel()
}

s.log.Info("closed")
}

func (s *Service) PublishIdentityUpdate(ctx context.Context, req *api.PublishIdentityUpdateRequest) (*api.PublishIdentityUpdateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "unimplemented")
}

func (s *Service) GetIdentityUpdates(ctx context.Context, req *api.GetIdentityUpdatesRequest) (*api.GetIdentityUpdatesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "unimplemented")
}

func (s *Service) GetInboxIds(ctx context.Context, req *api.GetInboxIdsRequest) (*api.GetInboxIdsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "unimplemented")
}
222 changes: 106 additions & 116 deletions pkg/proto/identity/api/v1/identity.pb.go

Large diffs are not rendered by default.

226 changes: 103 additions & 123 deletions pkg/proto/identity/associations/association.pb.go

Large diffs are not rendered by default.

305 changes: 230 additions & 75 deletions pkg/proto/mls/database/intents.pb.go

Large diffs are not rendered by default.

170 changes: 93 additions & 77 deletions pkg/proto/mls/message_contents/group_metadata.pb.go

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions pkg/proto/mls/message_contents/group_mutable_metadata.pb.go

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

17 changes: 3 additions & 14 deletions pkg/proto/openapi/identity/api/v1/identity.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@
"associationsAddAssociation": {
"type": "object",
"properties": {
"inboxId": {
"type": "string"
},
"newMemberIdentifier": {
"$ref": "#/definitions/associationsMemberIdentifier"
},
Expand All @@ -187,9 +184,6 @@
"associationsChangeRecoveryAddress": {
"type": "object",
"properties": {
"inboxId": {
"type": "string"
},
"newRecoveryAddress": {
"type": "string"
},
Expand Down Expand Up @@ -267,6 +261,9 @@
"clientTimestampNs": {
"type": "string",
"format": "uint64"
},
"inboxId": {
"type": "string"
}
},
"description": "One or more identity actions that were signed together.\nExample: [CreateXid, AddAssociation, ChangeRecoveryAddress]\n1. The batched signature text is created by concatenating the signature text\n of each association together with a separator, '\\n\\n\\n'.\n2. The user signs this concatenated result.\n3. The resulting signature is added to each association proto where relevant.\n The same signature may be used for multiple associations in the array."
Expand Down Expand Up @@ -309,9 +306,6 @@
"associationsRevokeAssociation": {
"type": "object",
"properties": {
"inboxId": {
"type": "string"
},
"memberToRevoke": {
"$ref": "#/definitions/associationsMemberIdentifier"
},
Expand Down Expand Up @@ -480,11 +474,6 @@
},
"v1PublishIdentityUpdateResponse": {
"type": "object",
"properties": {
"inboxId": {
"type": "string"
}
},
"title": "The response when an identity update is published"
},
"xmtpidentityapiv1GetIdentityUpdatesRequest": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"swagger": "2.0",
"info": {
"title": "mls/message_contents/group_mutable_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"
}
}
}
}
}
}

0 comments on commit 81a56b1

Please sign in to comment.