diff --git a/pb/ezshare.pb.go b/pb/ezshare.pb.go index 6b33c3a..6aef848 100644 --- a/pb/ezshare.pb.go +++ b/pb/ezshare.pb.go @@ -21,6 +21,102 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type User_Role int32 + +const ( + User_UNAPPROVED User_Role = 0 + User_VIEWONLY User_Role = 1 + User_USER User_Role = 2 + User_ADMIN User_Role = 3 +) + +// Enum value maps for User_Role. +var ( + User_Role_name = map[int32]string{ + 0: "UNAPPROVED", + 1: "VIEWONLY", + 2: "USER", + 3: "ADMIN", + } + User_Role_value = map[string]int32{ + "UNAPPROVED": 0, + "VIEWONLY": 1, + "USER": 2, + "ADMIN": 3, + } +) + +func (x User_Role) Enum() *User_Role { + p := new(User_Role) + *p = x + return p +} + +func (x User_Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (User_Role) Descriptor() protoreflect.EnumDescriptor { + return file_protos_ezshare_proto_enumTypes[0].Descriptor() +} + +func (User_Role) Type() protoreflect.EnumType { + return &file_protos_ezshare_proto_enumTypes[0] +} + +func (x User_Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use User_Role.Descriptor instead. +func (User_Role) EnumDescriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{10, 0} +} + +///////////////////// +// Common messages // +///////////////////// +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{0} +} + +//////////////////////// +// FILE RELATED STUFF // +//////////////////////// type File struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -34,7 +130,7 @@ type File struct { func (x *File) Reset() { *x = File{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[0] + mi := &file_protos_ezshare_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +143,7 @@ func (x *File) String() string { func (*File) ProtoMessage() {} func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[0] + mi := &file_protos_ezshare_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +156,7 @@ func (x *File) ProtoReflect() protoreflect.Message { // Deprecated: Use File.ProtoReflect.Descriptor instead. func (*File) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{0} + return file_protos_ezshare_proto_rawDescGZIP(), []int{1} } func (x *File) GetFileId() string { @@ -99,7 +195,7 @@ type UploadFileRequest struct { func (x *UploadFileRequest) Reset() { *x = UploadFileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[1] + mi := &file_protos_ezshare_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -112,7 +208,7 @@ func (x *UploadFileRequest) String() string { func (*UploadFileRequest) ProtoMessage() {} func (x *UploadFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[1] + mi := &file_protos_ezshare_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -125,7 +221,7 @@ func (x *UploadFileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadFileRequest.ProtoReflect.Descriptor instead. func (*UploadFileRequest) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{1} + return file_protos_ezshare_proto_rawDescGZIP(), []int{2} } func (x *UploadFileRequest) GetData() []byte { @@ -161,7 +257,7 @@ type UploadFileResponse struct { func (x *UploadFileResponse) Reset() { *x = UploadFileResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[2] + mi := &file_protos_ezshare_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -174,7 +270,7 @@ func (x *UploadFileResponse) String() string { func (*UploadFileResponse) ProtoMessage() {} func (x *UploadFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[2] + mi := &file_protos_ezshare_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -187,7 +283,7 @@ func (x *UploadFileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadFileResponse.ProtoReflect.Descriptor instead. func (*UploadFileResponse) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{2} + return file_protos_ezshare_proto_rawDescGZIP(), []int{3} } func (x *UploadFileResponse) GetId() string { @@ -216,7 +312,7 @@ type GetFileRequest struct { func (x *GetFileRequest) Reset() { *x = GetFileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[3] + mi := &file_protos_ezshare_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -229,7 +325,7 @@ func (x *GetFileRequest) String() string { func (*GetFileRequest) ProtoMessage() {} func (x *GetFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[3] + mi := &file_protos_ezshare_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -242,7 +338,7 @@ func (x *GetFileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFileRequest.ProtoReflect.Descriptor instead. func (*GetFileRequest) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{3} + return file_protos_ezshare_proto_rawDescGZIP(), []int{4} } func (x *GetFileRequest) GetId() string { @@ -263,7 +359,7 @@ type GetFileResponse struct { func (x *GetFileResponse) Reset() { *x = GetFileResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[4] + mi := &file_protos_ezshare_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -276,7 +372,7 @@ func (x *GetFileResponse) String() string { func (*GetFileResponse) ProtoMessage() {} func (x *GetFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[4] + mi := &file_protos_ezshare_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -289,7 +385,7 @@ func (x *GetFileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFileResponse.ProtoReflect.Descriptor instead. func (*GetFileResponse) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{4} + return file_protos_ezshare_proto_rawDescGZIP(), []int{5} } func (x *GetFileResponse) GetFile() *File { @@ -311,7 +407,7 @@ type DeleteFileRequest struct { func (x *DeleteFileRequest) Reset() { *x = DeleteFileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[5] + mi := &file_protos_ezshare_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -324,7 +420,7 @@ func (x *DeleteFileRequest) String() string { func (*DeleteFileRequest) ProtoMessage() {} func (x *DeleteFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[5] + mi := &file_protos_ezshare_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -337,7 +433,7 @@ func (x *DeleteFileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteFileRequest.ProtoReflect.Descriptor instead. func (*DeleteFileRequest) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{5} + return file_protos_ezshare_proto_rawDescGZIP(), []int{6} } func (x *DeleteFileRequest) GetId() string { @@ -356,7 +452,7 @@ type DeleteFileResponse struct { func (x *DeleteFileResponse) Reset() { *x = DeleteFileResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[6] + mi := &file_protos_ezshare_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -369,7 +465,7 @@ func (x *DeleteFileResponse) String() string { func (*DeleteFileResponse) ProtoMessage() {} func (x *DeleteFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[6] + mi := &file_protos_ezshare_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -382,7 +478,7 @@ func (x *DeleteFileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteFileResponse.ProtoReflect.Descriptor instead. func (*DeleteFileResponse) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{6} + return file_protos_ezshare_proto_rawDescGZIP(), []int{7} } // List @@ -395,7 +491,7 @@ type ListFilesRequest struct { func (x *ListFilesRequest) Reset() { *x = ListFilesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[7] + mi := &file_protos_ezshare_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -408,7 +504,7 @@ func (x *ListFilesRequest) String() string { func (*ListFilesRequest) ProtoMessage() {} func (x *ListFilesRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[7] + mi := &file_protos_ezshare_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -421,7 +517,7 @@ func (x *ListFilesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListFilesRequest.ProtoReflect.Descriptor instead. func (*ListFilesRequest) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{7} + return file_protos_ezshare_proto_rawDescGZIP(), []int{8} } type ListFilesResponse struct { @@ -435,7 +531,7 @@ type ListFilesResponse struct { func (x *ListFilesResponse) Reset() { *x = ListFilesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[8] + mi := &file_protos_ezshare_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -448,7 +544,7 @@ func (x *ListFilesResponse) String() string { func (*ListFilesResponse) ProtoMessage() {} func (x *ListFilesResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[8] + mi := &file_protos_ezshare_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -461,7 +557,7 @@ func (x *ListFilesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListFilesResponse.ProtoReflect.Descriptor instead. func (*ListFilesResponse) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{8} + return file_protos_ezshare_proto_rawDescGZIP(), []int{9} } func (x *ListFilesResponse) GetFiles() []*ListFilesResponse_ListFileInfo { @@ -471,6 +567,477 @@ func (x *ListFilesResponse) GetFiles() []*ListFilesResponse_ListFileInfo { return nil } +//////////////////////// +// USER RELATED STUFF // +//////////////////////// +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + HashedPassword []byte `protobuf:"bytes,3,opt,name=hashed_password,json=hashedPassword,proto3" json:"hashed_password,omitempty"` + UserRole User_Role `protobuf:"varint,4,opt,name=user_role,json=userRole,proto3,enum=ezshare.User_Role" json:"user_role,omitempty"` + Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{10} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *User) GetHashedPassword() []byte { + if x != nil { + return x.HashedPassword + } + return nil +} + +func (x *User) GetUserRole() User_Role { + if x != nil { + return x.UserRole + } + return User_UNAPPROVED +} + +func (x *User) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +// Register +type RegisterUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *RegisterUserRequest) Reset() { + *x = RegisterUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterUserRequest) ProtoMessage() {} + +func (x *RegisterUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterUserRequest.ProtoReflect.Descriptor instead. +func (*RegisterUserRequest) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{11} +} + +func (x *RegisterUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *RegisterUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type RegisterUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *RegisterUserResponse) Reset() { + *x = RegisterUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterUserResponse) ProtoMessage() {} + +func (x *RegisterUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterUserResponse.ProtoReflect.Descriptor instead. +func (*RegisterUserResponse) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{12} +} + +func (x *RegisterUserResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *RegisterUserResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// Login +type LoginUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to RequestedLogin: + // *LoginUserRequest_WithToken + // *LoginUserRequest_WithPassword + RequestedLogin isLoginUserRequest_RequestedLogin `protobuf_oneof:"requested_login"` +} + +func (x *LoginUserRequest) Reset() { + *x = LoginUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserRequest) ProtoMessage() {} + +func (x *LoginUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserRequest.ProtoReflect.Descriptor instead. +func (*LoginUserRequest) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{13} +} + +func (m *LoginUserRequest) GetRequestedLogin() isLoginUserRequest_RequestedLogin { + if m != nil { + return m.RequestedLogin + } + return nil +} + +func (x *LoginUserRequest) GetWithToken() *LoginUserRequest_TokenLogin { + if x, ok := x.GetRequestedLogin().(*LoginUserRequest_WithToken); ok { + return x.WithToken + } + return nil +} + +func (x *LoginUserRequest) GetWithPassword() *LoginUserRequest_UserPasswordLogin { + if x, ok := x.GetRequestedLogin().(*LoginUserRequest_WithPassword); ok { + return x.WithPassword + } + return nil +} + +type isLoginUserRequest_RequestedLogin interface { + isLoginUserRequest_RequestedLogin() +} + +type LoginUserRequest_WithToken struct { + WithToken *LoginUserRequest_TokenLogin `protobuf:"bytes,1,opt,name=with_token,json=withToken,proto3,oneof"` +} + +type LoginUserRequest_WithPassword struct { + WithPassword *LoginUserRequest_UserPasswordLogin `protobuf:"bytes,2,opt,name=with_password,json=withPassword,proto3,oneof"` +} + +func (*LoginUserRequest_WithToken) isLoginUserRequest_RequestedLogin() {} + +func (*LoginUserRequest_WithPassword) isLoginUserRequest_RequestedLogin() {} + +type LoginUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerCert []byte `protobuf:"bytes,1,opt,name=server_cert,json=serverCert,proto3" json:"server_cert,omitempty"` + ClientCert []byte `protobuf:"bytes,2,opt,name=client_cert,json=clientCert,proto3" json:"client_cert,omitempty"` + ClientKey []byte `protobuf:"bytes,3,opt,name=client_key,json=clientKey,proto3" json:"client_key,omitempty"` +} + +func (x *LoginUserResponse) Reset() { + *x = LoginUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserResponse) ProtoMessage() {} + +func (x *LoginUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserResponse.ProtoReflect.Descriptor instead. +func (*LoginUserResponse) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{14} +} + +func (x *LoginUserResponse) GetServerCert() []byte { + if x != nil { + return x.ServerCert + } + return nil +} + +func (x *LoginUserResponse) GetClientCert() []byte { + if x != nil { + return x.ClientCert + } + return nil +} + +func (x *LoginUserResponse) GetClientKey() []byte { + if x != nil { + return x.ClientKey + } + return nil +} + +// List +type ListUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListUsersRequest) Reset() { + *x = ListUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersRequest) ProtoMessage() {} + +func (x *ListUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead. +func (*ListUsersRequest) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{15} +} + +type ListUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *ListUsersResponse) Reset() { + *x = ListUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersResponse) ProtoMessage() {} + +func (x *ListUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead. +func (*ListUsersResponse) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{16} +} + +func (x *ListUsersResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +// Approve +type ApproveUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` +} + +func (x *ApproveUserRequest) Reset() { + *x = ApproveUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApproveUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveUserRequest) ProtoMessage() {} + +func (x *ApproveUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveUserRequest.ProtoReflect.Descriptor instead. +func (*ApproveUserRequest) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{17} +} + +func (x *ApproveUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + type File_Metadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -484,7 +1051,7 @@ type File_Metadata struct { func (x *File_Metadata) Reset() { *x = File_Metadata{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[9] + mi := &file_protos_ezshare_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -497,7 +1064,7 @@ func (x *File_Metadata) String() string { func (*File_Metadata) ProtoMessage() {} func (x *File_Metadata) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[9] + mi := &file_protos_ezshare_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -510,7 +1077,7 @@ func (x *File_Metadata) ProtoReflect() protoreflect.Message { // Deprecated: Use File_Metadata.ProtoReflect.Descriptor instead. func (*File_Metadata) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{0, 0} + return file_protos_ezshare_proto_rawDescGZIP(), []int{1, 0} } func (x *File_Metadata) GetUploadedOn() *timestamppb.Timestamp { @@ -546,7 +1113,7 @@ type ListFilesResponse_ListFileInfo struct { func (x *ListFilesResponse_ListFileInfo) Reset() { *x = ListFilesResponse_ListFileInfo{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ezshare_proto_msgTypes[10] + mi := &file_protos_ezshare_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -559,7 +1126,7 @@ func (x *ListFilesResponse_ListFileInfo) String() string { func (*ListFilesResponse_ListFileInfo) ProtoMessage() {} func (x *ListFilesResponse_ListFileInfo) ProtoReflect() protoreflect.Message { - mi := &file_protos_ezshare_proto_msgTypes[10] + mi := &file_protos_ezshare_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -572,7 +1139,7 @@ func (x *ListFilesResponse_ListFileInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ListFilesResponse_ListFileInfo.ProtoReflect.Descriptor instead. func (*ListFilesResponse_ListFileInfo) Descriptor() ([]byte, []int) { - return file_protos_ezshare_proto_rawDescGZIP(), []int{8, 0} + return file_protos_ezshare_proto_rawDescGZIP(), []int{9, 0} } func (x *ListFilesResponse_ListFileInfo) GetFileId() string { @@ -589,6 +1156,108 @@ func (x *ListFilesResponse_ListFileInfo) GetMetadata() *File_Metadata { return nil } +type LoginUserRequest_UserPasswordLogin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *LoginUserRequest_UserPasswordLogin) Reset() { + *x = LoginUserRequest_UserPasswordLogin{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserRequest_UserPasswordLogin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserRequest_UserPasswordLogin) ProtoMessage() {} + +func (x *LoginUserRequest_UserPasswordLogin) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserRequest_UserPasswordLogin.ProtoReflect.Descriptor instead. +func (*LoginUserRequest_UserPasswordLogin) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *LoginUserRequest_UserPasswordLogin) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginUserRequest_UserPasswordLogin) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type LoginUserRequest_TokenLogin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *LoginUserRequest_TokenLogin) Reset() { + *x = LoginUserRequest_TokenLogin{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_ezshare_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserRequest_TokenLogin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserRequest_TokenLogin) ProtoMessage() {} + +func (x *LoginUserRequest_TokenLogin) ProtoReflect() protoreflect.Message { + mi := &file_protos_ezshare_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserRequest_TokenLogin.ProtoReflect.Descriptor instead. +func (*LoginUserRequest_TokenLogin) Descriptor() ([]byte, []int) { + return file_protos_ezshare_proto_rawDescGZIP(), []int{13, 1} +} + +func (x *LoginUserRequest_TokenLogin) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + var File_protos_ezshare_proto protoreflect.FileDescriptor var file_protos_ezshare_proto_rawDesc = []byte{ @@ -596,80 +1265,156 @@ var file_protos_ezshare_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x99, 0x02, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xaf, 0x01, 0x0a, 0x08, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x65, 0x64, 0x4f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x4f, 0x6e, 0x12, + 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x99, 0x02, 0x0a, 0x04, 0x46, 0x69, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x1a, 0xaf, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x4f, 0x6e, 0x12, 0x39, 0x0a, + 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x4f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8f, 0x01, 0x0a, - 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x4f, 0x6e, 0x22, 0x3f, - 0x0a, 0x12, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x75, 0x72, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x22, - 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 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, 0x34, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x46, 0x69, 0x6c, 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, 0x14, 0x0a, 0x12, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaf, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x05, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x7a, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x0c, 0x4c, - 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, - 0x6c, 0x65, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0xa5, 0x02, 0x0a, 0x0b, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x65, - 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, - 0x1a, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x7a, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x4c, 0x69, - 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x65, 0x61, 0x2e, 0x62, 0x65, 0x6e, 0x6e, 0x79, 0x2e, - 0x64, 0x6f, 0x67, 0x2f, 0x74, 0x6f, 0x72, 0x6a, 0x75, 0x73, 0x2f, 0x65, 0x7a, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x73, 0x4f, 0x6e, 0x22, 0x3f, 0x0a, 0x12, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, + 0x69, 0x6c, 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, 0x34, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, + 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x65, 0x7a, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, + 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 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, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, + 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x4c, + 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0xaf, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x32, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x22, 0xdf, 0x01, 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, 0x27, 0x0a, 0x0f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, + 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0e, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x2f, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x39, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0c, 0x0a, 0x08, 0x56, 0x49, 0x45, 0x57, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x08, + 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, + 0x4e, 0x10, 0x03, 0x22, 0x4d, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, + 0x73, 0x65, 0x72, 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, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x22, 0x3c, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0xb1, 0x02, 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x65, 0x7a, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x48, + 0x00, 0x52, 0x09, 0x77, 0x69, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x52, 0x0a, 0x0d, + 0x77, 0x69, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x48, 0x00, 0x52, 0x0c, 0x77, 0x69, 0x74, 0x68, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x1a, 0x4b, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 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, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x22, 0x0a, + 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x74, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x38, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x2d, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x32, 0xa5, 0x02, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x3e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x65, 0x7a, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x47, + 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x47, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a, + 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, + 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x7a, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, + 0x95, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x49, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x65, 0x7a, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x7a, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x05, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, + 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x04, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x19, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1a, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x38, 0x0a, + 0x07, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x65, 0x61, + 0x2e, 0x62, 0x65, 0x6e, 0x6e, 0x79, 0x2e, 0x64, 0x6f, 0x67, 0x2f, 0x74, 0x6f, 0x72, 0x6a, 0x75, + 0x73, 0x2f, 0x65, 0x7a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -684,42 +1429,67 @@ func file_protos_ezshare_proto_rawDescGZIP() []byte { return file_protos_ezshare_proto_rawDescData } -var file_protos_ezshare_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_protos_ezshare_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_protos_ezshare_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_protos_ezshare_proto_goTypes = []interface{}{ - (*File)(nil), // 0: ezshare.File - (*UploadFileRequest)(nil), // 1: ezshare.UploadFileRequest - (*UploadFileResponse)(nil), // 2: ezshare.UploadFileResponse - (*GetFileRequest)(nil), // 3: ezshare.GetFileRequest - (*GetFileResponse)(nil), // 4: ezshare.GetFileResponse - (*DeleteFileRequest)(nil), // 5: ezshare.DeleteFileRequest - (*DeleteFileResponse)(nil), // 6: ezshare.DeleteFileResponse - (*ListFilesRequest)(nil), // 7: ezshare.ListFilesRequest - (*ListFilesResponse)(nil), // 8: ezshare.ListFilesResponse - (*File_Metadata)(nil), // 9: ezshare.File.Metadata - (*ListFilesResponse_ListFileInfo)(nil), // 10: ezshare.ListFilesResponse.ListFileInfo - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (User_Role)(0), // 0: ezshare.User.Role + (*Empty)(nil), // 1: ezshare.Empty + (*File)(nil), // 2: ezshare.File + (*UploadFileRequest)(nil), // 3: ezshare.UploadFileRequest + (*UploadFileResponse)(nil), // 4: ezshare.UploadFileResponse + (*GetFileRequest)(nil), // 5: ezshare.GetFileRequest + (*GetFileResponse)(nil), // 6: ezshare.GetFileResponse + (*DeleteFileRequest)(nil), // 7: ezshare.DeleteFileRequest + (*DeleteFileResponse)(nil), // 8: ezshare.DeleteFileResponse + (*ListFilesRequest)(nil), // 9: ezshare.ListFilesRequest + (*ListFilesResponse)(nil), // 10: ezshare.ListFilesResponse + (*User)(nil), // 11: ezshare.User + (*RegisterUserRequest)(nil), // 12: ezshare.RegisterUserRequest + (*RegisterUserResponse)(nil), // 13: ezshare.RegisterUserResponse + (*LoginUserRequest)(nil), // 14: ezshare.LoginUserRequest + (*LoginUserResponse)(nil), // 15: ezshare.LoginUserResponse + (*ListUsersRequest)(nil), // 16: ezshare.ListUsersRequest + (*ListUsersResponse)(nil), // 17: ezshare.ListUsersResponse + (*ApproveUserRequest)(nil), // 18: ezshare.ApproveUserRequest + (*File_Metadata)(nil), // 19: ezshare.File.Metadata + (*ListFilesResponse_ListFileInfo)(nil), // 20: ezshare.ListFilesResponse.ListFileInfo + (*LoginUserRequest_UserPasswordLogin)(nil), // 21: ezshare.LoginUserRequest.UserPasswordLogin + (*LoginUserRequest_TokenLogin)(nil), // 22: ezshare.LoginUserRequest.TokenLogin + (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp } var file_protos_ezshare_proto_depIdxs = []int32{ - 9, // 0: ezshare.File.metadata:type_name -> ezshare.File.Metadata - 11, // 1: ezshare.UploadFileRequest.expires_on:type_name -> google.protobuf.Timestamp - 0, // 2: ezshare.GetFileResponse.file:type_name -> ezshare.File - 10, // 3: ezshare.ListFilesResponse.files:type_name -> ezshare.ListFilesResponse.ListFileInfo - 11, // 4: ezshare.File.Metadata.uploaded_on:type_name -> google.protobuf.Timestamp - 11, // 5: ezshare.File.Metadata.expires_on:type_name -> google.protobuf.Timestamp - 9, // 6: ezshare.ListFilesResponse.ListFileInfo.metadata:type_name -> ezshare.File.Metadata - 1, // 7: ezshare.FileService.UploadFile:input_type -> ezshare.UploadFileRequest - 3, // 8: ezshare.FileService.GetFile:input_type -> ezshare.GetFileRequest - 5, // 9: ezshare.FileService.DeleteFile:input_type -> ezshare.DeleteFileRequest - 7, // 10: ezshare.FileService.ListFiles:input_type -> ezshare.ListFilesRequest - 2, // 11: ezshare.FileService.UploadFile:output_type -> ezshare.UploadFileResponse - 4, // 12: ezshare.FileService.GetFile:output_type -> ezshare.GetFileResponse - 6, // 13: ezshare.FileService.DeleteFile:output_type -> ezshare.DeleteFileResponse - 8, // 14: ezshare.FileService.ListFiles:output_type -> ezshare.ListFilesResponse - 11, // [11:15] is the sub-list for method output_type - 7, // [7:11] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 19, // 0: ezshare.File.metadata:type_name -> ezshare.File.Metadata + 23, // 1: ezshare.UploadFileRequest.expires_on:type_name -> google.protobuf.Timestamp + 2, // 2: ezshare.GetFileResponse.file:type_name -> ezshare.File + 20, // 3: ezshare.ListFilesResponse.files:type_name -> ezshare.ListFilesResponse.ListFileInfo + 0, // 4: ezshare.User.user_role:type_name -> ezshare.User.Role + 22, // 5: ezshare.LoginUserRequest.with_token:type_name -> ezshare.LoginUserRequest.TokenLogin + 21, // 6: ezshare.LoginUserRequest.with_password:type_name -> ezshare.LoginUserRequest.UserPasswordLogin + 11, // 7: ezshare.ListUsersResponse.users:type_name -> ezshare.User + 23, // 8: ezshare.File.Metadata.uploaded_on:type_name -> google.protobuf.Timestamp + 23, // 9: ezshare.File.Metadata.expires_on:type_name -> google.protobuf.Timestamp + 19, // 10: ezshare.ListFilesResponse.ListFileInfo.metadata:type_name -> ezshare.File.Metadata + 3, // 11: ezshare.FileService.UploadFile:input_type -> ezshare.UploadFileRequest + 5, // 12: ezshare.FileService.GetFile:input_type -> ezshare.GetFileRequest + 7, // 13: ezshare.FileService.DeleteFile:input_type -> ezshare.DeleteFileRequest + 9, // 14: ezshare.FileService.ListFiles:input_type -> ezshare.ListFilesRequest + 12, // 15: ezshare.UserService.Register:input_type -> ezshare.RegisterUserRequest + 14, // 16: ezshare.UserService.Login:input_type -> ezshare.LoginUserRequest + 16, // 17: ezshare.UserService.List:input_type -> ezshare.ListUsersRequest + 18, // 18: ezshare.UserService.Approve:input_type -> ezshare.ApproveUserRequest + 4, // 19: ezshare.FileService.UploadFile:output_type -> ezshare.UploadFileResponse + 6, // 20: ezshare.FileService.GetFile:output_type -> ezshare.GetFileResponse + 8, // 21: ezshare.FileService.DeleteFile:output_type -> ezshare.DeleteFileResponse + 10, // 22: ezshare.FileService.ListFiles:output_type -> ezshare.ListFilesResponse + 13, // 23: ezshare.UserService.Register:output_type -> ezshare.RegisterUserResponse + 15, // 24: ezshare.UserService.Login:output_type -> ezshare.LoginUserResponse + 17, // 25: ezshare.UserService.List:output_type -> ezshare.ListUsersResponse + 1, // 26: ezshare.UserService.Approve:output_type -> ezshare.Empty + 19, // [19:27] is the sub-list for method output_type + 11, // [11:19] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_protos_ezshare_proto_init() } @@ -729,7 +1499,7 @@ func file_protos_ezshare_proto_init() { } if !protoimpl.UnsafeEnabled { file_protos_ezshare_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -741,7 +1511,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadFileRequest); i { + switch v := v.(*File); i { case 0: return &v.state case 1: @@ -753,7 +1523,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadFileResponse); i { + switch v := v.(*UploadFileRequest); i { case 0: return &v.state case 1: @@ -765,7 +1535,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFileRequest); i { + switch v := v.(*UploadFileResponse); i { case 0: return &v.state case 1: @@ -777,7 +1547,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFileResponse); i { + switch v := v.(*GetFileRequest); i { case 0: return &v.state case 1: @@ -789,7 +1559,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteFileRequest); i { + switch v := v.(*GetFileResponse); i { case 0: return &v.state case 1: @@ -801,7 +1571,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteFileResponse); i { + switch v := v.(*DeleteFileRequest); i { case 0: return &v.state case 1: @@ -813,7 +1583,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListFilesRequest); i { + switch v := v.(*DeleteFileResponse); i { case 0: return &v.state case 1: @@ -825,7 +1595,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListFilesResponse); i { + switch v := v.(*ListFilesRequest); i { case 0: return &v.state case 1: @@ -837,7 +1607,7 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File_Metadata); i { + switch v := v.(*ListFilesResponse); i { case 0: return &v.state case 1: @@ -849,6 +1619,114 @@ func file_protos_ezshare_proto_init() { } } file_protos_ezshare_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUsersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUsersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApproveUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*File_Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListFilesResponse_ListFileInfo); i { case 0: return &v.state @@ -860,19 +1738,48 @@ func file_protos_ezshare_proto_init() { return nil } } + file_protos_ezshare_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserRequest_UserPasswordLogin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_ezshare_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserRequest_TokenLogin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_protos_ezshare_proto_msgTypes[13].OneofWrappers = []interface{}{ + (*LoginUserRequest_WithToken)(nil), + (*LoginUserRequest_WithPassword)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_ezshare_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, + NumEnums: 1, + NumMessages: 22, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_protos_ezshare_proto_goTypes, DependencyIndexes: file_protos_ezshare_proto_depIdxs, + EnumInfos: file_protos_ezshare_proto_enumTypes, MessageInfos: file_protos_ezshare_proto_msgTypes, }.Build() File_protos_ezshare_proto = out.File diff --git a/pb/ezshare_grpc.pb.go b/pb/ezshare_grpc.pb.go index 6dad9ba..4133765 100644 --- a/pb/ezshare_grpc.pb.go +++ b/pb/ezshare_grpc.pb.go @@ -207,3 +207,197 @@ var FileService_ServiceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "protos/ezshare.proto", } + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + Register(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) + Login(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) + List(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) + Approve(ctx context.Context, in *ApproveUserRequest, opts ...grpc.CallOption) (*Empty, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) Register(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) { + out := new(RegisterUserResponse) + err := c.cc.Invoke(ctx, "/ezshare.UserService/Register", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) Login(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) { + out := new(LoginUserResponse) + err := c.cc.Invoke(ctx, "/ezshare.UserService/Login", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) List(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) { + out := new(ListUsersResponse) + err := c.cc.Invoke(ctx, "/ezshare.UserService/List", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) Approve(ctx context.Context, in *ApproveUserRequest, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/ezshare.UserService/Approve", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + Register(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) + Login(context.Context, *LoginUserRequest) (*LoginUserResponse, error) + List(context.Context, *ListUsersRequest) (*ListUsersResponse, error) + Approve(context.Context, *ApproveUserRequest) (*Empty, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) Register(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") +} +func (UnimplementedUserServiceServer) Login(context.Context, *LoginUserRequest) (*LoginUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedUserServiceServer) List(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedUserServiceServer) Approve(context.Context, *ApproveUserRequest) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Approve not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ezshare.UserService/Register", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).Register(ctx, req.(*RegisterUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ezshare.UserService/Login", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).Login(ctx, req.(*LoginUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ezshare.UserService/List", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).List(ctx, req.(*ListUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_Approve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApproveUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).Approve(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ezshare.UserService/Approve", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).Approve(ctx, req.(*ApproveUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ezshare.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Register", + Handler: _UserService_Register_Handler, + }, + { + MethodName: "Login", + Handler: _UserService_Login_Handler, + }, + { + MethodName: "List", + Handler: _UserService_List_Handler, + }, + { + MethodName: "Approve", + Handler: _UserService_Approve_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "protos/ezshare.proto", +} diff --git a/protos/ezshare.proto b/protos/ezshare.proto index 35de631..8473c39 100644 --- a/protos/ezshare.proto +++ b/protos/ezshare.proto @@ -1,11 +1,18 @@ syntax = "proto3"; - -option go_package = "gitea.benny.dog/torjus/ezshare/pb"; package ezshare; - import "google/protobuf/timestamp.proto"; +option go_package = "gitea.benny.dog/torjus/ezshare/pb"; + +///////////////////// +// Common messages // +///////////////////// +message Empty {} + +//////////////////////// +// FILE RELATED STUFF // +//////////////////////// message File { string file_id = 1; bytes data = 2; @@ -62,4 +69,71 @@ service FileService { rpc GetFile(GetFileRequest) returns (GetFileResponse) {} rpc DeleteFile(DeleteFileRequest) returns (DeleteFileResponse) {} rpc ListFiles(ListFilesRequest) returns (ListFilesResponse) {} -} \ No newline at end of file +} + +//////////////////////// +// USER RELATED STUFF // +//////////////////////// +message User { + string id = 1; + string username = 2; + bytes hashed_password = 3; + enum Role { + UNAPPROVED = 0; + VIEWONLY = 1; + USER = 2; + ADMIN = 3; + } + Role user_role = 4; + bool active = 5; +} + +// Register +message RegisterUserRequest { + string username = 1; + string password = 2; +} +message RegisterUserResponse { + string id = 1; + string token = 2; +} + +// Login +message LoginUserRequest { + message UserPasswordLogin { + string username = 1; + string password = 2; + } + message TokenLogin { + string token = 1; + } + + oneof requested_login { + TokenLogin with_token = 1; + UserPasswordLogin with_password = 2; + } +} +message LoginUserResponse { + bytes server_cert = 1; + bytes client_cert = 2; + bytes client_key = 3; +} + +// List +message ListUsersRequest { +} +message ListUsersResponse { + repeated User users = 1; +} + +// Approve +message ApproveUserRequest { + string user_id = 1; +} + +service UserService { + rpc Register(RegisterUserRequest) returns (RegisterUserResponse) {} + rpc Login(LoginUserRequest) returns (LoginUserResponse) {} + rpc List(ListUsersRequest) returns (ListUsersResponse) {} + rpc Approve(ApproveUserRequest) returns (Empty) {} +} diff --git a/store/bolt.go b/store/bolt.go index d1be574..7003dce 100644 --- a/store/bolt.go +++ b/store/bolt.go @@ -20,6 +20,7 @@ type BoltStore struct { var bktKey = []byte("files") var bktKeyCerts = []byte("certs") var bktKeyKeys = []byte("keys") +var bktKeyUsers = []byte("users") func NewBoltStore(path string) (*BoltStore, error) { s := &BoltStore{} @@ -38,7 +39,9 @@ func NewBoltStore(path string) (*BoltStore, error) { if _, err := t.CreateBucketIfNotExists(bktKeyKeys); err != nil { return err } - + if _, err := t.CreateBucketIfNotExists(bktKeyUsers); err != nil { + return err + } return nil }) if err != nil { @@ -188,14 +191,53 @@ func (s *BoltStore) ListCertificates() ([]string, error) { var ids []string err := s.db.View(func(tx *bolt.Tx) error { bkt := tx.Bucket(bktKeyCerts) - bkt.ForEach(func(k, v []byte) error { + return bkt.ForEach(func(k, v []byte) error { ids = append(ids, string(k)) return nil }) - return nil }) if err != nil { return nil, err } return ids, nil } + +func (s *BoltStore) StoreUser(user *pb.User) error { + return s.db.Update(func(tx *bolt.Tx) error { + bkt := tx.Bucket(bktKeyUsers) + data, err := proto.Marshal(user) + if err != nil { + return err + } + return bkt.Put([]byte(user.Id), data) + }) +} + +func (s *BoltStore) GetUser(id string) (*pb.User, error) { + var data []byte + err := s.db.View(func(tx *bolt.Tx) error { + bkt := tx.Bucket(bktKeyUsers) + data = bkt.Get([]byte(id)) + return nil + }) + if err != nil { + return nil, err + } + + var user pb.User + err = proto.Unmarshal(data, &user) + return &user, err +} + +func (s *BoltStore) ListUsers() ([]string, error) { + var ids []string + err := s.db.View(func(tx *bolt.Tx) error { + bkt := tx.Bucket(bktKeyUsers) + return bkt.ForEach(func(k, _ []byte) error { + ids = append(ids, string(k)) + return nil + }) + }) + + return ids, err +} diff --git a/store/bolt_test.go b/store/bolt_test.go index 5c32414..c34048f 100644 --- a/store/bolt_test.go +++ b/store/bolt_test.go @@ -10,19 +10,29 @@ import ( func TestBoltStore(t *testing.T) { path := filepath.Join(t.TempDir(), "boltstore.db") s, err := store.NewBoltStore(path) + defer s.Close() if err != nil { t.Fatalf("Error opening store: %s", err) } doFileStoreTest(s, t) - _ = s.Close() } func TestBoltCertificateStore(t *testing.T) { path := filepath.Join(t.TempDir(), "boltstore.db") s, err := store.NewBoltStore(path) + defer s.Close() if err != nil { t.Fatalf("Error opening store: %s", err) } doCertificateStoreTest(s, t) - _ = s.Close() +} + +func TestBoltUserStore(t *testing.T) { + path := filepath.Join(t.TempDir(), "boltstore.db") + s, err := store.NewBoltStore(path) + defer s.Close() + if err != nil { + t.Fatalf("Error opening store: %s", err) + } + doUserStoreTests(s, t) } diff --git a/store/memory.go b/store/memory.go index f544885..005e63b 100644 --- a/store/memory.go +++ b/store/memory.go @@ -9,9 +9,6 @@ import ( "github.com/google/uuid" ) -var _ FileStore = &MemoryStore{} -var _ CertificateStore = &MemoryStore{} - type MemoryStore struct { filesLock sync.RWMutex files map[string]*pb.File @@ -19,6 +16,8 @@ type MemoryStore struct { certs map[string][]byte keyLock sync.RWMutex keys map[string][]byte + usersLock sync.RWMutex + users map[string]*pb.User } func NewMemoryStore() *MemoryStore { @@ -26,9 +25,16 @@ func NewMemoryStore() *MemoryStore { files: make(map[string]*pb.File), certs: make(map[string][]byte), keys: make(map[string][]byte), + users: make(map[string]*pb.User), } } +/////////////// +// FileStore // +/////////////// + +var _ FileStore = &MemoryStore{} + func (s *MemoryStore) GetFile(id string) (*pb.File, error) { s.filesLock.RLock() defer s.filesLock.RUnlock() @@ -76,6 +82,12 @@ func (s *MemoryStore) ListFiles() ([]*pb.ListFilesResponse_ListFileInfo, error) return response, nil } +////////////////////// +// CertificateStore // +////////////////////// + +var _ CertificateStore = &MemoryStore{} + func (s *MemoryStore) GetCertificate(id string) (*x509.Certificate, error) { s.certLock.Lock() defer s.certLock.Unlock() @@ -134,3 +146,39 @@ func (s *MemoryStore) ListCertificates() ([]string, error) { } return certIDs, nil } + +/////////////// +// UserStore // +/////////////// + +var _ UserStore = &MemoryStore{} + +func (s *MemoryStore) StoreUser(user *pb.User) error { + s.usersLock.Lock() + defer s.usersLock.Unlock() + + s.users[user.Id] = user + return nil +} + +func (s *MemoryStore) GetUser(id string) (*pb.User, error) { + s.usersLock.RLock() + defer s.usersLock.RUnlock() + user, ok := s.users[id] + if !ok { + // TODO: Update error + return nil, ErrNoSuchFile + } + return user, nil +} + +func (s *MemoryStore) ListUsers() ([]string, error) { + s.usersLock.RLock() + defer s.usersLock.RUnlock() + + var ids []string + for id := range s.users { + ids = append(ids, id) + } + return ids, nil +} diff --git a/store/memory_test.go b/store/memory_test.go index 4e742ae..287051c 100644 --- a/store/memory_test.go +++ b/store/memory_test.go @@ -14,3 +14,8 @@ func TestMemoryCertificateStore(t *testing.T) { s := store.NewMemoryStore() doCertificateStoreTest(s, t) } + +func TestMemoryUserStore(t *testing.T) { + s := store.NewMemoryStore() + doUserStoreTests(s, t) +} diff --git a/store/store.go b/store/store.go index f771ada..a439b3c 100644 --- a/store/store.go +++ b/store/store.go @@ -24,3 +24,9 @@ type CertificateStore interface { StoreKey(id string, key *ecdsa.PrivateKey) error ListCertificates() ([]string, error) } + +type UserStore interface { + StoreUser(user *pb.User) error + GetUser(id string) (*pb.User, error) + ListUsers() ([]string, error) +} diff --git a/store/store_test.go b/store/store_test.go index bf138d2..b778150 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -6,6 +6,8 @@ import ( "crypto/rand" "crypto/x509" "crypto/x509/pkix" + "github.com/google/uuid" + "google.golang.org/protobuf/proto" "math/big" "testing" "time" @@ -140,3 +142,39 @@ func doCertificateStoreTest(s store.CertificateStore, t *testing.T) { } }) } + +func doUserStoreTests(s store.UserStore, t *testing.T) { + t.Run("Basics", func(t *testing.T) { + // Store user + user := &pb.User{ + Id: uuid.Must(uuid.NewRandom()).String(), + Username: "testuser", + UserRole: pb.User_USER, + Active: true, + } + + if err := s.StoreUser(user); err != nil { + t.Fatalf("Error storing user: %s", err) + } + + retrieved, err := s.GetUser(user.Id) + if err != nil { + t.Fatalf("Retriving user returned error: %s", err) + } + + if !proto.Equal(user, retrieved) { + t.Fatalf("Retrieved user does not match original") + } + + list, err := s.ListUsers() + if err != nil { + t.Fatalf("Error listing users") + } + if len(list) != 1 { + t.Fatalf("User list wrong length") + } + if list[0] != user.Id { + t.Fatalf("User list has wrong id") + } + }) +}