From d4e19d5b61bc33283e355a99c8368b6813174333 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 19 May 2021 14:08:50 +0100 Subject: [PATCH] replace users with user (#113) --- {users => user}/Dockerfile | 0 {users => user}/Makefile | 8 +- {users => user}/README.md | 0 {users => user}/domain/domain.go | 32 +- {users => user}/generate.go | 0 {users => user}/handler/handler.go | 64 +- {users => user}/main.go | 8 +- .../users.pb.go => user/proto/user.pb.go | 617 +++++++++--------- .../proto/user.pb.micro.go | 110 ++-- .../users.proto => user/proto/user.proto | 79 ++- 10 files changed, 491 insertions(+), 427 deletions(-) rename {users => user}/Dockerfile (100%) rename {users => user}/Makefile (68%) rename {users => user}/README.md (100%) rename {users => user}/domain/domain.go (81%) rename {users => user}/generate.go (100%) rename {users => user}/handler/handler.go (54%) rename {users => user}/main.go (56%) rename users/proto/users.pb.go => user/proto/user.pb.go (57%) rename users/proto/users.pb.micro.go => user/proto/user.pb.micro.go (55%) rename users/proto/users.proto => user/proto/user.proto (54%) diff --git a/users/Dockerfile b/user/Dockerfile similarity index 100% rename from users/Dockerfile rename to user/Dockerfile diff --git a/users/Makefile b/user/Makefile similarity index 68% rename from users/Makefile rename to user/Makefile index 2c2d824..e8acf72 100644 --- a/users/Makefile +++ b/user/Makefile @@ -8,15 +8,15 @@ init: go get github.com/micro/micro/v3/cmd/protoc-gen-openapi .PHONY: proto proto: - protoc --proto_path=. --micro_out=. --go_out=:. proto/users.proto + protoc --proto_path=. --micro_out=. --go_out=:. proto/user.proto .PHONY: api api: - protoc --openapi_out=. --proto_path=. proto/users.proto + protoc --openapi_out=. --proto_path=. proto/user.proto .PHONY: build build: - go build -o users *.go + go build -o user *.go .PHONY: test test: @@ -24,4 +24,4 @@ test: .PHONY: docker docker: - docker build . -t users:latest + docker build . -t user:latest diff --git a/users/README.md b/user/README.md similarity index 100% rename from users/README.md rename to user/README.md diff --git a/users/domain/domain.go b/user/domain/domain.go similarity index 81% rename from users/domain/domain.go rename to user/domain/domain.go index 7f873ca..fee4865 100644 --- a/users/domain/domain.go +++ b/user/domain/domain.go @@ -4,8 +4,8 @@ import ( "errors" "time" - user "github.com/micro/services/users/proto" "github.com/micro/micro/v3/service/model" + user "github.com/micro/services/user/proto" ) type pw struct { @@ -15,7 +15,7 @@ type pw struct { } type Domain struct { - users model.Model + user model.Model sessions model.Model passwords model.Model @@ -39,7 +39,7 @@ func New() *Domain { idIndex.Order.Type = model.OrderTypeUnordered return &Domain{ - users: model.New(user.User{}, &model.Options{ + user: model.New(user.Account{}, &model.Options{ Indexes: []model.Index{nameIndex, emailIndex}, }), sessions: model.New(user.Session{}, nil), @@ -72,10 +72,10 @@ func (domain *Domain) ReadSession(id string) (*user.Session, error) { return sess, domain.sessions.Read(domain.idIndex.ToQuery(id), &sess) } -func (domain *Domain) Create(user *user.User, salt string, password string) error { +func (domain *Domain) Create(user *user.Account, salt string, password string) error { user.Created = time.Now().Unix() user.Updated = time.Now().Unix() - err := domain.users.Create(user) + err := domain.user.Create(user) if err != nil { return err } @@ -87,20 +87,20 @@ func (domain *Domain) Create(user *user.User, salt string, password string) erro } func (domain *Domain) Delete(id string) error { - return domain.users.Delete(domain.idIndex.ToQuery(id)) + return domain.user.Delete(domain.idIndex.ToQuery(id)) } -func (domain *Domain) Update(user *user.User) error { +func (domain *Domain) Update(user *user.Account) error { user.Updated = time.Now().Unix() - return domain.users.Create(user) + return domain.user.Create(user) } -func (domain *Domain) Read(id string) (*user.User, error) { - user := &user.User{} - return user, domain.users.Read(domain.idIndex.ToQuery(id), user) +func (domain *Domain) Read(id string) (*user.Account, error) { + user := &user.Account{} + return user, domain.user.Read(domain.idIndex.ToQuery(id), user) } -func (domain *Domain) Search(username, email string, limit, offset int64) ([]*user.User, error) { +func (domain *Domain) Search(username, email string, limit, offset int64) ([]*user.Account, error) { var query model.Query if len(username) > 0 { query = domain.nameIndex.ToQuery(username) @@ -110,8 +110,8 @@ func (domain *Domain) Search(username, email string, limit, offset int64) ([]*us return nil, errors.New("username and email cannot be blank") } - users := []*user.User{} - return users, domain.users.Read(query, &users) + user := []*user.Account{} + return user, domain.user.Read(query, &user) } func (domain *Domain) UpdatePassword(id string, salt string, password string) error { @@ -132,8 +132,8 @@ func (domain *Domain) SaltAndPassword(username, email string) (string, string, e return "", "", errors.New("username and email cannot be blank") } - user := &user.User{} - err := domain.users.Read(query, &user) + user := &user.Account{} + err := domain.user.Read(query, &user) if err != nil { return "", "", err } diff --git a/users/generate.go b/user/generate.go similarity index 100% rename from users/generate.go rename to user/generate.go diff --git a/users/handler/handler.go b/user/handler/handler.go similarity index 54% rename from users/handler/handler.go rename to user/handler/handler.go index 3a16cd0..c37b21b 100644 --- a/users/handler/handler.go +++ b/user/handler/handler.go @@ -6,9 +6,9 @@ import ( "strings" "time" - "github.com/micro/services/users/domain" - pb "github.com/micro/services/users/proto" "github.com/micro/micro/v3/service/errors" + "github.com/micro/services/user/domain" + pb "github.com/micro/services/user/proto" "golang.org/x/crypto/bcrypt" "golang.org/x/net/context" ) @@ -33,101 +33,101 @@ func random(i int) string { return "ughwhy?!!!" } -type Users struct { +type User struct { domain *domain.Domain } -func NewUsers() *Users { - return &Users{ +func NewUser() *User { + return &User{ domain: domain.New(), } } -func (s *Users) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.CreateResponse) error { +func (s *User) Create(ctx context.Context, req *pb.CreateRequest, rsp *pb.CreateResponse) error { if len(req.Password) < 8 { - return errors.InternalServerError("users.Create.Check", "Password is less than 8 characters") + return errors.InternalServerError("user.Create.Check", "Password is less than 8 characters") } salt := random(16) h, err := bcrypt.GenerateFromPassword([]byte(x+salt+req.Password), 10) if err != nil { - return errors.InternalServerError("users.Create", err.Error()) + return errors.InternalServerError("user.Create", err.Error()) } pp := base64.StdEncoding.EncodeToString(h) - return s.domain.Create(&pb.User{ + return s.domain.Create(&pb.Account{ Id: req.Id, Username: strings.ToLower(req.Username), Email: strings.ToLower(req.Email), }, salt, pp) } -func (s *Users) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error { - user, err := s.domain.Read(req.Id) +func (s *User) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error { + account, err := s.domain.Read(req.Id) if err != nil { return err } - rsp.User = user + rsp.Account = account return nil } -func (s *Users) Update(ctx context.Context, req *pb.UpdateRequest, rsp *pb.UpdateResponse) error { - return s.domain.Update(&pb.User{ +func (s *User) Update(ctx context.Context, req *pb.UpdateRequest, rsp *pb.UpdateResponse) error { + return s.domain.Update(&pb.Account{ Id: req.Id, Username: strings.ToLower(req.Username), Email: strings.ToLower(req.Email), }) } -func (s *Users) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.DeleteResponse) error { +func (s *User) Delete(ctx context.Context, req *pb.DeleteRequest, rsp *pb.DeleteResponse) error { return s.domain.Delete(req.Id) } -func (s *Users) Search(ctx context.Context, req *pb.SearchRequest, rsp *pb.SearchResponse) error { - users, err := s.domain.Search(req.Username, req.Email, req.Limit, req.Offset) +func (s *User) Search(ctx context.Context, req *pb.SearchRequest, rsp *pb.SearchResponse) error { + accounts, err := s.domain.Search(req.Username, req.Email, req.Limit, req.Offset) if err != nil { return err } - rsp.Users = users + rsp.Accounts = accounts return nil } -func (s *Users) UpdatePassword(ctx context.Context, req *pb.UpdatePasswordRequest, rsp *pb.UpdatePasswordResponse) error { +func (s *User) UpdatePassword(ctx context.Context, req *pb.UpdatePasswordRequest, rsp *pb.UpdatePasswordResponse) error { usr, err := s.domain.Read(req.UserId) if err != nil { - return errors.InternalServerError("users.updatepassword", err.Error()) + return errors.InternalServerError("user.updatepassword", err.Error()) } if req.NewPassword != req.ConfirmPassword { - return errors.InternalServerError("users.updatepassword", "Passwords don't math") + return errors.InternalServerError("user.updatepassword", "Passwords don't math") } salt, hashed, err := s.domain.SaltAndPassword(usr.Username, usr.Email) if err != nil { - return errors.InternalServerError("users.updatepassword", err.Error()) + return errors.InternalServerError("user.updatepassword", err.Error()) } hh, err := base64.StdEncoding.DecodeString(hashed) if err != nil { - return errors.InternalServerError("users.updatepassword", err.Error()) + return errors.InternalServerError("user.updatepassword", err.Error()) } if err := bcrypt.CompareHashAndPassword(hh, []byte(x+salt+req.OldPassword)); err != nil { - return errors.Unauthorized("users.updatepassword", err.Error()) + return errors.Unauthorized("user.updatepassword", err.Error()) } salt = random(16) h, err := bcrypt.GenerateFromPassword([]byte(x+salt+req.NewPassword), 10) if err != nil { - return errors.InternalServerError("users.updatepassword", err.Error()) + return errors.InternalServerError("user.updatepassword", err.Error()) } pp := base64.StdEncoding.EncodeToString(h) if err := s.domain.UpdatePassword(req.UserId, salt, pp); err != nil { - return errors.InternalServerError("users.updatepassword", err.Error()) + return errors.InternalServerError("user.updatepassword", err.Error()) } return nil } -func (s *Users) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.LoginResponse) error { +func (s *User) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.LoginResponse) error { username := strings.ToLower(req.Username) email := strings.ToLower(req.Email) @@ -138,11 +138,11 @@ func (s *Users) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.LoginRe hh, err := base64.StdEncoding.DecodeString(hashed) if err != nil { - return errors.InternalServerError("users.Login", err.Error()) + return errors.InternalServerError("user.Login", err.Error()) } if err := bcrypt.CompareHashAndPassword(hh, []byte(x+salt+req.Password)); err != nil { - return errors.Unauthorized("users.login", err.Error()) + return errors.Unauthorized("user.login", err.Error()) } // save session sess := &pb.Session{ @@ -154,17 +154,17 @@ func (s *Users) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.LoginRe } if err := s.domain.CreateSession(sess); err != nil { - return errors.InternalServerError("users.Login", err.Error()) + return errors.InternalServerError("user.Login", err.Error()) } rsp.Session = sess return nil } -func (s *Users) Logout(ctx context.Context, req *pb.LogoutRequest, rsp *pb.LogoutResponse) error { +func (s *User) Logout(ctx context.Context, req *pb.LogoutRequest, rsp *pb.LogoutResponse) error { return s.domain.DeleteSession(req.SessionId) } -func (s *Users) ReadSession(ctx context.Context, req *pb.ReadSessionRequest, rsp *pb.ReadSessionResponse) error { +func (s *User) ReadSession(ctx context.Context, req *pb.ReadSessionRequest, rsp *pb.ReadSessionResponse) error { sess, err := s.domain.ReadSession(req.SessionId) if err != nil { return err diff --git a/users/main.go b/user/main.go similarity index 56% rename from users/main.go rename to user/main.go index b606b63..d467411 100644 --- a/users/main.go +++ b/user/main.go @@ -1,20 +1,20 @@ package main import ( - "github.com/micro/services/users/handler" - proto "github.com/micro/services/users/proto" "github.com/micro/micro/v3/service" "github.com/micro/micro/v3/service/logger" + "github.com/micro/services/user/handler" + proto "github.com/micro/services/user/proto" ) func main() { service := service.New( - service.Name("users"), + service.Name("user"), ) service.Init() - proto.RegisterUsersHandler(service.Server(), handler.NewUsers()) + proto.RegisterUserHandler(service.Server(), handler.NewUser()) if err := service.Run(); err != nil { logger.Fatal(err) diff --git a/users/proto/users.pb.go b/user/proto/user.pb.go similarity index 57% rename from users/proto/users.pb.go rename to user/proto/user.pb.go index 50ba613..33bc6bf 100644 --- a/users/proto/users.pb.go +++ b/user/proto/user.pb.go @@ -2,9 +2,9 @@ // versions: // protoc-gen-go v1.26.0 // protoc v3.15.6 -// source: proto/users.proto +// source: proto/user.proto -package users +package user import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -20,35 +20,40 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type User struct { +type Account struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // uuid - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // alphanumeric user or org - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"` // unix - Updated int64 `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"` // unix + // unique account id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // alphanumeric username + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + // an email address + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + // unix timestamp + Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"` + // unix timestamp + Updated int64 `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"` } -func (x *User) Reset() { - *x = User{} +func (x *Account) Reset() { + *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[0] + mi := &file_proto_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *User) String() string { +func (x *Account) String() string { return protoimpl.X.MessageStringOf(x) } -func (*User) ProtoMessage() {} +func (*Account) ProtoMessage() {} -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[0] +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_proto_user_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,40 +64,40 @@ func (x *User) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{0} +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_proto_user_proto_rawDescGZIP(), []int{0} } -func (x *User) GetId() string { +func (x *Account) GetId() string { if x != nil { return x.Id } return "" } -func (x *User) GetUsername() string { +func (x *Account) GetUsername() string { if x != nil { return x.Username } return "" } -func (x *User) GetEmail() string { +func (x *Account) GetEmail() string { if x != nil { return x.Email } return "" } -func (x *User) GetCreated() int64 { +func (x *Account) GetCreated() int64 { if x != nil { return x.Created } return 0 } -func (x *User) GetUpdated() int64 { +func (x *Account) GetUpdated() int64 { if x != nil { return x.Updated } @@ -104,17 +109,22 @@ type Session struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // the session id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // account username Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"` // unix - Expires int64 `protobuf:"varint,5,opt,name=expires,proto3" json:"expires,omitempty"` // unix + // account email + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + // unix timestamp + Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"` + // unix timestamp + Expires int64 `protobuf:"varint,5,opt,name=expires,proto3" json:"expires,omitempty"` } func (x *Session) Reset() { *x = Session{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[1] + mi := &file_proto_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -127,7 +137,7 @@ func (x *Session) String() string { func (*Session) ProtoMessage() {} func (x *Session) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[1] + mi := &file_proto_user_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -140,7 +150,7 @@ func (x *Session) ProtoReflect() protoreflect.Message { // Deprecated: Use Session.ProtoReflect.Descriptor instead. func (*Session) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{1} + return file_proto_user_proto_rawDescGZIP(), []int{1} } func (x *Session) GetId() string { @@ -178,21 +188,26 @@ func (x *Session) GetExpires() int64 { return 0 } +// Create a new user account type CreateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // uuid - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // alphanumeric user or org - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + // the acccount id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // the username + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + // the email address + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + // the user password Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` } func (x *CreateRequest) Reset() { *x = CreateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[2] + mi := &file_proto_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -205,7 +220,7 @@ func (x *CreateRequest) String() string { func (*CreateRequest) ProtoMessage() {} func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[2] + mi := &file_proto_user_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -218,7 +233,7 @@ func (x *CreateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{2} + return file_proto_user_proto_rawDescGZIP(), []int{2} } func (x *CreateRequest) GetId() string { @@ -258,7 +273,7 @@ type CreateResponse struct { func (x *CreateResponse) Reset() { *x = CreateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[3] + mi := &file_proto_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -271,7 +286,7 @@ func (x *CreateResponse) String() string { func (*CreateResponse) ProtoMessage() {} func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[3] + mi := &file_proto_user_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -284,21 +299,23 @@ func (x *CreateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{3} + return file_proto_user_proto_rawDescGZIP(), []int{3} } +// Delete an account by id type DeleteRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // the account id Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *DeleteRequest) Reset() { *x = DeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[4] + mi := &file_proto_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -311,7 +328,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[4] + mi := &file_proto_user_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -324,7 +341,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{4} + return file_proto_user_proto_rawDescGZIP(), []int{4} } func (x *DeleteRequest) GetId() string { @@ -343,7 +360,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[5] + mi := &file_proto_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -356,7 +373,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[5] + mi := &file_proto_user_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -369,21 +386,23 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{5} + return file_proto_user_proto_rawDescGZIP(), []int{5} } +// Read an account by id type ReadRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // the account id Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *ReadRequest) Reset() { *x = ReadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[6] + mi := &file_proto_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -396,7 +415,7 @@ func (x *ReadRequest) String() string { func (*ReadRequest) ProtoMessage() {} func (x *ReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[6] + mi := &file_proto_user_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -409,7 +428,7 @@ func (x *ReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. func (*ReadRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{6} + return file_proto_user_proto_rawDescGZIP(), []int{6} } func (x *ReadRequest) GetId() string { @@ -424,13 +443,13 @@ type ReadResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } func (x *ReadResponse) Reset() { *x = ReadResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[7] + mi := &file_proto_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -443,7 +462,7 @@ func (x *ReadResponse) String() string { func (*ReadResponse) ProtoMessage() {} func (x *ReadResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[7] + mi := &file_proto_user_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -456,30 +475,34 @@ func (x *ReadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. func (*ReadResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{7} + return file_proto_user_proto_rawDescGZIP(), []int{7} } -func (x *ReadResponse) GetUser() *User { +func (x *ReadResponse) GetAccount() *Account { if x != nil { - return x.User + return x.Account } return nil } +// Update the account username or email type UpdateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // uuid - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // alphanumeric user or org - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + // the account id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // the new username + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + // the new email address + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` } func (x *UpdateRequest) Reset() { *x = UpdateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[8] + mi := &file_proto_user_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -492,7 +515,7 @@ func (x *UpdateRequest) String() string { func (*UpdateRequest) ProtoMessage() {} func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[8] + mi := &file_proto_user_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -505,7 +528,7 @@ func (x *UpdateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{8} + return file_proto_user_proto_rawDescGZIP(), []int{8} } func (x *UpdateRequest) GetId() string { @@ -538,7 +561,7 @@ type UpdateResponse struct { func (x *UpdateResponse) Reset() { *x = UpdateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[9] + mi := &file_proto_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +574,7 @@ func (x *UpdateResponse) String() string { func (*UpdateResponse) ProtoMessage() {} func (x *UpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[9] + mi := &file_proto_user_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -564,24 +587,29 @@ func (x *UpdateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. func (*UpdateResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{9} + return file_proto_user_proto_rawDescGZIP(), []int{9} } +// Update the account password type UpdatePasswordRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - OldPassword string `protobuf:"bytes,2,opt,name=oldPassword,proto3" json:"oldPassword,omitempty"` - NewPassword string `protobuf:"bytes,3,opt,name=newPassword,proto3" json:"newPassword,omitempty"` + // the account id + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + // the old password + OldPassword string `protobuf:"bytes,2,opt,name=oldPassword,proto3" json:"oldPassword,omitempty"` + // the new password + NewPassword string `protobuf:"bytes,3,opt,name=newPassword,proto3" json:"newPassword,omitempty"` + // confirm new password ConfirmPassword string `protobuf:"bytes,4,opt,name=confirm_password,json=confirmPassword,proto3" json:"confirm_password,omitempty"` } func (x *UpdatePasswordRequest) Reset() { *x = UpdatePasswordRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[10] + mi := &file_proto_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -594,7 +622,7 @@ func (x *UpdatePasswordRequest) String() string { func (*UpdatePasswordRequest) ProtoMessage() {} func (x *UpdatePasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[10] + mi := &file_proto_user_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -607,7 +635,7 @@ func (x *UpdatePasswordRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePasswordRequest.ProtoReflect.Descriptor instead. func (*UpdatePasswordRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{10} + return file_proto_user_proto_rawDescGZIP(), []int{10} } func (x *UpdatePasswordRequest) GetUserId() string { @@ -647,7 +675,7 @@ type UpdatePasswordResponse struct { func (x *UpdatePasswordResponse) Reset() { *x = UpdatePasswordResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[11] + mi := &file_proto_user_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -660,7 +688,7 @@ func (x *UpdatePasswordResponse) String() string { func (*UpdatePasswordResponse) ProtoMessage() {} func (x *UpdatePasswordResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[11] + mi := &file_proto_user_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -673,9 +701,10 @@ func (x *UpdatePasswordResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePasswordResponse.ProtoReflect.Descriptor instead. func (*UpdatePasswordResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{11} + return file_proto_user_proto_rawDescGZIP(), []int{11} } +// Search for an account type SearchRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -690,7 +719,7 @@ type SearchRequest struct { func (x *SearchRequest) Reset() { *x = SearchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[12] + mi := &file_proto_user_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -703,7 +732,7 @@ func (x *SearchRequest) String() string { func (*SearchRequest) ProtoMessage() {} func (x *SearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[12] + mi := &file_proto_user_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -716,7 +745,7 @@ func (x *SearchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. func (*SearchRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{12} + return file_proto_user_proto_rawDescGZIP(), []int{12} } func (x *SearchRequest) GetUsername() string { @@ -752,13 +781,13 @@ type SearchResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + Accounts []*Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` } func (x *SearchResponse) Reset() { *x = SearchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[13] + mi := &file_proto_user_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -771,7 +800,7 @@ func (x *SearchResponse) String() string { func (*SearchResponse) ProtoMessage() {} func (x *SearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[13] + mi := &file_proto_user_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -784,16 +813,17 @@ func (x *SearchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. func (*SearchResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{13} + return file_proto_user_proto_rawDescGZIP(), []int{13} } -func (x *SearchResponse) GetUsers() []*User { +func (x *SearchResponse) GetAccounts() []*Account { if x != nil { - return x.Users + return x.Accounts } return nil } +// Read a session by id type ReadSessionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -805,7 +835,7 @@ type ReadSessionRequest struct { func (x *ReadSessionRequest) Reset() { *x = ReadSessionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[14] + mi := &file_proto_user_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -818,7 +848,7 @@ func (x *ReadSessionRequest) String() string { func (*ReadSessionRequest) ProtoMessage() {} func (x *ReadSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[14] + mi := &file_proto_user_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -831,7 +861,7 @@ func (x *ReadSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadSessionRequest.ProtoReflect.Descriptor instead. func (*ReadSessionRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{14} + return file_proto_user_proto_rawDescGZIP(), []int{14} } func (x *ReadSessionRequest) GetSessionId() string { @@ -852,7 +882,7 @@ type ReadSessionResponse struct { func (x *ReadSessionResponse) Reset() { *x = ReadSessionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[15] + mi := &file_proto_user_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -865,7 +895,7 @@ func (x *ReadSessionResponse) String() string { func (*ReadSessionResponse) ProtoMessage() {} func (x *ReadSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[15] + mi := &file_proto_user_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -878,7 +908,7 @@ func (x *ReadSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadSessionResponse.ProtoReflect.Descriptor instead. func (*ReadSessionResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{15} + return file_proto_user_proto_rawDescGZIP(), []int{15} } func (x *ReadSessionResponse) GetSession() *Session { @@ -888,6 +918,7 @@ func (x *ReadSessionResponse) GetSession() *Session { return nil } +// Login a user account type LoginRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -901,7 +932,7 @@ type LoginRequest struct { func (x *LoginRequest) Reset() { *x = LoginRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[16] + mi := &file_proto_user_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -914,7 +945,7 @@ func (x *LoginRequest) String() string { func (*LoginRequest) ProtoMessage() {} func (x *LoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[16] + mi := &file_proto_user_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -927,7 +958,7 @@ func (x *LoginRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. func (*LoginRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{16} + return file_proto_user_proto_rawDescGZIP(), []int{16} } func (x *LoginRequest) GetUsername() string { @@ -962,7 +993,7 @@ type LoginResponse struct { func (x *LoginResponse) Reset() { *x = LoginResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[17] + mi := &file_proto_user_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -975,7 +1006,7 @@ func (x *LoginResponse) String() string { func (*LoginResponse) ProtoMessage() {} func (x *LoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[17] + mi := &file_proto_user_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -988,7 +1019,7 @@ func (x *LoginResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. func (*LoginResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{17} + return file_proto_user_proto_rawDescGZIP(), []int{17} } func (x *LoginResponse) GetSession() *Session { @@ -998,6 +1029,7 @@ func (x *LoginResponse) GetSession() *Session { return nil } +// Logout a user account type LogoutRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1009,7 +1041,7 @@ type LogoutRequest struct { func (x *LogoutRequest) Reset() { *x = LogoutRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[18] + mi := &file_proto_user_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1022,7 +1054,7 @@ func (x *LogoutRequest) String() string { func (*LogoutRequest) ProtoMessage() {} func (x *LogoutRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[18] + mi := &file_proto_user_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1035,7 +1067,7 @@ func (x *LogoutRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. func (*LogoutRequest) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{18} + return file_proto_user_proto_rawDescGZIP(), []int{18} } func (x *LogoutRequest) GetSessionId() string { @@ -1054,7 +1086,7 @@ type LogoutResponse struct { func (x *LogoutResponse) Reset() { *x = LogoutResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_users_proto_msgTypes[19] + mi := &file_proto_user_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1067,7 +1099,7 @@ func (x *LogoutResponse) String() string { func (*LogoutResponse) ProtoMessage() {} func (x *LogoutResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_users_proto_msgTypes[19] + mi := &file_proto_user_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1080,192 +1112,191 @@ func (x *LogoutResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead. func (*LogoutResponse) Descriptor() ([]byte, []int) { - return file_proto_users_proto_rawDescGZIP(), []int{19} + return file_proto_user_proto_rawDescGZIP(), []int{19} } -var File_proto_users_proto protoreflect.FileDescriptor +var File_proto_user_proto protoreflect.FileDescriptor -var file_proto_users_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x7c, 0x0a, 0x04, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x7f, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, +var file_proto_user_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x7f, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x0d, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x0a, - 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x0c, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x51, 0x0a, - 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x0a, - 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x33, - 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x21, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x22, 0x32, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, - 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x18, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x22, 0x7f, 0x0a, 0x07, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x0d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x10, 0x0a, 0x0e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, + 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, + 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, + 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x07, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x51, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x15, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, + 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x72, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x18, 0x0a, 0x16, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x3b, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x22, 0x32, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x13, 0x52, 0x65, 0x61, 0x64, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x27, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x39, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x2d, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x22, 0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 0xa6, 0x04, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x12, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x37, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x13, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06, 0x4c, 0x6f, - 0x67, 0x6f, 0x75, 0x74, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x6f, 0x67, - 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x38, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x22, 0x2d, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, + 0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x93, 0x04, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x06, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x2f, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x35, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x06, 0x4c, 0x6f, + 0x67, 0x6f, 0x75, 0x74, 0x12, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, + 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_proto_users_proto_rawDescOnce sync.Once - file_proto_users_proto_rawDescData = file_proto_users_proto_rawDesc + file_proto_user_proto_rawDescOnce sync.Once + file_proto_user_proto_rawDescData = file_proto_user_proto_rawDesc ) -func file_proto_users_proto_rawDescGZIP() []byte { - file_proto_users_proto_rawDescOnce.Do(func() { - file_proto_users_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_users_proto_rawDescData) +func file_proto_user_proto_rawDescGZIP() []byte { + file_proto_user_proto_rawDescOnce.Do(func() { + file_proto_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_user_proto_rawDescData) }) - return file_proto_users_proto_rawDescData + return file_proto_user_proto_rawDescData } -var file_proto_users_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_proto_users_proto_goTypes = []interface{}{ - (*User)(nil), // 0: users.User - (*Session)(nil), // 1: users.Session - (*CreateRequest)(nil), // 2: users.CreateRequest - (*CreateResponse)(nil), // 3: users.CreateResponse - (*DeleteRequest)(nil), // 4: users.DeleteRequest - (*DeleteResponse)(nil), // 5: users.DeleteResponse - (*ReadRequest)(nil), // 6: users.ReadRequest - (*ReadResponse)(nil), // 7: users.ReadResponse - (*UpdateRequest)(nil), // 8: users.UpdateRequest - (*UpdateResponse)(nil), // 9: users.UpdateResponse - (*UpdatePasswordRequest)(nil), // 10: users.UpdatePasswordRequest - (*UpdatePasswordResponse)(nil), // 11: users.UpdatePasswordResponse - (*SearchRequest)(nil), // 12: users.SearchRequest - (*SearchResponse)(nil), // 13: users.SearchResponse - (*ReadSessionRequest)(nil), // 14: users.ReadSessionRequest - (*ReadSessionResponse)(nil), // 15: users.ReadSessionResponse - (*LoginRequest)(nil), // 16: users.LoginRequest - (*LoginResponse)(nil), // 17: users.LoginResponse - (*LogoutRequest)(nil), // 18: users.LogoutRequest - (*LogoutResponse)(nil), // 19: users.LogoutResponse +var file_proto_user_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_proto_user_proto_goTypes = []interface{}{ + (*Account)(nil), // 0: user.Account + (*Session)(nil), // 1: user.Session + (*CreateRequest)(nil), // 2: user.CreateRequest + (*CreateResponse)(nil), // 3: user.CreateResponse + (*DeleteRequest)(nil), // 4: user.DeleteRequest + (*DeleteResponse)(nil), // 5: user.DeleteResponse + (*ReadRequest)(nil), // 6: user.ReadRequest + (*ReadResponse)(nil), // 7: user.ReadResponse + (*UpdateRequest)(nil), // 8: user.UpdateRequest + (*UpdateResponse)(nil), // 9: user.UpdateResponse + (*UpdatePasswordRequest)(nil), // 10: user.UpdatePasswordRequest + (*UpdatePasswordResponse)(nil), // 11: user.UpdatePasswordResponse + (*SearchRequest)(nil), // 12: user.SearchRequest + (*SearchResponse)(nil), // 13: user.SearchResponse + (*ReadSessionRequest)(nil), // 14: user.ReadSessionRequest + (*ReadSessionResponse)(nil), // 15: user.ReadSessionResponse + (*LoginRequest)(nil), // 16: user.LoginRequest + (*LoginResponse)(nil), // 17: user.LoginResponse + (*LogoutRequest)(nil), // 18: user.LogoutRequest + (*LogoutResponse)(nil), // 19: user.LogoutResponse } -var file_proto_users_proto_depIdxs = []int32{ - 0, // 0: users.ReadResponse.user:type_name -> users.User - 0, // 1: users.SearchResponse.users:type_name -> users.User - 1, // 2: users.ReadSessionResponse.session:type_name -> users.Session - 1, // 3: users.LoginResponse.session:type_name -> users.Session - 2, // 4: users.Users.Create:input_type -> users.CreateRequest - 6, // 5: users.Users.Read:input_type -> users.ReadRequest - 8, // 6: users.Users.Update:input_type -> users.UpdateRequest - 4, // 7: users.Users.Delete:input_type -> users.DeleteRequest - 12, // 8: users.Users.Search:input_type -> users.SearchRequest - 10, // 9: users.Users.UpdatePassword:input_type -> users.UpdatePasswordRequest - 16, // 10: users.Users.Login:input_type -> users.LoginRequest - 18, // 11: users.Users.Logout:input_type -> users.LogoutRequest - 14, // 12: users.Users.ReadSession:input_type -> users.ReadSessionRequest - 3, // 13: users.Users.Create:output_type -> users.CreateResponse - 7, // 14: users.Users.Read:output_type -> users.ReadResponse - 9, // 15: users.Users.Update:output_type -> users.UpdateResponse - 5, // 16: users.Users.Delete:output_type -> users.DeleteResponse - 13, // 17: users.Users.Search:output_type -> users.SearchResponse - 11, // 18: users.Users.UpdatePassword:output_type -> users.UpdatePasswordResponse - 17, // 19: users.Users.Login:output_type -> users.LoginResponse - 19, // 20: users.Users.Logout:output_type -> users.LogoutResponse - 15, // 21: users.Users.ReadSession:output_type -> users.ReadSessionResponse +var file_proto_user_proto_depIdxs = []int32{ + 0, // 0: user.ReadResponse.account:type_name -> user.Account + 0, // 1: user.SearchResponse.accounts:type_name -> user.Account + 1, // 2: user.ReadSessionResponse.session:type_name -> user.Session + 1, // 3: user.LoginResponse.session:type_name -> user.Session + 2, // 4: user.User.Create:input_type -> user.CreateRequest + 6, // 5: user.User.Read:input_type -> user.ReadRequest + 8, // 6: user.User.Update:input_type -> user.UpdateRequest + 4, // 7: user.User.Delete:input_type -> user.DeleteRequest + 12, // 8: user.User.Search:input_type -> user.SearchRequest + 10, // 9: user.User.UpdatePassword:input_type -> user.UpdatePasswordRequest + 16, // 10: user.User.Login:input_type -> user.LoginRequest + 18, // 11: user.User.Logout:input_type -> user.LogoutRequest + 14, // 12: user.User.ReadSession:input_type -> user.ReadSessionRequest + 3, // 13: user.User.Create:output_type -> user.CreateResponse + 7, // 14: user.User.Read:output_type -> user.ReadResponse + 9, // 15: user.User.Update:output_type -> user.UpdateResponse + 5, // 16: user.User.Delete:output_type -> user.DeleteResponse + 13, // 17: user.User.Search:output_type -> user.SearchResponse + 11, // 18: user.User.UpdatePassword:output_type -> user.UpdatePasswordResponse + 17, // 19: user.User.Login:output_type -> user.LoginResponse + 19, // 20: user.User.Logout:output_type -> user.LogoutResponse + 15, // 21: user.User.ReadSession:output_type -> user.ReadSessionResponse 13, // [13:22] is the sub-list for method output_type 4, // [4:13] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name @@ -1273,14 +1304,14 @@ var file_proto_users_proto_depIdxs = []int32{ 0, // [0:4] is the sub-list for field type_name } -func init() { file_proto_users_proto_init() } -func file_proto_users_proto_init() { - if File_proto_users_proto != nil { +func init() { file_proto_user_proto_init() } +func file_proto_user_proto_init() { + if File_proto_user_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_proto_users_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { + file_proto_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Account); i { case 0: return &v.state case 1: @@ -1291,7 +1322,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Session); i { case 0: return &v.state @@ -1303,7 +1334,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateRequest); i { case 0: return &v.state @@ -1315,7 +1346,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateResponse); i { case 0: return &v.state @@ -1327,7 +1358,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteRequest); i { case 0: return &v.state @@ -1339,7 +1370,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteResponse); i { case 0: return &v.state @@ -1351,7 +1382,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadRequest); i { case 0: return &v.state @@ -1363,7 +1394,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadResponse); i { case 0: return &v.state @@ -1375,7 +1406,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateRequest); i { case 0: return &v.state @@ -1387,7 +1418,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateResponse); i { case 0: return &v.state @@ -1399,7 +1430,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePasswordRequest); i { case 0: return &v.state @@ -1411,7 +1442,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePasswordResponse); i { case 0: return &v.state @@ -1423,7 +1454,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchRequest); i { case 0: return &v.state @@ -1435,7 +1466,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchResponse); i { case 0: return &v.state @@ -1447,7 +1478,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadSessionRequest); i { case 0: return &v.state @@ -1459,7 +1490,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadSessionResponse); i { case 0: return &v.state @@ -1471,7 +1502,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginRequest); i { case 0: return &v.state @@ -1483,7 +1514,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginResponse); i { case 0: return &v.state @@ -1495,7 +1526,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogoutRequest); i { case 0: return &v.state @@ -1507,7 +1538,7 @@ func file_proto_users_proto_init() { return nil } } - file_proto_users_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_proto_user_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogoutResponse); i { case 0: return &v.state @@ -1524,18 +1555,18 @@ func file_proto_users_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_users_proto_rawDesc, + RawDescriptor: file_proto_user_proto_rawDesc, NumEnums: 0, NumMessages: 20, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_proto_users_proto_goTypes, - DependencyIndexes: file_proto_users_proto_depIdxs, - MessageInfos: file_proto_users_proto_msgTypes, + GoTypes: file_proto_user_proto_goTypes, + DependencyIndexes: file_proto_user_proto_depIdxs, + MessageInfos: file_proto_user_proto_msgTypes, }.Build() - File_proto_users_proto = out.File - file_proto_users_proto_rawDesc = nil - file_proto_users_proto_goTypes = nil - file_proto_users_proto_depIdxs = nil + File_proto_user_proto = out.File + file_proto_user_proto_rawDesc = nil + file_proto_user_proto_goTypes = nil + file_proto_user_proto_depIdxs = nil } diff --git a/users/proto/users.pb.micro.go b/user/proto/user.pb.micro.go similarity index 55% rename from users/proto/users.pb.micro.go rename to user/proto/user.pb.micro.go index 0e48876..8abd459 100644 --- a/users/proto/users.pb.micro.go +++ b/user/proto/user.pb.micro.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/users.proto +// source: proto/user.proto -package users +package user import ( fmt "fmt" @@ -33,15 +33,15 @@ var _ context.Context var _ client.Option var _ server.Option -// Api Endpoints for Users service +// Api Endpoints for User service -func NewUsersEndpoints() []*api.Endpoint { +func NewUserEndpoints() []*api.Endpoint { return []*api.Endpoint{} } -// Client API for Users service +// Client API for User service -type UsersService interface { +type UserService interface { Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) @@ -53,20 +53,20 @@ type UsersService interface { ReadSession(ctx context.Context, in *ReadSessionRequest, opts ...client.CallOption) (*ReadSessionResponse, error) } -type usersService struct { +type userService struct { c client.Client name string } -func NewUsersService(name string, c client.Client) UsersService { - return &usersService{ +func NewUserService(name string, c client.Client) UserService { + return &userService{ c: c, name: name, } } -func (c *usersService) Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error) { - req := c.c.NewRequest(c.name, "Users.Create", in) +func (c *userService) Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error) { + req := c.c.NewRequest(c.name, "User.Create", in) out := new(CreateResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -75,8 +75,8 @@ func (c *usersService) Create(ctx context.Context, in *CreateRequest, opts ...cl return out, nil } -func (c *usersService) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) { - req := c.c.NewRequest(c.name, "Users.Read", in) +func (c *userService) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) { + req := c.c.NewRequest(c.name, "User.Read", in) out := new(ReadResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -85,8 +85,8 @@ func (c *usersService) Read(ctx context.Context, in *ReadRequest, opts ...client return out, nil } -func (c *usersService) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) { - req := c.c.NewRequest(c.name, "Users.Update", in) +func (c *userService) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) { + req := c.c.NewRequest(c.name, "User.Update", in) out := new(UpdateResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -95,8 +95,8 @@ func (c *usersService) Update(ctx context.Context, in *UpdateRequest, opts ...cl return out, nil } -func (c *usersService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) { - req := c.c.NewRequest(c.name, "Users.Delete", in) +func (c *userService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) { + req := c.c.NewRequest(c.name, "User.Delete", in) out := new(DeleteResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -105,8 +105,8 @@ func (c *usersService) Delete(ctx context.Context, in *DeleteRequest, opts ...cl return out, nil } -func (c *usersService) Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) { - req := c.c.NewRequest(c.name, "Users.Search", in) +func (c *userService) Search(ctx context.Context, in *SearchRequest, opts ...client.CallOption) (*SearchResponse, error) { + req := c.c.NewRequest(c.name, "User.Search", in) out := new(SearchResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -115,8 +115,8 @@ func (c *usersService) Search(ctx context.Context, in *SearchRequest, opts ...cl return out, nil } -func (c *usersService) UpdatePassword(ctx context.Context, in *UpdatePasswordRequest, opts ...client.CallOption) (*UpdatePasswordResponse, error) { - req := c.c.NewRequest(c.name, "Users.UpdatePassword", in) +func (c *userService) UpdatePassword(ctx context.Context, in *UpdatePasswordRequest, opts ...client.CallOption) (*UpdatePasswordResponse, error) { + req := c.c.NewRequest(c.name, "User.UpdatePassword", in) out := new(UpdatePasswordResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -125,8 +125,8 @@ func (c *usersService) UpdatePassword(ctx context.Context, in *UpdatePasswordReq return out, nil } -func (c *usersService) Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error) { - req := c.c.NewRequest(c.name, "Users.Login", in) +func (c *userService) Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error) { + req := c.c.NewRequest(c.name, "User.Login", in) out := new(LoginResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -135,8 +135,8 @@ func (c *usersService) Login(ctx context.Context, in *LoginRequest, opts ...clie return out, nil } -func (c *usersService) Logout(ctx context.Context, in *LogoutRequest, opts ...client.CallOption) (*LogoutResponse, error) { - req := c.c.NewRequest(c.name, "Users.Logout", in) +func (c *userService) Logout(ctx context.Context, in *LogoutRequest, opts ...client.CallOption) (*LogoutResponse, error) { + req := c.c.NewRequest(c.name, "User.Logout", in) out := new(LogoutResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -145,8 +145,8 @@ func (c *usersService) Logout(ctx context.Context, in *LogoutRequest, opts ...cl return out, nil } -func (c *usersService) ReadSession(ctx context.Context, in *ReadSessionRequest, opts ...client.CallOption) (*ReadSessionResponse, error) { - req := c.c.NewRequest(c.name, "Users.ReadSession", in) +func (c *userService) ReadSession(ctx context.Context, in *ReadSessionRequest, opts ...client.CallOption) (*ReadSessionResponse, error) { + req := c.c.NewRequest(c.name, "User.ReadSession", in) out := new(ReadSessionResponse) err := c.c.Call(ctx, req, out, opts...) if err != nil { @@ -155,9 +155,9 @@ func (c *usersService) ReadSession(ctx context.Context, in *ReadSessionRequest, return out, nil } -// Server API for Users service +// Server API for User service -type UsersHandler interface { +type UserHandler interface { Create(context.Context, *CreateRequest, *CreateResponse) error Read(context.Context, *ReadRequest, *ReadResponse) error Update(context.Context, *UpdateRequest, *UpdateResponse) error @@ -169,8 +169,8 @@ type UsersHandler interface { ReadSession(context.Context, *ReadSessionRequest, *ReadSessionResponse) error } -func RegisterUsersHandler(s server.Server, hdlr UsersHandler, opts ...server.HandlerOption) error { - type users interface { +func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption) error { + type user interface { Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error @@ -181,49 +181,49 @@ func RegisterUsersHandler(s server.Server, hdlr UsersHandler, opts ...server.Han Logout(ctx context.Context, in *LogoutRequest, out *LogoutResponse) error ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error } - type Users struct { - users + type User struct { + user } - h := &usersHandler{hdlr} - return s.Handle(s.NewHandler(&Users{h}, opts...)) + h := &userHandler{hdlr} + return s.Handle(s.NewHandler(&User{h}, opts...)) } -type usersHandler struct { - UsersHandler +type userHandler struct { + UserHandler } -func (h *usersHandler) Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error { - return h.UsersHandler.Create(ctx, in, out) +func (h *userHandler) Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error { + return h.UserHandler.Create(ctx, in, out) } -func (h *usersHandler) Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error { - return h.UsersHandler.Read(ctx, in, out) +func (h *userHandler) Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error { + return h.UserHandler.Read(ctx, in, out) } -func (h *usersHandler) Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error { - return h.UsersHandler.Update(ctx, in, out) +func (h *userHandler) Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error { + return h.UserHandler.Update(ctx, in, out) } -func (h *usersHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error { - return h.UsersHandler.Delete(ctx, in, out) +func (h *userHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error { + return h.UserHandler.Delete(ctx, in, out) } -func (h *usersHandler) Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error { - return h.UsersHandler.Search(ctx, in, out) +func (h *userHandler) Search(ctx context.Context, in *SearchRequest, out *SearchResponse) error { + return h.UserHandler.Search(ctx, in, out) } -func (h *usersHandler) UpdatePassword(ctx context.Context, in *UpdatePasswordRequest, out *UpdatePasswordResponse) error { - return h.UsersHandler.UpdatePassword(ctx, in, out) +func (h *userHandler) UpdatePassword(ctx context.Context, in *UpdatePasswordRequest, out *UpdatePasswordResponse) error { + return h.UserHandler.UpdatePassword(ctx, in, out) } -func (h *usersHandler) Login(ctx context.Context, in *LoginRequest, out *LoginResponse) error { - return h.UsersHandler.Login(ctx, in, out) +func (h *userHandler) Login(ctx context.Context, in *LoginRequest, out *LoginResponse) error { + return h.UserHandler.Login(ctx, in, out) } -func (h *usersHandler) Logout(ctx context.Context, in *LogoutRequest, out *LogoutResponse) error { - return h.UsersHandler.Logout(ctx, in, out) +func (h *userHandler) Logout(ctx context.Context, in *LogoutRequest, out *LogoutResponse) error { + return h.UserHandler.Logout(ctx, in, out) } -func (h *usersHandler) ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error { - return h.UsersHandler.ReadSession(ctx, in, out) +func (h *userHandler) ReadSession(ctx context.Context, in *ReadSessionRequest, out *ReadSessionResponse) error { + return h.UserHandler.ReadSession(ctx, in, out) } diff --git a/users/proto/users.proto b/user/proto/user.proto similarity index 54% rename from users/proto/users.proto rename to user/proto/user.proto index b0eb74f..bab2d49 100644 --- a/users/proto/users.proto +++ b/user/proto/user.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package users; +package user; -option go_package = "./proto;users"; +option go_package = "./proto;user"; -service Users { +service User { rpc Create(CreateRequest) returns (CreateResponse) {} rpc Read(ReadRequest) returns (ReadResponse) {} rpc Update(UpdateRequest) returns (UpdateResponse) {} @@ -16,66 +16,95 @@ service Users { rpc ReadSession(ReadSessionRequest) returns(ReadSessionResponse) {} } -message User { - string id = 1; // uuid - string username = 2; // alphanumeric user or org +message Account { + // unique account id + string id = 1; + // alphanumeric username + string username = 2; + // an email address string email = 3; - int64 created = 4; // unix - int64 updated = 5; // unix + // unix timestamp + int64 created = 4; + // unix timestamp + int64 updated = 5; } message Session { - string id = 1; - string username = 2; + // the session id + string id = 1; + // account username + string username = 2; + // account email string email = 3; - int64 created = 4; // unix - int64 expires = 5; // unix + // unix timestamp + int64 created = 4; + // unix timestamp + int64 expires = 5; } +// Create a new user account message CreateRequest { - string id = 1; // uuid - string username = 2; // alphanumeric user or org + // the acccount id + string id = 1; + // the username + string username = 2; + // the email address string email = 3; - string password = 4; + // the user password + string password = 4; } message CreateResponse { } +// Delete an account by id message DeleteRequest { + // the account id string id = 1; } message DeleteResponse { } +// Read an account by id message ReadRequest { + // the account id string id = 1; } message ReadResponse { - User user = 1; + Account account = 1; } +// Update the account username or email message UpdateRequest { - string id = 1; // uuid - string username = 2; // alphanumeric user or org + // the account id + string id = 1; + // the new username + string username = 2; + // the new email address string email = 3; } message UpdateResponse { } +// Update the account password message UpdatePasswordRequest { - string userId = 1; - string oldPassword = 2; - string newPassword = 3; - string confirm_password = 4; + // the account id + string userId = 1; + // the old password + string oldPassword = 2; + // the new password + string newPassword = 3; + // confirm new password + string confirm_password = 4; } message UpdatePasswordResponse { } +// Search for an account message SearchRequest { string username = 1; string email = 2; @@ -84,9 +113,10 @@ message SearchRequest { } message SearchResponse { - repeated User users = 1; + repeated Account accounts = 1; } +// Read a session by id message ReadSessionRequest { string sessionId = 1; } @@ -95,6 +125,8 @@ message ReadSessionResponse { Session session = 1; } + +// Login a user account message LoginRequest { string username = 1; string email = 2; @@ -105,6 +137,7 @@ message LoginResponse { Session session = 1; } +// Logout a user account message LogoutRequest { string sessionId = 1; }