Browse Source

Implement logout

master
parent
commit
278fbdc462
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 436
      proto/users.pb.go
  2. 9
      proto/users.proto
  3. 37
      proto/users_grpc.pb.go
  4. 16
      server/server.go

436
proto/users.pb.go

@ -419,6 +419,91 @@ func (x *LoginResponse) GetToken() *UserToken {
return nil return nil
} }
type LogoutRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Token *UserToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *LogoutRequest) Reset() {
*x = LogoutRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LogoutRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LogoutRequest) ProtoMessage() {}
func (x *LogoutRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.
func (*LogoutRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{8}
}
func (x *LogoutRequest) GetToken() *UserToken {
if x != nil {
return x.Token
}
return nil
}
type LogoutResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *LogoutResponse) Reset() {
*x = LogoutResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LogoutResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LogoutResponse) ProtoMessage() {}
func (x *LogoutResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead.
func (*LogoutResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{9}
}
type AuthorizeRequest struct { type AuthorizeRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -431,7 +516,7 @@ type AuthorizeRequest struct {
func (x *AuthorizeRequest) Reset() { func (x *AuthorizeRequest) Reset() {
*x = AuthorizeRequest{} *x = AuthorizeRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[8]
mi := &file_proto_users_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -444,7 +529,7 @@ func (x *AuthorizeRequest) String() string {
func (*AuthorizeRequest) ProtoMessage() {} func (*AuthorizeRequest) ProtoMessage() {}
func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message { func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[8]
mi := &file_proto_users_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -457,7 +542,7 @@ func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AuthorizeRequest.ProtoReflect.Descriptor instead. // Deprecated: Use AuthorizeRequest.ProtoReflect.Descriptor instead.
func (*AuthorizeRequest) Descriptor() ([]byte, []int) { func (*AuthorizeRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{8}
return file_proto_users_proto_rawDescGZIP(), []int{10}
} }
func (x *AuthorizeRequest) GetSecret() string { func (x *AuthorizeRequest) GetSecret() string {
@ -486,7 +571,7 @@ type AuthorizeResponse struct {
func (x *AuthorizeResponse) Reset() { func (x *AuthorizeResponse) Reset() {
*x = AuthorizeResponse{} *x = AuthorizeResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[9]
mi := &file_proto_users_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -499,7 +584,7 @@ func (x *AuthorizeResponse) String() string {
func (*AuthorizeResponse) ProtoMessage() {} func (*AuthorizeResponse) ProtoMessage() {}
func (x *AuthorizeResponse) ProtoReflect() protoreflect.Message { func (x *AuthorizeResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[9]
mi := &file_proto_users_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -512,7 +597,7 @@ func (x *AuthorizeResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use AuthorizeResponse.ProtoReflect.Descriptor instead. // Deprecated: Use AuthorizeResponse.ProtoReflect.Descriptor instead.
func (*AuthorizeResponse) Descriptor() ([]byte, []int) { func (*AuthorizeResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{9}
return file_proto_users_proto_rawDescGZIP(), []int{11}
} }
func (x *AuthorizeResponse) GetUser() *UserInfo { func (x *AuthorizeResponse) GetUser() *UserInfo {
@ -540,7 +625,7 @@ type ResetPasswordRequest struct {
func (x *ResetPasswordRequest) Reset() { func (x *ResetPasswordRequest) Reset() {
*x = ResetPasswordRequest{} *x = ResetPasswordRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[10]
mi := &file_proto_users_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -553,7 +638,7 @@ func (x *ResetPasswordRequest) String() string {
func (*ResetPasswordRequest) ProtoMessage() {} func (*ResetPasswordRequest) ProtoMessage() {}
func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message { func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[10]
mi := &file_proto_users_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -566,7 +651,7 @@ func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead. // Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead.
func (*ResetPasswordRequest) Descriptor() ([]byte, []int) { func (*ResetPasswordRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{10}
return file_proto_users_proto_rawDescGZIP(), []int{12}
} }
func (x *ResetPasswordRequest) GetForm() *UserForm { func (x *ResetPasswordRequest) GetForm() *UserForm {
@ -587,7 +672,7 @@ type ResetPasswordResponse struct {
func (x *ResetPasswordResponse) Reset() { func (x *ResetPasswordResponse) Reset() {
*x = ResetPasswordResponse{} *x = ResetPasswordResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[11]
mi := &file_proto_users_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -600,7 +685,7 @@ func (x *ResetPasswordResponse) String() string {
func (*ResetPasswordResponse) ProtoMessage() {} func (*ResetPasswordResponse) ProtoMessage() {}
func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message { func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[11]
mi := &file_proto_users_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -613,7 +698,7 @@ func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ResetPasswordResponse.ProtoReflect.Descriptor instead. // Deprecated: Use ResetPasswordResponse.ProtoReflect.Descriptor instead.
func (*ResetPasswordResponse) Descriptor() ([]byte, []int) { func (*ResetPasswordResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{11}
return file_proto_users_proto_rawDescGZIP(), []int{13}
} }
func (x *ResetPasswordResponse) GetToken() *UserToken { func (x *ResetPasswordResponse) GetToken() *UserToken {
@ -635,7 +720,7 @@ type ChangePasswordRequest struct {
func (x *ChangePasswordRequest) Reset() { func (x *ChangePasswordRequest) Reset() {
*x = ChangePasswordRequest{} *x = ChangePasswordRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[12]
mi := &file_proto_users_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -648,7 +733,7 @@ func (x *ChangePasswordRequest) String() string {
func (*ChangePasswordRequest) ProtoMessage() {} func (*ChangePasswordRequest) ProtoMessage() {}
func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[12]
mi := &file_proto_users_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -661,7 +746,7 @@ func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead. // Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead.
func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { func (*ChangePasswordRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{12}
return file_proto_users_proto_rawDescGZIP(), []int{14}
} }
func (x *ChangePasswordRequest) GetToken() *UserToken { func (x *ChangePasswordRequest) GetToken() *UserToken {
@ -687,7 +772,7 @@ type ChangePasswordResponse struct {
func (x *ChangePasswordResponse) Reset() { func (x *ChangePasswordResponse) Reset() {
*x = ChangePasswordResponse{} *x = ChangePasswordResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[13]
mi := &file_proto_users_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -700,7 +785,7 @@ func (x *ChangePasswordResponse) String() string {
func (*ChangePasswordResponse) ProtoMessage() {} func (*ChangePasswordResponse) ProtoMessage() {}
func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message { func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[13]
mi := &file_proto_users_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -713,7 +798,7 @@ func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead. // Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead.
func (*ChangePasswordResponse) Descriptor() ([]byte, []int) { func (*ChangePasswordResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{13}
return file_proto_users_proto_rawDescGZIP(), []int{15}
} }
type ListRolesRequest struct { type ListRolesRequest struct {
@ -727,7 +812,7 @@ type ListRolesRequest struct {
func (x *ListRolesRequest) Reset() { func (x *ListRolesRequest) Reset() {
*x = ListRolesRequest{} *x = ListRolesRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[14]
mi := &file_proto_users_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -740,7 +825,7 @@ func (x *ListRolesRequest) String() string {
func (*ListRolesRequest) ProtoMessage() {} func (*ListRolesRequest) ProtoMessage() {}
func (x *ListRolesRequest) ProtoReflect() protoreflect.Message { func (x *ListRolesRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[14]
mi := &file_proto_users_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -753,7 +838,7 @@ func (x *ListRolesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListRolesRequest.ProtoReflect.Descriptor instead. // Deprecated: Use ListRolesRequest.ProtoReflect.Descriptor instead.
func (*ListRolesRequest) Descriptor() ([]byte, []int) { func (*ListRolesRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{14}
return file_proto_users_proto_rawDescGZIP(), []int{16}
} }
func (x *ListRolesRequest) GetSecret() string { func (x *ListRolesRequest) GetSecret() string {
@ -774,7 +859,7 @@ type ListRolesResponse struct {
func (x *ListRolesResponse) Reset() { func (x *ListRolesResponse) Reset() {
*x = ListRolesResponse{} *x = ListRolesResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[15]
mi := &file_proto_users_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -787,7 +872,7 @@ func (x *ListRolesResponse) String() string {
func (*ListRolesResponse) ProtoMessage() {} func (*ListRolesResponse) ProtoMessage() {}
func (x *ListRolesResponse) ProtoReflect() protoreflect.Message { func (x *ListRolesResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[15]
mi := &file_proto_users_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -800,7 +885,7 @@ func (x *ListRolesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListRolesResponse.ProtoReflect.Descriptor instead. // Deprecated: Use ListRolesResponse.ProtoReflect.Descriptor instead.
func (*ListRolesResponse) Descriptor() ([]byte, []int) { func (*ListRolesResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{15}
return file_proto_users_proto_rawDescGZIP(), []int{17}
} }
func (x *ListRolesResponse) GetRoles() []*UserRole { func (x *ListRolesResponse) GetRoles() []*UserRole {
@ -823,7 +908,7 @@ type SetRolesRequest struct {
func (x *SetRolesRequest) Reset() { func (x *SetRolesRequest) Reset() {
*x = SetRolesRequest{} *x = SetRolesRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[16]
mi := &file_proto_users_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -836,7 +921,7 @@ func (x *SetRolesRequest) String() string {
func (*SetRolesRequest) ProtoMessage() {} func (*SetRolesRequest) ProtoMessage() {}
func (x *SetRolesRequest) ProtoReflect() protoreflect.Message { func (x *SetRolesRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[16]
mi := &file_proto_users_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -849,7 +934,7 @@ func (x *SetRolesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetRolesRequest.ProtoReflect.Descriptor instead. // Deprecated: Use SetRolesRequest.ProtoReflect.Descriptor instead.
func (*SetRolesRequest) Descriptor() ([]byte, []int) { func (*SetRolesRequest) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{16}
return file_proto_users_proto_rawDescGZIP(), []int{18}
} }
func (x *SetRolesRequest) GetSecret() string { func (x *SetRolesRequest) GetSecret() string {
@ -882,7 +967,7 @@ type SetRolesResponse struct {
func (x *SetRolesResponse) Reset() { func (x *SetRolesResponse) Reset() {
*x = SetRolesResponse{} *x = SetRolesResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_proto_users_proto_msgTypes[17]
mi := &file_proto_users_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -895,7 +980,7 @@ func (x *SetRolesResponse) String() string {
func (*SetRolesResponse) ProtoMessage() {} func (*SetRolesResponse) ProtoMessage() {}
func (x *SetRolesResponse) ProtoReflect() protoreflect.Message { func (x *SetRolesResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_users_proto_msgTypes[17]
mi := &file_proto_users_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -908,7 +993,7 @@ func (x *SetRolesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetRolesResponse.ProtoReflect.Descriptor instead. // Deprecated: Use SetRolesResponse.ProtoReflect.Descriptor instead.
func (*SetRolesResponse) Descriptor() ([]byte, []int) { func (*SetRolesResponse) Descriptor() ([]byte, []int) {
return file_proto_users_proto_rawDescGZIP(), []int{17}
return file_proto_users_proto_rawDescGZIP(), []int{19}
} }
var File_proto_users_proto protoreflect.FileDescriptor var File_proto_users_proto protoreflect.FileDescriptor
@ -945,83 +1030,91 @@ var file_proto_users_proto_rawDesc = []byte{
0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x37, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x37, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x52,
0x0a, 0x10, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x22, 0x5f, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05,
0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f,
0x6c, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73,
0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x66,
0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6d,
0x22, 0x3f, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65,
0x6e, 0x22, 0x64, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77,
0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x12, 0x23, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6f, 0x72,
0x6d, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x2a, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x3a, 0x0a,
0x11, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f,
0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x75, 0x0a, 0x0f, 0x53, 0x65, 0x74,
0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06,
0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65,
0x63, 0x72, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x6f, 0x6c,
0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73,
0x22, 0x12, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x32, 0xde, 0x03, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x3d,
0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x73, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73,
0x74, 0x65, 0x72, 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, 0x40, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65,
0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52,
0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x65,
0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73,
0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x68,
0x61, 0x6e, 0x67, 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, 0x43, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65,
0x73, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f,
0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c,
0x65, 0x73, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x6f,
0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x68, 0x72,
0x69, 0x73, 0x68, 0x61, 0x79, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x78, 0x79, 0x7a, 0x2f, 0x78, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x37,
0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x0a, 0x10, 0x41, 0x75, 0x74,
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5f, 0x0a,
0x11, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x3b,
0x0a, 0x14, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x04, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x3f, 0x0a, 0x15, 0x52,
0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x64, 0x0a, 0x15,
0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a,
0x04, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x04, 0x66, 0x6f,
0x72, 0x6d, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73,
0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x10,
0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x3a, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a,
0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72,
0x6f, 0x6c, 0x65, 0x73, 0x22, 0x75, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
0x23, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04,
0x75, 0x73, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x53,
0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32,
0x97, 0x04, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65,
0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 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, 0x40, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f,
0x72, 0x69, 0x7a, 0x65, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x75, 0x74,
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0d, 0x52, 0x65, 0x73,
0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e,
0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67,
0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x73, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 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,
0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x08, 0x53, 0x65,
0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x53,
0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74,
0x2e, 0x63, 0x68, 0x72, 0x69, 0x73, 0x68, 0x61, 0x79, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x78, 0x79,
0x7a, 0x2f, 0x78, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -1036,7 +1129,7 @@ func file_proto_users_proto_rawDescGZIP() []byte {
return file_proto_users_proto_rawDescData return file_proto_users_proto_rawDescData
} }
var file_proto_users_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
var file_proto_users_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_proto_users_proto_goTypes = []interface{}{ var file_proto_users_proto_goTypes = []interface{}{
(*UserForm)(nil), // 0: users.UserForm (*UserForm)(nil), // 0: users.UserForm
(*UserToken)(nil), // 1: users.UserToken (*UserToken)(nil), // 1: users.UserToken
@ -1046,50 +1139,55 @@ var file_proto_users_proto_goTypes = []interface{}{
(*RegisterResponse)(nil), // 5: users.RegisterResponse (*RegisterResponse)(nil), // 5: users.RegisterResponse
(*LoginRequest)(nil), // 6: users.LoginRequest (*LoginRequest)(nil), // 6: users.LoginRequest
(*LoginResponse)(nil), // 7: users.LoginResponse (*LoginResponse)(nil), // 7: users.LoginResponse
(*AuthorizeRequest)(nil), // 8: users.AuthorizeRequest
(*AuthorizeResponse)(nil), // 9: users.AuthorizeResponse
(*ResetPasswordRequest)(nil), // 10: users.ResetPasswordRequest
(*ResetPasswordResponse)(nil), // 11: users.ResetPasswordResponse
(*ChangePasswordRequest)(nil), // 12: users.ChangePasswordRequest
(*ChangePasswordResponse)(nil), // 13: users.ChangePasswordResponse
(*ListRolesRequest)(nil), // 14: users.ListRolesRequest
(*ListRolesResponse)(nil), // 15: users.ListRolesResponse
(*SetRolesRequest)(nil), // 16: users.SetRolesRequest
(*SetRolesResponse)(nil), // 17: users.SetRolesResponse
(*LogoutRequest)(nil), // 8: users.LogoutRequest
(*LogoutResponse)(nil), // 9: users.LogoutResponse
(*AuthorizeRequest)(nil), // 10: users.AuthorizeRequest
(*AuthorizeResponse)(nil), // 11: users.AuthorizeResponse
(*ResetPasswordRequest)(nil), // 12: users.ResetPasswordRequest
(*ResetPasswordResponse)(nil), // 13: users.ResetPasswordResponse
(*ChangePasswordRequest)(nil), // 14: users.ChangePasswordRequest
(*ChangePasswordResponse)(nil), // 15: users.ChangePasswordResponse
(*ListRolesRequest)(nil), // 16: users.ListRolesRequest
(*ListRolesResponse)(nil), // 17: users.ListRolesResponse
(*SetRolesRequest)(nil), // 18: users.SetRolesRequest
(*SetRolesResponse)(nil), // 19: users.SetRolesResponse
} }
var file_proto_users_proto_depIdxs = []int32{ var file_proto_users_proto_depIdxs = []int32{
0, // 0: users.RegisterRequest.form:type_name -> users.UserForm 0, // 0: users.RegisterRequest.form:type_name -> users.UserForm
0, // 1: users.LoginRequest.form:type_name -> users.UserForm 0, // 1: users.LoginRequest.form:type_name -> users.UserForm
1, // 2: users.LoginResponse.token:type_name -> users.UserToken 1, // 2: users.LoginResponse.token:type_name -> users.UserToken
1, // 3: users.AuthorizeRequest.token:type_name -> users.UserToken
2, // 4: users.AuthorizeResponse.user:type_name -> users.UserInfo
3, // 5: users.AuthorizeResponse.roles:type_name -> users.UserRole
0, // 6: users.ResetPasswordRequest.form:type_name -> users.UserForm
1, // 7: users.ResetPasswordResponse.token:type_name -> users.UserToken
1, // 8: users.ChangePasswordRequest.token:type_name -> users.UserToken
0, // 9: users.ChangePasswordRequest.form:type_name -> users.UserForm
3, // 10: users.ListRolesResponse.roles:type_name -> users.UserRole
2, // 11: users.SetRolesRequest.user:type_name -> users.UserInfo
3, // 12: users.SetRolesRequest.roles:type_name -> users.UserRole
4, // 13: users.Users.Register:input_type -> users.RegisterRequest
6, // 14: users.Users.Login:input_type -> users.LoginRequest
8, // 15: users.Users.Authorize:input_type -> users.AuthorizeRequest
10, // 16: users.Users.ResetPassword:input_type -> users.ResetPasswordRequest
12, // 17: users.Users.ChangePassword:input_type -> users.ChangePasswordRequest
14, // 18: users.Users.ListRoles:input_type -> users.ListRolesRequest
16, // 19: users.Users.SetRoles:input_type -> users.SetRolesRequest
5, // 20: users.Users.Register:output_type -> users.RegisterResponse
7, // 21: users.Users.Login:output_type -> users.LoginResponse
9, // 22: users.Users.Authorize:output_type -> users.AuthorizeResponse
11, // 23: users.Users.ResetPassword:output_type -> users.ResetPasswordResponse
13, // 24: users.Users.ChangePassword:output_type -> users.ChangePasswordResponse
15, // 25: users.Users.ListRoles:output_type -> users.ListRolesResponse
17, // 26: users.Users.SetRoles:output_type -> users.SetRolesResponse
20, // [20:27] is the sub-list for method output_type
13, // [13:20] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
1, // 3: users.LogoutRequest.token:type_name -> users.UserToken
1, // 4: users.AuthorizeRequest.token:type_name -> users.UserToken
2, // 5: users.AuthorizeResponse.user:type_name -> users.UserInfo
3, // 6: users.AuthorizeResponse.roles:type_name -> users.UserRole
0, // 7: users.ResetPasswordRequest.form:type_name -> users.UserForm
1, // 8: users.ResetPasswordResponse.token:type_name -> users.UserToken
1, // 9: users.ChangePasswordRequest.token:type_name -> users.UserToken
0, // 10: users.ChangePasswordRequest.form:type_name -> users.UserForm
3, // 11: users.ListRolesResponse.roles:type_name -> users.UserRole
2, // 12: users.SetRolesRequest.user:type_name -> users.UserInfo
3, // 13: users.SetRolesRequest.roles:type_name -> users.UserRole
4, // 14: users.Users.Register:input_type -> users.RegisterRequest
6, // 15: users.Users.Login:input_type -> users.LoginRequest
8, // 16: users.Users.Logout:input_type -> users.LogoutRequest
10, // 17: users.Users.Authorize:input_type -> users.AuthorizeRequest
12, // 18: users.Users.ResetPassword:input_type -> users.ResetPasswordRequest
14, // 19: users.Users.ChangePassword:input_type -> users.ChangePasswordRequest
16, // 20: users.Users.ListRoles:input_type -> users.ListRolesRequest
18, // 21: users.Users.SetRoles:input_type -> users.SetRolesRequest
5, // 22: users.Users.Register:output_type -> users.RegisterResponse
7, // 23: users.Users.Login:output_type -> users.LoginResponse
9, // 24: users.Users.Logout:output_type -> users.LogoutResponse
11, // 25: users.Users.Authorize:output_type -> users.AuthorizeResponse
13, // 26: users.Users.ResetPassword:output_type -> users.ResetPasswordResponse
15, // 27: users.Users.ChangePassword:output_type -> users.ChangePasswordResponse
17, // 28: users.Users.ListRoles:output_type -> users.ListRolesResponse
19, // 29: users.Users.SetRoles:output_type -> users.SetRolesResponse
22, // [22:30] is the sub-list for method output_type
14, // [14:22] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
} }
func init() { file_proto_users_proto_init() } func init() { file_proto_users_proto_init() }
@ -1195,7 +1293,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthorizeRequest); i {
switch v := v.(*LogoutRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1207,7 +1305,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthorizeResponse); i {
switch v := v.(*LogoutResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1219,7 +1317,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResetPasswordRequest); i {
switch v := v.(*AuthorizeRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1231,7 +1329,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResetPasswordResponse); i {
switch v := v.(*AuthorizeResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1243,7 +1341,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChangePasswordRequest); i {
switch v := v.(*ResetPasswordRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1255,7 +1353,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChangePasswordResponse); i {
switch v := v.(*ResetPasswordResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1267,7 +1365,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListRolesRequest); i {
switch v := v.(*ChangePasswordRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1279,7 +1377,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListRolesResponse); i {
switch v := v.(*ChangePasswordResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1291,7 +1389,7 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetRolesRequest); i {
switch v := v.(*ListRolesRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1303,6 +1401,30 @@ func file_proto_users_proto_init() {
} }
} }
file_proto_users_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { file_proto_users_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListRolesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetRolesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_users_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetRolesResponse); i { switch v := v.(*SetRolesResponse); i {
case 0: case 0:
return &v.state return &v.state
@ -1323,7 +1445,7 @@ func file_proto_users_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_users_proto_rawDesc, RawDescriptor: file_proto_users_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 18,
NumMessages: 20,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

9
proto/users.proto

@ -7,6 +7,7 @@ option go_package = "git.chrishayward.xyz/x/users/proto";
service Users { service Users {
rpc Register (RegisterRequest) returns (RegisterResponse) {} rpc Register (RegisterRequest) returns (RegisterResponse) {}
rpc Login (LoginRequest) returns (LoginResponse) {} rpc Login (LoginRequest) returns (LoginResponse) {}
rpc Logout (LogoutRequest) returns (LogoutResponse) {}
rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse) {} rpc Authorize (AuthorizeRequest) returns (AuthorizeResponse) {}
rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse) {} rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse) {}
rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {} rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {}
@ -50,6 +51,14 @@ message LoginResponse {
UserToken token = 1; UserToken token = 1;
} }
message LogoutRequest {
UserToken token = 1;
}
message LogoutResponse {
}
message AuthorizeRequest { message AuthorizeRequest {
string secret = 1; string secret = 1;
UserToken token = 2; UserToken token = 2;

37
proto/users_grpc.pb.go

@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7
const ( const (
Users_Register_FullMethodName = "/users.Users/Register" Users_Register_FullMethodName = "/users.Users/Register"
Users_Login_FullMethodName = "/users.Users/Login" Users_Login_FullMethodName = "/users.Users/Login"
Users_Logout_FullMethodName = "/users.Users/Logout"
Users_Authorize_FullMethodName = "/users.Users/Authorize" Users_Authorize_FullMethodName = "/users.Users/Authorize"
Users_ResetPassword_FullMethodName = "/users.Users/ResetPassword" Users_ResetPassword_FullMethodName = "/users.Users/ResetPassword"
Users_ChangePassword_FullMethodName = "/users.Users/ChangePassword" Users_ChangePassword_FullMethodName = "/users.Users/ChangePassword"
@ -34,6 +35,7 @@ const (
type UsersClient interface { type UsersClient interface {
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error)
ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error)
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
@ -67,6 +69,15 @@ func (c *usersClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.
return out, nil return out, nil
} }
func (c *usersClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) {
out := new(LogoutResponse)
err := c.cc.Invoke(ctx, Users_Logout_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) { func (c *usersClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) {
out := new(AuthorizeResponse) out := new(AuthorizeResponse)
err := c.cc.Invoke(ctx, Users_Authorize_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Users_Authorize_FullMethodName, in, out, opts...)
@ -118,6 +129,7 @@ func (c *usersClient) SetRoles(ctx context.Context, in *SetRolesRequest, opts ..
type UsersServer interface { type UsersServer interface {
Register(context.Context, *RegisterRequest) (*RegisterResponse, error) Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
Login(context.Context, *LoginRequest) (*LoginResponse, error) Login(context.Context, *LoginRequest) (*LoginResponse, error)
Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error)
ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error) ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error)
ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
@ -136,6 +148,9 @@ func (UnimplementedUsersServer) Register(context.Context, *RegisterRequest) (*Re
func (UnimplementedUsersServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { func (UnimplementedUsersServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
} }
func (UnimplementedUsersServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
}
func (UnimplementedUsersServer) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) { func (UnimplementedUsersServer) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented") return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
} }
@ -200,6 +215,24 @@ func _Users_Login_Handler(srv interface{}, ctx context.Context, dec func(interfa
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Users_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LogoutRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServer).Logout(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Users_Logout_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServer).Logout(ctx, req.(*LogoutRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Users_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Users_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthorizeRequest) in := new(AuthorizeRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -305,6 +338,10 @@ var Users_ServiceDesc = grpc.ServiceDesc{
MethodName: "Login", MethodName: "Login",
Handler: _Users_Login_Handler, Handler: _Users_Login_Handler,
}, },
{
MethodName: "Logout",
Handler: _Users_Logout_Handler,
},
{ {
MethodName: "Authorize", MethodName: "Authorize",
Handler: _Users_Authorize_Handler, Handler: _Users_Authorize_Handler,

16
server/server.go

@ -105,6 +105,22 @@ func (m *usersServer) Login(ctx context.Context, in *proto.LoginRequest) (*proto
}, nil }, nil
} }
func (m *usersServer) Logout(ctx context.Context, in *proto.LogoutRequest) (*proto.LogoutResponse, error) {
// Find the session.
var s models.Session
if tx := m.db.First(&s, "token = ?", in.Token.Token); tx.RowsAffected == 0 {
return nil, errors.New("Failed to find session.")
}
// Expire the token.
s.Expires = time.Now().UnixNano()
if tx := m.db.Save(&s); tx.RowsAffected == 0 {
return nil, errors.New("Failed to close session.")
}
return &proto.LogoutResponse{}, nil
}
func (m *usersServer) Authorize(ctx context.Context, in *proto.AuthorizeRequest) (*proto.AuthorizeResponse, error) { func (m *usersServer) Authorize(ctx context.Context, in *proto.AuthorizeRequest) (*proto.AuthorizeResponse, error) {
// Make sure the secrets match. // Make sure the secrets match.
if in.Secret != *m.secret { if in.Secret != *m.secret {

Loading…
Cancel
Save