diff --git a/gen/go/identity.pb.go b/gen/go/identity.pb.go deleted file mode 100644 index cd4804f..0000000 --- a/gen/go/identity.pb.go +++ /dev/null @@ -1,1902 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v3.21.12 -// source: identity.proto - -package pb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type LoginRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginRequest) Reset() { - *x = LoginRequest{} - mi := &file_identity_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginRequest) ProtoMessage() {} - -func (x *LoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. -func (*LoginRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{0} -} - -func (x *LoginRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *LoginRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type LoginResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Need2Fa bool `protobuf:"varint,4,opt,name=need2fa,proto3" json:"need2fa,omitempty"` - TempToken *string `protobuf:"bytes,5,opt,name=temp_token,json=tempToken,proto3,oneof" json:"temp_token,omitempty"` - Message *string `protobuf:"bytes,6,opt,name=message,proto3,oneof" json:"message,omitempty"` - ErrorCode *string `protobuf:"bytes,7,opt,name=error_code,json=errorCode,proto3,oneof" json:"error_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginResponse) Reset() { - *x = LoginResponse{} - mi := &file_identity_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginResponse) ProtoMessage() {} - -func (x *LoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. -func (*LoginResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{1} -} - -func (x *LoginResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *LoginResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -func (x *LoginResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *LoginResponse) GetNeed2Fa() bool { - if x != nil { - return x.Need2Fa - } - return false -} - -func (x *LoginResponse) GetTempToken() string { - if x != nil && x.TempToken != nil { - return *x.TempToken - } - return "" -} - -func (x *LoginResponse) GetMessage() string { - if x != nil && x.Message != nil { - return *x.Message - } - return "" -} - -func (x *LoginResponse) GetErrorCode() string { - if x != nil && x.ErrorCode != nil { - return *x.ErrorCode - } - return "" -} - -type RefreshRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshRequest) Reset() { - *x = RefreshRequest{} - mi := &file_identity_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshRequest) ProtoMessage() {} - -func (x *RefreshRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RefreshRequest.ProtoReflect.Descriptor instead. -func (*RefreshRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{2} -} - -func (x *RefreshRequest) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -type RefreshResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshResponse) Reset() { - *x = RefreshResponse{} - mi := &file_identity_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshResponse) ProtoMessage() {} - -func (x *RefreshResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RefreshResponse.ProtoReflect.Descriptor instead. -func (*RefreshResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{3} -} - -func (x *RefreshResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *RefreshResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -type LogoutRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogoutRequest) Reset() { - *x = LogoutRequest{} - mi := &file_identity_proto_msgTypes[4] - 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_identity_proto_msgTypes[4] - if 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_identity_proto_rawDescGZIP(), []int{4} -} - -func (x *LogoutRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -type LogoutResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogoutResponse) Reset() { - *x = LogoutResponse{} - mi := &file_identity_proto_msgTypes[5] - 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_identity_proto_msgTypes[5] - if 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_identity_proto_rawDescGZIP(), []int{5} -} - -func (x *LogoutResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *LogoutResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type VerifyTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VerifyTokenRequest) Reset() { - *x = VerifyTokenRequest{} - mi := &file_identity_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VerifyTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VerifyTokenRequest) ProtoMessage() {} - -func (x *VerifyTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VerifyTokenRequest.ProtoReflect.Descriptor instead. -func (*VerifyTokenRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{6} -} - -func (x *VerifyTokenRequest) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -type VerifyTokenResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - IsValid bool `protobuf:"varint,1,opt,name=is_valid,json=isValid,proto3" json:"is_valid,omitempty"` - ErrorMessage *string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3,oneof" json:"error_message,omitempty"` - Id *string `protobuf:"bytes,3,opt,name=id,proto3,oneof" json:"id,omitempty"` - Username *string `protobuf:"bytes,4,opt,name=username,proto3,oneof" json:"username,omitempty"` - RoleLevel *int32 `protobuf:"varint,5,opt,name=role_level,json=roleLevel,proto3,oneof" json:"role_level,omitempty"` - Permissions []string `protobuf:"bytes,6,rep,name=permissions,proto3" json:"permissions,omitempty"` - SessionId *string `protobuf:"bytes,7,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` - RequiresPin *bool `protobuf:"varint,8,opt,name=requires_pin,json=requiresPin,proto3,oneof" json:"requires_pin,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VerifyTokenResponse) Reset() { - *x = VerifyTokenResponse{} - mi := &file_identity_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VerifyTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VerifyTokenResponse) ProtoMessage() {} - -func (x *VerifyTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VerifyTokenResponse.ProtoReflect.Descriptor instead. -func (*VerifyTokenResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{7} -} - -func (x *VerifyTokenResponse) GetIsValid() bool { - if x != nil { - return x.IsValid - } - return false -} - -func (x *VerifyTokenResponse) GetErrorMessage() string { - if x != nil && x.ErrorMessage != nil { - return *x.ErrorMessage - } - return "" -} - -func (x *VerifyTokenResponse) GetId() string { - if x != nil && x.Id != nil { - return *x.Id - } - return "" -} - -func (x *VerifyTokenResponse) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -func (x *VerifyTokenResponse) GetRoleLevel() int32 { - if x != nil && x.RoleLevel != nil { - return *x.RoleLevel - } - return 0 -} - -func (x *VerifyTokenResponse) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *VerifyTokenResponse) GetSessionId() string { - if x != nil && x.SessionId != nil { - return *x.SessionId - } - return "" -} - -func (x *VerifyTokenResponse) GetRequiresPin() bool { - if x != nil && x.RequiresPin != nil { - return *x.RequiresPin - } - return false -} - -type GetAccountRoleLevelRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAccountRoleLevelRequest) Reset() { - *x = GetAccountRoleLevelRequest{} - mi := &file_identity_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAccountRoleLevelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAccountRoleLevelRequest) ProtoMessage() {} - -func (x *GetAccountRoleLevelRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAccountRoleLevelRequest.ProtoReflect.Descriptor instead. -func (*GetAccountRoleLevelRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{8} -} - -func (x *GetAccountRoleLevelRequest) GetAccountId() string { - if x != nil { - return x.AccountId - } - return "" -} - -type GetAccountRoleLevelResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"` - RoleLevel int32 `protobuf:"varint,2,opt,name=role_level,json=roleLevel,proto3" json:"role_level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAccountRoleLevelResponse) Reset() { - *x = GetAccountRoleLevelResponse{} - mi := &file_identity_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAccountRoleLevelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAccountRoleLevelResponse) ProtoMessage() {} - -func (x *GetAccountRoleLevelResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAccountRoleLevelResponse.ProtoReflect.Descriptor instead. -func (*GetAccountRoleLevelResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{9} -} - -func (x *GetAccountRoleLevelResponse) GetFound() bool { - if x != nil { - return x.Found - } - return false -} - -func (x *GetAccountRoleLevelResponse) GetRoleLevel() int32 { - if x != nil { - return x.RoleLevel - } - return 0 -} - -type UnlockPinRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - PinCode string `protobuf:"bytes,2,opt,name=pin_code,json=pinCode,proto3" json:"pin_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UnlockPinRequest) Reset() { - *x = UnlockPinRequest{} - mi := &file_identity_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnlockPinRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnlockPinRequest) ProtoMessage() {} - -func (x *UnlockPinRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnlockPinRequest.ProtoReflect.Descriptor instead. -func (*UnlockPinRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{10} -} - -func (x *UnlockPinRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *UnlockPinRequest) GetPinCode() string { - if x != nil { - return x.PinCode - } - return "" -} - -type UnlockPinResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UnlockPinResponse) Reset() { - *x = UnlockPinResponse{} - mi := &file_identity_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnlockPinResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnlockPinResponse) ProtoMessage() {} - -func (x *UnlockPinResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnlockPinResponse.ProtoReflect.Descriptor instead. -func (*UnlockPinResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{11} -} - -func (x *UnlockPinResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *UnlockPinResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type Verify2FaRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - TempToken string `protobuf:"bytes,1,opt,name=temp_token,json=tempToken,proto3" json:"temp_token,omitempty"` - TotpCode *string `protobuf:"bytes,2,opt,name=totp_code,json=totpCode,proto3,oneof" json:"totp_code,omitempty"` - TelegramCode *string `protobuf:"bytes,3,opt,name=telegram_code,json=telegramCode,proto3,oneof" json:"telegram_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Verify2FaRequest) Reset() { - *x = Verify2FaRequest{} - mi := &file_identity_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Verify2FaRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Verify2FaRequest) ProtoMessage() {} - -func (x *Verify2FaRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Verify2FaRequest.ProtoReflect.Descriptor instead. -func (*Verify2FaRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{12} -} - -func (x *Verify2FaRequest) GetTempToken() string { - if x != nil { - return x.TempToken - } - return "" -} - -func (x *Verify2FaRequest) GetTotpCode() string { - if x != nil && x.TotpCode != nil { - return *x.TotpCode - } - return "" -} - -func (x *Verify2FaRequest) GetTelegramCode() string { - if x != nil && x.TelegramCode != nil { - return *x.TelegramCode - } - return "" -} - -type Verify2FaResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - ReserveCodes []string `protobuf:"bytes,5,rep,name=reserve_codes,json=reserveCodes,proto3" json:"reserve_codes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Verify2FaResponse) Reset() { - *x = Verify2FaResponse{} - mi := &file_identity_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Verify2FaResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Verify2FaResponse) ProtoMessage() {} - -func (x *Verify2FaResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Verify2FaResponse.ProtoReflect.Descriptor instead. -func (*Verify2FaResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{13} -} - -func (x *Verify2FaResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *Verify2FaResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -func (x *Verify2FaResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *Verify2FaResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *Verify2FaResponse) GetReserveCodes() []string { - if x != nil { - return x.ReserveCodes - } - return nil -} - -type AuthenticatedAccessRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AuthenticatedAccessRequest) Reset() { - *x = AuthenticatedAccessRequest{} - mi := &file_identity_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AuthenticatedAccessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthenticatedAccessRequest) ProtoMessage() {} - -func (x *AuthenticatedAccessRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthenticatedAccessRequest.ProtoReflect.Descriptor instead. -func (*AuthenticatedAccessRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{14} -} - -func (x *AuthenticatedAccessRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -type GetTwoFaStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetTwoFaStatusRequest) Reset() { - *x = GetTwoFaStatusRequest{} - mi := &file_identity_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetTwoFaStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTwoFaStatusRequest) ProtoMessage() {} - -func (x *GetTwoFaStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTwoFaStatusRequest.ProtoReflect.Descriptor instead. -func (*GetTwoFaStatusRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{15} -} - -func (x *GetTwoFaStatusRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -type GetTwoFaStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - TotpEnabled bool `protobuf:"varint,1,opt,name=totp_enabled,json=totpEnabled,proto3" json:"totp_enabled,omitempty"` - TelegramEnabled bool `protobuf:"varint,2,opt,name=telegram_enabled,json=telegramEnabled,proto3" json:"telegram_enabled,omitempty"` - TotpEnrollmentPending bool `protobuf:"varint,3,opt,name=totp_enrollment_pending,json=totpEnrollmentPending,proto3" json:"totp_enrollment_pending,omitempty"` - TelegramEnrollmentPending bool `protobuf:"varint,4,opt,name=telegram_enrollment_pending,json=telegramEnrollmentPending,proto3" json:"telegram_enrollment_pending,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetTwoFaStatusResponse) Reset() { - *x = GetTwoFaStatusResponse{} - mi := &file_identity_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetTwoFaStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTwoFaStatusResponse) ProtoMessage() {} - -func (x *GetTwoFaStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTwoFaStatusResponse.ProtoReflect.Descriptor instead. -func (*GetTwoFaStatusResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{16} -} - -func (x *GetTwoFaStatusResponse) GetTotpEnabled() bool { - if x != nil { - return x.TotpEnabled - } - return false -} - -func (x *GetTwoFaStatusResponse) GetTelegramEnabled() bool { - if x != nil { - return x.TelegramEnabled - } - return false -} - -func (x *GetTwoFaStatusResponse) GetTotpEnrollmentPending() bool { - if x != nil { - return x.TotpEnrollmentPending - } - return false -} - -func (x *GetTwoFaStatusResponse) GetTelegramEnrollmentPending() bool { - if x != nil { - return x.TelegramEnrollmentPending - } - return false -} - -type StartTotpEnrollmentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - SecretBase32 string `protobuf:"bytes,1,opt,name=secret_base32,json=secretBase32,proto3" json:"secret_base32,omitempty"` - OtpauthUri string `protobuf:"bytes,2,opt,name=otpauth_uri,json=otpauthUri,proto3" json:"otpauth_uri,omitempty"` - Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` - AccountLabel string `protobuf:"bytes,4,opt,name=account_label,json=accountLabel,proto3" json:"account_label,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartTotpEnrollmentResponse) Reset() { - *x = StartTotpEnrollmentResponse{} - mi := &file_identity_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartTotpEnrollmentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartTotpEnrollmentResponse) ProtoMessage() {} - -func (x *StartTotpEnrollmentResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartTotpEnrollmentResponse.ProtoReflect.Descriptor instead. -func (*StartTotpEnrollmentResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{17} -} - -func (x *StartTotpEnrollmentResponse) GetSecretBase32() string { - if x != nil { - return x.SecretBase32 - } - return "" -} - -func (x *StartTotpEnrollmentResponse) GetOtpauthUri() string { - if x != nil { - return x.OtpauthUri - } - return "" -} - -func (x *StartTotpEnrollmentResponse) GetIssuer() string { - if x != nil { - return x.Issuer - } - return "" -} - -func (x *StartTotpEnrollmentResponse) GetAccountLabel() string { - if x != nil { - return x.AccountLabel - } - return "" -} - -type ConfirmTotpEnrollmentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - TotpCode string `protobuf:"bytes,2,opt,name=totp_code,json=totpCode,proto3" json:"totp_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTotpEnrollmentRequest) Reset() { - *x = ConfirmTotpEnrollmentRequest{} - mi := &file_identity_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTotpEnrollmentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTotpEnrollmentRequest) ProtoMessage() {} - -func (x *ConfirmTotpEnrollmentRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfirmTotpEnrollmentRequest.ProtoReflect.Descriptor instead. -func (*ConfirmTotpEnrollmentRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{18} -} - -func (x *ConfirmTotpEnrollmentRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *ConfirmTotpEnrollmentRequest) GetTotpCode() string { - if x != nil { - return x.TotpCode - } - return "" -} - -type ConfirmTotpEnrollmentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - ReserveCodes []string `protobuf:"bytes,3,rep,name=reserve_codes,json=reserveCodes,proto3" json:"reserve_codes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTotpEnrollmentResponse) Reset() { - *x = ConfirmTotpEnrollmentResponse{} - mi := &file_identity_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTotpEnrollmentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTotpEnrollmentResponse) ProtoMessage() {} - -func (x *ConfirmTotpEnrollmentResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfirmTotpEnrollmentResponse.ProtoReflect.Descriptor instead. -func (*ConfirmTotpEnrollmentResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{19} -} - -func (x *ConfirmTotpEnrollmentResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *ConfirmTotpEnrollmentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *ConfirmTotpEnrollmentResponse) GetReserveCodes() []string { - if x != nil { - return x.ReserveCodes - } - return nil -} - -type CancelTotpEnrollmentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CancelTotpEnrollmentResponse) Reset() { - *x = CancelTotpEnrollmentResponse{} - mi := &file_identity_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CancelTotpEnrollmentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CancelTotpEnrollmentResponse) ProtoMessage() {} - -func (x *CancelTotpEnrollmentResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CancelTotpEnrollmentResponse.ProtoReflect.Descriptor instead. -func (*CancelTotpEnrollmentResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{20} -} - -func (x *CancelTotpEnrollmentResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *CancelTotpEnrollmentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type DisableTotpRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - TotpCode *string `protobuf:"bytes,3,opt,name=totp_code,json=totpCode,proto3,oneof" json:"totp_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DisableTotpRequest) Reset() { - *x = DisableTotpRequest{} - mi := &file_identity_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DisableTotpRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableTotpRequest) ProtoMessage() {} - -func (x *DisableTotpRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisableTotpRequest.ProtoReflect.Descriptor instead. -func (*DisableTotpRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{21} -} - -func (x *DisableTotpRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *DisableTotpRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *DisableTotpRequest) GetTotpCode() string { - if x != nil && x.TotpCode != nil { - return *x.TotpCode - } - return "" -} - -type DisableTotpResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DisableTotpResponse) Reset() { - *x = DisableTotpResponse{} - mi := &file_identity_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DisableTotpResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableTotpResponse) ProtoMessage() {} - -func (x *DisableTotpResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisableTotpResponse.ProtoReflect.Descriptor instead. -func (*DisableTotpResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{22} -} - -func (x *DisableTotpResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *DisableTotpResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type StartTelegramEnrollmentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - EnrollmentToken string `protobuf:"bytes,1,opt,name=enrollment_token,json=enrollmentToken,proto3" json:"enrollment_token,omitempty"` - DeepLink string `protobuf:"bytes,2,opt,name=deep_link,json=deepLink,proto3" json:"deep_link,omitempty"` - BotUsername string `protobuf:"bytes,3,opt,name=bot_username,json=botUsername,proto3" json:"bot_username,omitempty"` - ExpiresAtIso string `protobuf:"bytes,4,opt,name=expires_at_iso,json=expiresAtIso,proto3" json:"expires_at_iso,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartTelegramEnrollmentResponse) Reset() { - *x = StartTelegramEnrollmentResponse{} - mi := &file_identity_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartTelegramEnrollmentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartTelegramEnrollmentResponse) ProtoMessage() {} - -func (x *StartTelegramEnrollmentResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartTelegramEnrollmentResponse.ProtoReflect.Descriptor instead. -func (*StartTelegramEnrollmentResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{23} -} - -func (x *StartTelegramEnrollmentResponse) GetEnrollmentToken() string { - if x != nil { - return x.EnrollmentToken - } - return "" -} - -func (x *StartTelegramEnrollmentResponse) GetDeepLink() string { - if x != nil { - return x.DeepLink - } - return "" -} - -func (x *StartTelegramEnrollmentResponse) GetBotUsername() string { - if x != nil { - return x.BotUsername - } - return "" -} - -func (x *StartTelegramEnrollmentResponse) GetExpiresAtIso() string { - if x != nil { - return x.ExpiresAtIso - } - return "" -} - -type ConfirmTelegramEnrollmentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - EnrollmentToken string `protobuf:"bytes,2,opt,name=enrollment_token,json=enrollmentToken,proto3" json:"enrollment_token,omitempty"` - OtpCode string `protobuf:"bytes,3,opt,name=otp_code,json=otpCode,proto3" json:"otp_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTelegramEnrollmentRequest) Reset() { - *x = ConfirmTelegramEnrollmentRequest{} - mi := &file_identity_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTelegramEnrollmentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTelegramEnrollmentRequest) ProtoMessage() {} - -func (x *ConfirmTelegramEnrollmentRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfirmTelegramEnrollmentRequest.ProtoReflect.Descriptor instead. -func (*ConfirmTelegramEnrollmentRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{24} -} - -func (x *ConfirmTelegramEnrollmentRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *ConfirmTelegramEnrollmentRequest) GetEnrollmentToken() string { - if x != nil { - return x.EnrollmentToken - } - return "" -} - -func (x *ConfirmTelegramEnrollmentRequest) GetOtpCode() string { - if x != nil { - return x.OtpCode - } - return "" -} - -type ConfirmTelegramEnrollmentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - ReserveCodes []string `protobuf:"bytes,3,rep,name=reserve_codes,json=reserveCodes,proto3" json:"reserve_codes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTelegramEnrollmentResponse) Reset() { - *x = ConfirmTelegramEnrollmentResponse{} - mi := &file_identity_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTelegramEnrollmentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTelegramEnrollmentResponse) ProtoMessage() {} - -func (x *ConfirmTelegramEnrollmentResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfirmTelegramEnrollmentResponse.ProtoReflect.Descriptor instead. -func (*ConfirmTelegramEnrollmentResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{25} -} - -func (x *ConfirmTelegramEnrollmentResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *ConfirmTelegramEnrollmentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *ConfirmTelegramEnrollmentResponse) GetReserveCodes() []string { - if x != nil { - return x.ReserveCodes - } - return nil -} - -type DisableTelegramRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - TelegramOtpCode *string `protobuf:"bytes,3,opt,name=telegram_otp_code,json=telegramOtpCode,proto3,oneof" json:"telegram_otp_code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DisableTelegramRequest) Reset() { - *x = DisableTelegramRequest{} - mi := &file_identity_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DisableTelegramRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableTelegramRequest) ProtoMessage() {} - -func (x *DisableTelegramRequest) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[26] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisableTelegramRequest.ProtoReflect.Descriptor instead. -func (*DisableTelegramRequest) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{26} -} - -func (x *DisableTelegramRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *DisableTelegramRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *DisableTelegramRequest) GetTelegramOtpCode() string { - if x != nil && x.TelegramOtpCode != nil { - return *x.TelegramOtpCode - } - return "" -} - -type DisableTelegramResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DisableTelegramResponse) Reset() { - *x = DisableTelegramResponse{} - mi := &file_identity_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DisableTelegramResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableTelegramResponse) ProtoMessage() {} - -func (x *DisableTelegramResponse) ProtoReflect() protoreflect.Message { - mi := &file_identity_proto_msgTypes[27] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisableTelegramResponse.ProtoReflect.Descriptor instead. -func (*DisableTelegramResponse) Descriptor() ([]byte, []int) { - return file_identity_proto_rawDescGZIP(), []int{27} -} - -func (x *DisableTelegramResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *DisableTelegramResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -var File_identity_proto protoreflect.FileDescriptor - -const file_identity_proto_rawDesc = "" + - "\n" + - "\x0eidentity.proto\x12\bidentity\"F\n" + - "\fLoginRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\"\x9a\x02\n" + - "\rLoginResponse\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + - "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\x12\x16\n" + - "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + - "\aneed2fa\x18\x04 \x01(\bR\aneed2fa\x12\"\n" + - "\n" + - "temp_token\x18\x05 \x01(\tH\x00R\ttempToken\x88\x01\x01\x12\x1d\n" + - "\amessage\x18\x06 \x01(\tH\x01R\amessage\x88\x01\x01\x12\"\n" + - "\n" + - "error_code\x18\a \x01(\tH\x02R\terrorCode\x88\x01\x01B\r\n" + - "\v_temp_tokenB\n" + - "\n" + - "\b_messageB\r\n" + - "\v_error_code\"5\n" + - "\x0eRefreshRequest\x12#\n" + - "\rrefresh_token\x18\x01 \x01(\tR\frefreshToken\"Y\n" + - "\x0fRefreshResponse\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + - "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\"2\n" + - "\rLogoutRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\"D\n" + - "\x0eLogoutResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"*\n" + - "\x12VerifyTokenRequest\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\"\xf7\x02\n" + - "\x13VerifyTokenResponse\x12\x19\n" + - "\bis_valid\x18\x01 \x01(\bR\aisValid\x12(\n" + - "\rerror_message\x18\x02 \x01(\tH\x00R\ferrorMessage\x88\x01\x01\x12\x13\n" + - "\x02id\x18\x03 \x01(\tH\x01R\x02id\x88\x01\x01\x12\x1f\n" + - "\busername\x18\x04 \x01(\tH\x02R\busername\x88\x01\x01\x12\"\n" + - "\n" + - "role_level\x18\x05 \x01(\x05H\x03R\troleLevel\x88\x01\x01\x12 \n" + - "\vpermissions\x18\x06 \x03(\tR\vpermissions\x12\"\n" + - "\n" + - "session_id\x18\a \x01(\tH\x04R\tsessionId\x88\x01\x01\x12&\n" + - "\frequires_pin\x18\b \x01(\bH\x05R\vrequiresPin\x88\x01\x01B\x10\n" + - "\x0e_error_messageB\x05\n" + - "\x03_idB\v\n" + - "\t_usernameB\r\n" + - "\v_role_levelB\r\n" + - "\v_session_idB\x0f\n" + - "\r_requires_pin\";\n" + - "\x1aGetAccountRoleLevelRequest\x12\x1d\n" + - "\n" + - "account_id\x18\x01 \x01(\tR\taccountId\"R\n" + - "\x1bGetAccountRoleLevelResponse\x12\x14\n" + - "\x05found\x18\x01 \x01(\bR\x05found\x12\x1d\n" + - "\n" + - "role_level\x18\x02 \x01(\x05R\troleLevel\"P\n" + - "\x10UnlockPinRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x19\n" + - "\bpin_code\x18\x02 \x01(\tR\apinCode\"G\n" + - "\x11UnlockPinResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"\x9d\x01\n" + - "\x10Verify2FaRequest\x12\x1d\n" + - "\n" + - "temp_token\x18\x01 \x01(\tR\ttempToken\x12 \n" + - "\ttotp_code\x18\x02 \x01(\tH\x00R\btotpCode\x88\x01\x01\x12(\n" + - "\rtelegram_code\x18\x03 \x01(\tH\x01R\ftelegramCode\x88\x01\x01B\f\n" + - "\n" + - "_totp_codeB\x10\n" + - "\x0e_telegram_code\"\xb2\x01\n" + - "\x11Verify2FaResponse\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + - "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\x12\x16\n" + - "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + - "\amessage\x18\x04 \x01(\tR\amessage\x12#\n" + - "\rreserve_codes\x18\x05 \x03(\tR\freserveCodes\"?\n" + - "\x1aAuthenticatedAccessRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\":\n" + - "\x15GetTwoFaStatusRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\"\xde\x01\n" + - "\x16GetTwoFaStatusResponse\x12!\n" + - "\ftotp_enabled\x18\x01 \x01(\bR\vtotpEnabled\x12)\n" + - "\x10telegram_enabled\x18\x02 \x01(\bR\x0ftelegramEnabled\x126\n" + - "\x17totp_enrollment_pending\x18\x03 \x01(\bR\x15totpEnrollmentPending\x12>\n" + - "\x1btelegram_enrollment_pending\x18\x04 \x01(\bR\x19telegramEnrollmentPending\"\xa0\x01\n" + - "\x1bStartTotpEnrollmentResponse\x12#\n" + - "\rsecret_base32\x18\x01 \x01(\tR\fsecretBase32\x12\x1f\n" + - "\votpauth_uri\x18\x02 \x01(\tR\n" + - "otpauthUri\x12\x16\n" + - "\x06issuer\x18\x03 \x01(\tR\x06issuer\x12#\n" + - "\raccount_label\x18\x04 \x01(\tR\faccountLabel\"^\n" + - "\x1cConfirmTotpEnrollmentRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x1b\n" + - "\ttotp_code\x18\x02 \x01(\tR\btotpCode\"v\n" + - "\x1dConfirmTotpEnrollmentResponse\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\x12#\n" + - "\rreserve_codes\x18\x03 \x03(\tR\freserveCodes\"P\n" + - "\x1cCancelTotpEnrollmentResponse\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"\x83\x01\n" + - "\x12DisableTotpRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12 \n" + - "\ttotp_code\x18\x03 \x01(\tH\x00R\btotpCode\x88\x01\x01B\f\n" + - "\n" + - "_totp_code\"G\n" + - "\x13DisableTotpResponse\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"\xb2\x01\n" + - "\x1fStartTelegramEnrollmentResponse\x12)\n" + - "\x10enrollment_token\x18\x01 \x01(\tR\x0fenrollmentToken\x12\x1b\n" + - "\tdeep_link\x18\x02 \x01(\tR\bdeepLink\x12!\n" + - "\fbot_username\x18\x03 \x01(\tR\vbotUsername\x12$\n" + - "\x0eexpires_at_iso\x18\x04 \x01(\tR\fexpiresAtIso\"\x8b\x01\n" + - " ConfirmTelegramEnrollmentRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12)\n" + - "\x10enrollment_token\x18\x02 \x01(\tR\x0fenrollmentToken\x12\x19\n" + - "\botp_code\x18\x03 \x01(\tR\aotpCode\"z\n" + - "!ConfirmTelegramEnrollmentResponse\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\x12#\n" + - "\rreserve_codes\x18\x03 \x03(\tR\freserveCodes\"\x9e\x01\n" + - "\x16DisableTelegramRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12/\n" + - "\x11telegram_otp_code\x18\x03 \x01(\tH\x00R\x0ftelegramOtpCode\x88\x01\x01B\x14\n" + - "\x12_telegram_otp_code\"K\n" + - "\x17DisableTelegramResponse\x12\x16\n" + - "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage2\xc0\x04\n" + - "\vAuthService\x128\n" + - "\x05Login\x12\x16.identity.LoginRequest\x1a\x17.identity.LoginResponse\x12>\n" + - "\aRefresh\x12\x18.identity.RefreshRequest\x1a\x19.identity.RefreshResponse\x12J\n" + - "\vVerifyToken\x12\x1c.identity.VerifyTokenRequest\x1a\x1d.identity.VerifyTokenResponse\x12b\n" + - "\x13GetAccountRoleLevel\x12$.identity.GetAccountRoleLevelRequest\x1a%.identity.GetAccountRoleLevelResponse\x12;\n" + - "\x06Logout\x12\x17.identity.LogoutRequest\x1a\x18.identity.LogoutResponse\x12>\n" + - "\tLogoutAll\x12\x17.identity.LogoutRequest\x1a\x18.identity.LogoutResponse\x12D\n" + - "\tUnlockPin\x12\x1a.identity.UnlockPinRequest\x1a\x1b.identity.UnlockPinResponse\x12D\n" + - "\tVerify2Fa\x12\x1a.identity.Verify2FaRequest\x1a\x1b.identity.Verify2FaResponse2\x9c\x06\n" + - "\fTwoFaService\x12S\n" + - "\x0eGetTwoFaStatus\x12\x1f.identity.GetTwoFaStatusRequest\x1a .identity.GetTwoFaStatusResponse\x12b\n" + - "\x13StartTotpEnrollment\x12$.identity.AuthenticatedAccessRequest\x1a%.identity.StartTotpEnrollmentResponse\x12g\n" + - "\x14ConfirmTotpErollment\x12&.identity.ConfirmTotpEnrollmentRequest\x1a'.identity.ConfirmTotpEnrollmentResponse\x12d\n" + - "\x14CancelTotpEnrollment\x12$.identity.AuthenticatedAccessRequest\x1a&.identity.CancelTotpEnrollmentResponse\x12J\n" + - "\vDisableTotp\x12\x1c.identity.DisableTotpRequest\x1a\x1d.identity.DisableTotpResponse\x12j\n" + - "\x17StartTelegramEnrollment\x12$.identity.AuthenticatedAccessRequest\x1a).identity.StartTelegramEnrollmentResponse\x12t\n" + - "\x19ConfirmTelegramEnrollment\x12*.identity.ConfirmTelegramEnrollmentRequest\x1a+.identity.ConfirmTelegramEnrollmentResponse\x12V\n" + - "\x0fDisableTelegram\x12 .identity.DisableTelegramRequest\x1a!.identity.DisableTelegramResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" - -var ( - file_identity_proto_rawDescOnce sync.Once - file_identity_proto_rawDescData []byte -) - -func file_identity_proto_rawDescGZIP() []byte { - file_identity_proto_rawDescOnce.Do(func() { - file_identity_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_identity_proto_rawDesc), len(file_identity_proto_rawDesc))) - }) - return file_identity_proto_rawDescData -} - -var file_identity_proto_msgTypes = make([]protoimpl.MessageInfo, 28) -var file_identity_proto_goTypes = []any{ - (*LoginRequest)(nil), // 0: identity.LoginRequest - (*LoginResponse)(nil), // 1: identity.LoginResponse - (*RefreshRequest)(nil), // 2: identity.RefreshRequest - (*RefreshResponse)(nil), // 3: identity.RefreshResponse - (*LogoutRequest)(nil), // 4: identity.LogoutRequest - (*LogoutResponse)(nil), // 5: identity.LogoutResponse - (*VerifyTokenRequest)(nil), // 6: identity.VerifyTokenRequest - (*VerifyTokenResponse)(nil), // 7: identity.VerifyTokenResponse - (*GetAccountRoleLevelRequest)(nil), // 8: identity.GetAccountRoleLevelRequest - (*GetAccountRoleLevelResponse)(nil), // 9: identity.GetAccountRoleLevelResponse - (*UnlockPinRequest)(nil), // 10: identity.UnlockPinRequest - (*UnlockPinResponse)(nil), // 11: identity.UnlockPinResponse - (*Verify2FaRequest)(nil), // 12: identity.Verify2FaRequest - (*Verify2FaResponse)(nil), // 13: identity.Verify2FaResponse - (*AuthenticatedAccessRequest)(nil), // 14: identity.AuthenticatedAccessRequest - (*GetTwoFaStatusRequest)(nil), // 15: identity.GetTwoFaStatusRequest - (*GetTwoFaStatusResponse)(nil), // 16: identity.GetTwoFaStatusResponse - (*StartTotpEnrollmentResponse)(nil), // 17: identity.StartTotpEnrollmentResponse - (*ConfirmTotpEnrollmentRequest)(nil), // 18: identity.ConfirmTotpEnrollmentRequest - (*ConfirmTotpEnrollmentResponse)(nil), // 19: identity.ConfirmTotpEnrollmentResponse - (*CancelTotpEnrollmentResponse)(nil), // 20: identity.CancelTotpEnrollmentResponse - (*DisableTotpRequest)(nil), // 21: identity.DisableTotpRequest - (*DisableTotpResponse)(nil), // 22: identity.DisableTotpResponse - (*StartTelegramEnrollmentResponse)(nil), // 23: identity.StartTelegramEnrollmentResponse - (*ConfirmTelegramEnrollmentRequest)(nil), // 24: identity.ConfirmTelegramEnrollmentRequest - (*ConfirmTelegramEnrollmentResponse)(nil), // 25: identity.ConfirmTelegramEnrollmentResponse - (*DisableTelegramRequest)(nil), // 26: identity.DisableTelegramRequest - (*DisableTelegramResponse)(nil), // 27: identity.DisableTelegramResponse -} -var file_identity_proto_depIdxs = []int32{ - 0, // 0: identity.AuthService.Login:input_type -> identity.LoginRequest - 2, // 1: identity.AuthService.Refresh:input_type -> identity.RefreshRequest - 6, // 2: identity.AuthService.VerifyToken:input_type -> identity.VerifyTokenRequest - 8, // 3: identity.AuthService.GetAccountRoleLevel:input_type -> identity.GetAccountRoleLevelRequest - 4, // 4: identity.AuthService.Logout:input_type -> identity.LogoutRequest - 4, // 5: identity.AuthService.LogoutAll:input_type -> identity.LogoutRequest - 10, // 6: identity.AuthService.UnlockPin:input_type -> identity.UnlockPinRequest - 12, // 7: identity.AuthService.Verify2Fa:input_type -> identity.Verify2FaRequest - 15, // 8: identity.TwoFaService.GetTwoFaStatus:input_type -> identity.GetTwoFaStatusRequest - 14, // 9: identity.TwoFaService.StartTotpEnrollment:input_type -> identity.AuthenticatedAccessRequest - 18, // 10: identity.TwoFaService.ConfirmTotpErollment:input_type -> identity.ConfirmTotpEnrollmentRequest - 14, // 11: identity.TwoFaService.CancelTotpEnrollment:input_type -> identity.AuthenticatedAccessRequest - 21, // 12: identity.TwoFaService.DisableTotp:input_type -> identity.DisableTotpRequest - 14, // 13: identity.TwoFaService.StartTelegramEnrollment:input_type -> identity.AuthenticatedAccessRequest - 24, // 14: identity.TwoFaService.ConfirmTelegramEnrollment:input_type -> identity.ConfirmTelegramEnrollmentRequest - 26, // 15: identity.TwoFaService.DisableTelegram:input_type -> identity.DisableTelegramRequest - 1, // 16: identity.AuthService.Login:output_type -> identity.LoginResponse - 3, // 17: identity.AuthService.Refresh:output_type -> identity.RefreshResponse - 7, // 18: identity.AuthService.VerifyToken:output_type -> identity.VerifyTokenResponse - 9, // 19: identity.AuthService.GetAccountRoleLevel:output_type -> identity.GetAccountRoleLevelResponse - 5, // 20: identity.AuthService.Logout:output_type -> identity.LogoutResponse - 5, // 21: identity.AuthService.LogoutAll:output_type -> identity.LogoutResponse - 11, // 22: identity.AuthService.UnlockPin:output_type -> identity.UnlockPinResponse - 13, // 23: identity.AuthService.Verify2Fa:output_type -> identity.Verify2FaResponse - 16, // 24: identity.TwoFaService.GetTwoFaStatus:output_type -> identity.GetTwoFaStatusResponse - 17, // 25: identity.TwoFaService.StartTotpEnrollment:output_type -> identity.StartTotpEnrollmentResponse - 19, // 26: identity.TwoFaService.ConfirmTotpErollment:output_type -> identity.ConfirmTotpEnrollmentResponse - 20, // 27: identity.TwoFaService.CancelTotpEnrollment:output_type -> identity.CancelTotpEnrollmentResponse - 22, // 28: identity.TwoFaService.DisableTotp:output_type -> identity.DisableTotpResponse - 23, // 29: identity.TwoFaService.StartTelegramEnrollment:output_type -> identity.StartTelegramEnrollmentResponse - 25, // 30: identity.TwoFaService.ConfirmTelegramEnrollment:output_type -> identity.ConfirmTelegramEnrollmentResponse - 27, // 31: identity.TwoFaService.DisableTelegram:output_type -> identity.DisableTelegramResponse - 16, // [16:32] is the sub-list for method output_type - 0, // [0:16] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_identity_proto_init() } -func file_identity_proto_init() { - if File_identity_proto != nil { - return - } - file_identity_proto_msgTypes[1].OneofWrappers = []any{} - file_identity_proto_msgTypes[7].OneofWrappers = []any{} - file_identity_proto_msgTypes[12].OneofWrappers = []any{} - file_identity_proto_msgTypes[21].OneofWrappers = []any{} - file_identity_proto_msgTypes[26].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_identity_proto_rawDesc), len(file_identity_proto_rawDesc)), - NumEnums: 0, - NumMessages: 28, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_identity_proto_goTypes, - DependencyIndexes: file_identity_proto_depIdxs, - MessageInfos: file_identity_proto_msgTypes, - }.Build() - File_identity_proto = out.File - file_identity_proto_goTypes = nil - file_identity_proto_depIdxs = nil -} diff --git a/gen/go/identity_grpc.pb.go b/gen/go/identity_grpc.pb.go deleted file mode 100644 index b4a96c4..0000000 --- a/gen/go/identity_grpc.pb.go +++ /dev/null @@ -1,755 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.1 -// - protoc v3.21.12 -// source: identity.proto - -package pb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AuthService_Login_FullMethodName = "/identity.AuthService/Login" - AuthService_Refresh_FullMethodName = "/identity.AuthService/Refresh" - AuthService_VerifyToken_FullMethodName = "/identity.AuthService/VerifyToken" - AuthService_GetAccountRoleLevel_FullMethodName = "/identity.AuthService/GetAccountRoleLevel" - AuthService_Logout_FullMethodName = "/identity.AuthService/Logout" - AuthService_LogoutAll_FullMethodName = "/identity.AuthService/LogoutAll" - AuthService_UnlockPin_FullMethodName = "/identity.AuthService/UnlockPin" - AuthService_Verify2Fa_FullMethodName = "/identity.AuthService/Verify2Fa" -) - -// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface { - Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) - Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) - VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...grpc.CallOption) (*VerifyTokenResponse, error) - GetAccountRoleLevel(ctx context.Context, in *GetAccountRoleLevelRequest, opts ...grpc.CallOption) (*GetAccountRoleLevelResponse, error) - Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) - LogoutAll(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) - UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error) - Verify2Fa(ctx context.Context, in *Verify2FaRequest, opts ...grpc.CallOption) (*Verify2FaResponse, error) -} - -type authServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { - return &authServiceClient{cc} -} - -func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LoginResponse) - err := c.cc.Invoke(ctx, AuthService_Login_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RefreshResponse) - err := c.cc.Invoke(ctx, AuthService_Refresh_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...grpc.CallOption) (*VerifyTokenResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(VerifyTokenResponse) - err := c.cc.Invoke(ctx, AuthService_VerifyToken_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) GetAccountRoleLevel(ctx context.Context, in *GetAccountRoleLevelRequest, opts ...grpc.CallOption) (*GetAccountRoleLevelResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAccountRoleLevelResponse) - err := c.cc.Invoke(ctx, AuthService_GetAccountRoleLevel_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LogoutResponse) - err := c.cc.Invoke(ctx, AuthService_Logout_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) LogoutAll(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LogoutResponse) - err := c.cc.Invoke(ctx, AuthService_LogoutAll_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UnlockPinResponse) - err := c.cc.Invoke(ctx, AuthService_UnlockPin_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Verify2Fa(ctx context.Context, in *Verify2FaRequest, opts ...grpc.CallOption) (*Verify2FaResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Verify2FaResponse) - err := c.cc.Invoke(ctx, AuthService_Verify2Fa_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthServiceServer is the server API for AuthService service. -// All implementations must embed UnimplementedAuthServiceServer -// for forward compatibility. -type AuthServiceServer interface { - Login(context.Context, *LoginRequest) (*LoginResponse, error) - Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) - VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error) - GetAccountRoleLevel(context.Context, *GetAccountRoleLevelRequest) (*GetAccountRoleLevelResponse, error) - Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) - LogoutAll(context.Context, *LogoutRequest) (*LogoutResponse, error) - UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error) - Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, error) - mustEmbedUnimplementedAuthServiceServer() -} - -// UnimplementedAuthServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAuthServiceServer struct{} - -func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Login not implemented") -} -func (UnimplementedAuthServiceServer) Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Refresh not implemented") -} -func (UnimplementedAuthServiceServer) VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error) { - return nil, status.Error(codes.Unimplemented, "method VerifyToken not implemented") -} -func (UnimplementedAuthServiceServer) GetAccountRoleLevel(context.Context, *GetAccountRoleLevelRequest) (*GetAccountRoleLevelResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetAccountRoleLevel not implemented") -} -func (UnimplementedAuthServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Logout not implemented") -} -func (UnimplementedAuthServiceServer) LogoutAll(context.Context, *LogoutRequest) (*LogoutResponse, error) { - return nil, status.Error(codes.Unimplemented, "method LogoutAll not implemented") -} -func (UnimplementedAuthServiceServer) UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error) { - return nil, status.Error(codes.Unimplemented, "method UnlockPin not implemented") -} -func (UnimplementedAuthServiceServer) Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Verify2Fa not implemented") -} -func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} -func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} - -// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthServiceServer will -// result in compilation errors. -type UnsafeAuthServiceServer interface { - mustEmbedUnimplementedAuthServiceServer() -} - -func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { - // If the following call panics, it indicates UnimplementedAuthServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AuthService_ServiceDesc, srv) -} - -func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LoginRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Login(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Login_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Login(ctx, req.(*LoginRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RefreshRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Refresh(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Refresh_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Refresh(ctx, req.(*RefreshRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_VerifyToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyTokenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).VerifyToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_VerifyToken_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).VerifyToken(ctx, req.(*VerifyTokenRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_GetAccountRoleLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAccountRoleLevelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).GetAccountRoleLevel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_GetAccountRoleLevel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).GetAccountRoleLevel(ctx, req.(*GetAccountRoleLevelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_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.(AuthServiceServer).Logout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Logout_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Logout(ctx, req.(*LogoutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_LogoutAll_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.(AuthServiceServer).LogoutAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_LogoutAll_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).LogoutAll(ctx, req.(*LogoutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_UnlockPin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnlockPinRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).UnlockPin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_UnlockPin_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).UnlockPin(ctx, req.(*UnlockPinRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_Verify2Fa_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Verify2FaRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Verify2Fa(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Verify2Fa_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Verify2Fa(ctx, req.(*Verify2FaRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AuthService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "identity.AuthService", - HandlerType: (*AuthServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Login", - Handler: _AuthService_Login_Handler, - }, - { - MethodName: "Refresh", - Handler: _AuthService_Refresh_Handler, - }, - { - MethodName: "VerifyToken", - Handler: _AuthService_VerifyToken_Handler, - }, - { - MethodName: "GetAccountRoleLevel", - Handler: _AuthService_GetAccountRoleLevel_Handler, - }, - { - MethodName: "Logout", - Handler: _AuthService_Logout_Handler, - }, - { - MethodName: "LogoutAll", - Handler: _AuthService_LogoutAll_Handler, - }, - { - MethodName: "UnlockPin", - Handler: _AuthService_UnlockPin_Handler, - }, - { - MethodName: "Verify2Fa", - Handler: _AuthService_Verify2Fa_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "identity.proto", -} - -const ( - TwoFaService_GetTwoFaStatus_FullMethodName = "/identity.TwoFaService/GetTwoFaStatus" - TwoFaService_StartTotpEnrollment_FullMethodName = "/identity.TwoFaService/StartTotpEnrollment" - TwoFaService_ConfirmTotpErollment_FullMethodName = "/identity.TwoFaService/ConfirmTotpErollment" - TwoFaService_CancelTotpEnrollment_FullMethodName = "/identity.TwoFaService/CancelTotpEnrollment" - TwoFaService_DisableTotp_FullMethodName = "/identity.TwoFaService/DisableTotp" - TwoFaService_StartTelegramEnrollment_FullMethodName = "/identity.TwoFaService/StartTelegramEnrollment" - TwoFaService_ConfirmTelegramEnrollment_FullMethodName = "/identity.TwoFaService/ConfirmTelegramEnrollment" - TwoFaService_DisableTelegram_FullMethodName = "/identity.TwoFaService/DisableTelegram" -) - -// TwoFaServiceClient is the client API for TwoFaService 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 TwoFaServiceClient interface { - GetTwoFaStatus(ctx context.Context, in *GetTwoFaStatusRequest, opts ...grpc.CallOption) (*GetTwoFaStatusResponse, error) - StartTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTotpEnrollmentResponse, error) - ConfirmTotpErollment(ctx context.Context, in *ConfirmTotpEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTotpEnrollmentResponse, error) - CancelTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*CancelTotpEnrollmentResponse, error) - DisableTotp(ctx context.Context, in *DisableTotpRequest, opts ...grpc.CallOption) (*DisableTotpResponse, error) - StartTelegramEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTelegramEnrollmentResponse, error) - ConfirmTelegramEnrollment(ctx context.Context, in *ConfirmTelegramEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTelegramEnrollmentResponse, error) - DisableTelegram(ctx context.Context, in *DisableTelegramRequest, opts ...grpc.CallOption) (*DisableTelegramResponse, error) -} - -type twoFaServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewTwoFaServiceClient(cc grpc.ClientConnInterface) TwoFaServiceClient { - return &twoFaServiceClient{cc} -} - -func (c *twoFaServiceClient) GetTwoFaStatus(ctx context.Context, in *GetTwoFaStatusRequest, opts ...grpc.CallOption) (*GetTwoFaStatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetTwoFaStatusResponse) - err := c.cc.Invoke(ctx, TwoFaService_GetTwoFaStatus_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) StartTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTotpEnrollmentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartTotpEnrollmentResponse) - err := c.cc.Invoke(ctx, TwoFaService_StartTotpEnrollment_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) ConfirmTotpErollment(ctx context.Context, in *ConfirmTotpEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTotpEnrollmentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConfirmTotpEnrollmentResponse) - err := c.cc.Invoke(ctx, TwoFaService_ConfirmTotpErollment_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) CancelTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*CancelTotpEnrollmentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CancelTotpEnrollmentResponse) - err := c.cc.Invoke(ctx, TwoFaService_CancelTotpEnrollment_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) DisableTotp(ctx context.Context, in *DisableTotpRequest, opts ...grpc.CallOption) (*DisableTotpResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DisableTotpResponse) - err := c.cc.Invoke(ctx, TwoFaService_DisableTotp_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) StartTelegramEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTelegramEnrollmentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartTelegramEnrollmentResponse) - err := c.cc.Invoke(ctx, TwoFaService_StartTelegramEnrollment_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) ConfirmTelegramEnrollment(ctx context.Context, in *ConfirmTelegramEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTelegramEnrollmentResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConfirmTelegramEnrollmentResponse) - err := c.cc.Invoke(ctx, TwoFaService_ConfirmTelegramEnrollment_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *twoFaServiceClient) DisableTelegram(ctx context.Context, in *DisableTelegramRequest, opts ...grpc.CallOption) (*DisableTelegramResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DisableTelegramResponse) - err := c.cc.Invoke(ctx, TwoFaService_DisableTelegram_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TwoFaServiceServer is the server API for TwoFaService service. -// All implementations must embed UnimplementedTwoFaServiceServer -// for forward compatibility. -type TwoFaServiceServer interface { - GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error) - StartTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTotpEnrollmentResponse, error) - ConfirmTotpErollment(context.Context, *ConfirmTotpEnrollmentRequest) (*ConfirmTotpEnrollmentResponse, error) - CancelTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*CancelTotpEnrollmentResponse, error) - DisableTotp(context.Context, *DisableTotpRequest) (*DisableTotpResponse, error) - StartTelegramEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTelegramEnrollmentResponse, error) - ConfirmTelegramEnrollment(context.Context, *ConfirmTelegramEnrollmentRequest) (*ConfirmTelegramEnrollmentResponse, error) - DisableTelegram(context.Context, *DisableTelegramRequest) (*DisableTelegramResponse, error) - mustEmbedUnimplementedTwoFaServiceServer() -} - -// UnimplementedTwoFaServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedTwoFaServiceServer struct{} - -func (UnimplementedTwoFaServiceServer) GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetTwoFaStatus not implemented") -} -func (UnimplementedTwoFaServiceServer) StartTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTotpEnrollmentResponse, error) { - return nil, status.Error(codes.Unimplemented, "method StartTotpEnrollment not implemented") -} -func (UnimplementedTwoFaServiceServer) ConfirmTotpErollment(context.Context, *ConfirmTotpEnrollmentRequest) (*ConfirmTotpEnrollmentResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ConfirmTotpErollment not implemented") -} -func (UnimplementedTwoFaServiceServer) CancelTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*CancelTotpEnrollmentResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CancelTotpEnrollment not implemented") -} -func (UnimplementedTwoFaServiceServer) DisableTotp(context.Context, *DisableTotpRequest) (*DisableTotpResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DisableTotp not implemented") -} -func (UnimplementedTwoFaServiceServer) StartTelegramEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTelegramEnrollmentResponse, error) { - return nil, status.Error(codes.Unimplemented, "method StartTelegramEnrollment not implemented") -} -func (UnimplementedTwoFaServiceServer) ConfirmTelegramEnrollment(context.Context, *ConfirmTelegramEnrollmentRequest) (*ConfirmTelegramEnrollmentResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ConfirmTelegramEnrollment not implemented") -} -func (UnimplementedTwoFaServiceServer) DisableTelegram(context.Context, *DisableTelegramRequest) (*DisableTelegramResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DisableTelegram not implemented") -} -func (UnimplementedTwoFaServiceServer) mustEmbedUnimplementedTwoFaServiceServer() {} -func (UnimplementedTwoFaServiceServer) testEmbeddedByValue() {} - -// UnsafeTwoFaServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TwoFaServiceServer will -// result in compilation errors. -type UnsafeTwoFaServiceServer interface { - mustEmbedUnimplementedTwoFaServiceServer() -} - -func RegisterTwoFaServiceServer(s grpc.ServiceRegistrar, srv TwoFaServiceServer) { - // If the following call panics, it indicates UnimplementedTwoFaServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&TwoFaService_ServiceDesc, srv) -} - -func _TwoFaService_GetTwoFaStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTwoFaStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).GetTwoFaStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_GetTwoFaStatus_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).GetTwoFaStatus(ctx, req.(*GetTwoFaStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_StartTotpEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthenticatedAccessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).StartTotpEnrollment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_StartTotpEnrollment_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).StartTotpEnrollment(ctx, req.(*AuthenticatedAccessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_ConfirmTotpErollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmTotpEnrollmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).ConfirmTotpErollment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_ConfirmTotpErollment_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).ConfirmTotpErollment(ctx, req.(*ConfirmTotpEnrollmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_CancelTotpEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthenticatedAccessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).CancelTotpEnrollment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_CancelTotpEnrollment_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).CancelTotpEnrollment(ctx, req.(*AuthenticatedAccessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_DisableTotp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableTotpRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).DisableTotp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_DisableTotp_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).DisableTotp(ctx, req.(*DisableTotpRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_StartTelegramEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthenticatedAccessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).StartTelegramEnrollment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_StartTelegramEnrollment_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).StartTelegramEnrollment(ctx, req.(*AuthenticatedAccessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_ConfirmTelegramEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmTelegramEnrollmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).ConfirmTelegramEnrollment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_ConfirmTelegramEnrollment_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).ConfirmTelegramEnrollment(ctx, req.(*ConfirmTelegramEnrollmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TwoFaService_DisableTelegram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableTelegramRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TwoFaServiceServer).DisableTelegram(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TwoFaService_DisableTelegram_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TwoFaServiceServer).DisableTelegram(ctx, req.(*DisableTelegramRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TwoFaService_ServiceDesc is the grpc.ServiceDesc for TwoFaService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TwoFaService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "identity.TwoFaService", - HandlerType: (*TwoFaServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetTwoFaStatus", - Handler: _TwoFaService_GetTwoFaStatus_Handler, - }, - { - MethodName: "StartTotpEnrollment", - Handler: _TwoFaService_StartTotpEnrollment_Handler, - }, - { - MethodName: "ConfirmTotpErollment", - Handler: _TwoFaService_ConfirmTotpErollment_Handler, - }, - { - MethodName: "CancelTotpEnrollment", - Handler: _TwoFaService_CancelTotpEnrollment_Handler, - }, - { - MethodName: "DisableTotp", - Handler: _TwoFaService_DisableTotp_Handler, - }, - { - MethodName: "StartTelegramEnrollment", - Handler: _TwoFaService_StartTelegramEnrollment_Handler, - }, - { - MethodName: "ConfirmTelegramEnrollment", - Handler: _TwoFaService_ConfirmTelegramEnrollment_Handler, - }, - { - MethodName: "DisableTelegram", - Handler: _TwoFaService_DisableTelegram_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "identity.proto", -} diff --git a/gen/go/ldap.pb.go b/gen/go/ldap.pb.go deleted file mode 100644 index 41d0ebf..0000000 --- a/gen/go/ldap.pb.go +++ /dev/null @@ -1,965 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v3.21.12 -// source: ldap.proto - -package pb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ========================================== -// БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ -// ========================================== -type EmptyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EmptyRequest) Reset() { - *x = EmptyRequest{} - mi := &file_ldap_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EmptyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EmptyRequest) ProtoMessage() {} - -func (x *EmptyRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. -func (*EmptyRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{0} -} - -// Стандартный ответ для мутаций (создание, обновление, удаление) -type StatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StatusResponse) Reset() { - *x = StatusResponse{} - mi := &file_ldap_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusResponse) ProtoMessage() {} - -func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. -func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{1} -} - -func (x *StatusResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *StatusResponse) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -// Полная модель пользователя -type UserData struct { - state protoimpl.MessageState `protogen:"open.v1"` - Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"` // Полный путь в AD (Distinguished Name) - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // Логин (sAMAccountName) - DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // ФИО (displayName) - Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Почта (mail) - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // Описание/Должность (description) - Avatar []byte `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"` // Аватарка в байтах (thumbnailPhoto) - Groups []string `protobuf:"bytes,7,rep,name=groups,proto3" json:"groups,omitempty"` // Список групп - IsActive bool `protobuf:"varint,8,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` // Статус аккаунта - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UserData) Reset() { - *x = UserData{} - mi := &file_ldap_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UserData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserData) ProtoMessage() {} - -func (x *UserData) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserData.ProtoReflect.Descriptor instead. -func (*UserData) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{2} -} - -func (x *UserData) GetDn() string { - if x != nil { - return x.Dn - } - return "" -} - -func (x *UserData) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *UserData) GetDisplayName() string { - if x != nil { - return x.DisplayName - } - return "" -} - -func (x *UserData) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *UserData) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *UserData) GetAvatar() []byte { - if x != nil { - return x.Avatar - } - return nil -} - -func (x *UserData) GetGroups() []string { - if x != nil { - return x.Groups - } - return nil -} - -func (x *UserData) GetIsActive() bool { - if x != nil { - return x.IsActive - } - return false -} - -// Модель группы -type GroupData struct { - state protoimpl.MessageState `protogen:"open.v1"` - Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Короткое имя группы (cn) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupData) Reset() { - *x = GroupData{} - mi := &file_ldap_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupData) ProtoMessage() {} - -func (x *GroupData) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupData.ProtoReflect.Descriptor instead. -func (*GroupData) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{3} -} - -func (x *GroupData) GetDn() string { - if x != nil { - return x.Dn - } - return "" -} - -func (x *GroupData) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// --- Авторизация --- -type VerifyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VerifyRequest) Reset() { - *x = VerifyRequest{} - mi := &file_ldap_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VerifyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VerifyRequest) ProtoMessage() {} - -func (x *VerifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead. -func (*VerifyRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{4} -} - -func (x *VerifyRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *VerifyRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type VerifyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - User *UserData `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` // Отдаем полные данные при успешном входе - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VerifyResponse) Reset() { - *x = VerifyResponse{} - mi := &file_ldap_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VerifyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VerifyResponse) ProtoMessage() {} - -func (x *VerifyResponse) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead. -func (*VerifyResponse) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{5} -} - -func (x *VerifyResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *VerifyResponse) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -func (x *VerifyResponse) GetUser() *UserData { - if x != nil { - return x.User - } - return nil -} - -// --- Списки --- -type UserListResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - Users []*UserData `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UserListResponse) Reset() { - *x = UserListResponse{} - mi := &file_ldap_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UserListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserListResponse) ProtoMessage() {} - -func (x *UserListResponse) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserListResponse.ProtoReflect.Descriptor instead. -func (*UserListResponse) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{6} -} - -func (x *UserListResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *UserListResponse) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -func (x *UserListResponse) GetUsers() []*UserData { - if x != nil { - return x.Users - } - return nil -} - -type GroupListResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` - Groups []*GroupData `protobuf:"bytes,3,rep,name=groups,proto3" json:"groups,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupListResponse) Reset() { - *x = GroupListResponse{} - mi := &file_ldap_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupListResponse) ProtoMessage() {} - -func (x *GroupListResponse) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupListResponse.ProtoReflect.Descriptor instead. -func (*GroupListResponse) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{7} -} - -func (x *GroupListResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *GroupListResponse) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -func (x *GroupListResponse) GetGroups() []*GroupData { - if x != nil { - return x.Groups - } - return nil -} - -// --- Управление профилем --- -type CreateUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - FullName string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` - Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` - Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` // Сразу при создании можно задать почту - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateUserRequest) Reset() { - *x = CreateUserRequest{} - mi := &file_ldap_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUserRequest) ProtoMessage() {} - -func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. -func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{8} -} - -func (x *CreateUserRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *CreateUserRequest) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *CreateUserRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *CreateUserRequest) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -// Запрос на обновление. Используем optional для частичного обновления. -type UpdateUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // Обязательное поле: кого обновляем - DisplayName *string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"` // Новое ФИО (повлечет Rename CN) - Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` // Новая почта - Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` // Новое описание - Avatar []byte `protobuf:"bytes,5,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"` // Новая аватарка (бинарник картинки) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateUserRequest) Reset() { - *x = UpdateUserRequest{} - mi := &file_ldap_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserRequest) ProtoMessage() {} - -func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. -func (*UpdateUserRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateUserRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *UpdateUserRequest) GetDisplayName() string { - if x != nil && x.DisplayName != nil { - return *x.DisplayName - } - return "" -} - -func (x *UpdateUserRequest) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -func (x *UpdateUserRequest) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *UpdateUserRequest) GetAvatar() []byte { - if x != nil { - return x.Avatar - } - return nil -} - -type ChangePasswordRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - NewPassword string `protobuf:"bytes,2,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangePasswordRequest) Reset() { - *x = ChangePasswordRequest{} - mi := &file_ldap_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangePasswordRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePasswordRequest) ProtoMessage() {} - -func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead. -func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{10} -} - -func (x *ChangePasswordRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ChangePasswordRequest) GetNewPassword() string { - if x != nil { - return x.NewPassword - } - return "" -} - -type ToggleStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - SetActive bool `protobuf:"varint,2,opt,name=set_active,json=setActive,proto3" json:"set_active,omitempty"` // true - включить (512), false - отключить (514) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ToggleStatusRequest) Reset() { - *x = ToggleStatusRequest{} - mi := &file_ldap_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ToggleStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleStatusRequest) ProtoMessage() {} - -func (x *ToggleStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ToggleStatusRequest.ProtoReflect.Descriptor instead. -func (*ToggleStatusRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{11} -} - -func (x *ToggleStatusRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ToggleStatusRequest) GetSetActive() bool { - if x != nil { - return x.SetActive - } - return false -} - -// --- Управление членством в группах --- -type GroupMemberRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // Логин пользователя - GroupDn string `protobuf:"bytes,2,opt,name=group_dn,json=groupDn,proto3" json:"group_dn,omitempty"` // Полный путь группы (в которую добавляем / из которой удаляем) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberRequest) Reset() { - *x = GroupMemberRequest{} - mi := &file_ldap_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberRequest) ProtoMessage() {} - -func (x *GroupMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_ldap_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupMemberRequest.ProtoReflect.Descriptor instead. -func (*GroupMemberRequest) Descriptor() ([]byte, []int) { - return file_ldap_proto_rawDescGZIP(), []int{12} -} - -func (x *GroupMemberRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *GroupMemberRequest) GetGroupDn() string { - if x != nil { - return x.GroupDn - } - return "" -} - -var File_ldap_proto protoreflect.FileDescriptor - -const file_ldap_proto_rawDesc = "" + - "\n" + - "\n" + - "ldap.proto\x12\fldap_service\"\x0e\n" + - "\fEmptyRequest\"O\n" + - "\x0eStatusResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + - "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"\xde\x01\n" + - "\bUserData\x12\x0e\n" + - "\x02dn\x18\x01 \x01(\tR\x02dn\x12\x1a\n" + - "\busername\x18\x02 \x01(\tR\busername\x12!\n" + - "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12\x14\n" + - "\x05email\x18\x04 \x01(\tR\x05email\x12 \n" + - "\vdescription\x18\x05 \x01(\tR\vdescription\x12\x16\n" + - "\x06avatar\x18\x06 \x01(\fR\x06avatar\x12\x16\n" + - "\x06groups\x18\a \x03(\tR\x06groups\x12\x1b\n" + - "\tis_active\x18\b \x01(\bR\bisActive\"/\n" + - "\tGroupData\x12\x0e\n" + - "\x02dn\x18\x01 \x01(\tR\x02dn\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\"G\n" + - "\rVerifyRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\"{\n" + - "\x0eVerifyResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + - "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12*\n" + - "\x04user\x18\x03 \x01(\v2\x16.ldap_service.UserDataR\x04user\"\x7f\n" + - "\x10UserListResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + - "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12,\n" + - "\x05users\x18\x03 \x03(\v2\x16.ldap_service.UserDataR\x05users\"\x83\x01\n" + - "\x11GroupListResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + - "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12/\n" + - "\x06groups\x18\x03 \x03(\v2\x17.ldap_service.GroupDataR\x06groups\"\x8d\x01\n" + - "\x11CreateUserRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1b\n" + - "\tfull_name\x18\x02 \x01(\tR\bfullName\x12\x1a\n" + - "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x19\n" + - "\x05email\x18\x04 \x01(\tH\x00R\x05email\x88\x01\x01B\b\n" + - "\x06_email\"\xec\x01\n" + - "\x11UpdateUserRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12&\n" + - "\fdisplay_name\x18\x02 \x01(\tH\x00R\vdisplayName\x88\x01\x01\x12\x19\n" + - "\x05email\x18\x03 \x01(\tH\x01R\x05email\x88\x01\x01\x12%\n" + - "\vdescription\x18\x04 \x01(\tH\x02R\vdescription\x88\x01\x01\x12\x1b\n" + - "\x06avatar\x18\x05 \x01(\fH\x03R\x06avatar\x88\x01\x01B\x0f\n" + - "\r_display_nameB\b\n" + - "\x06_emailB\x0e\n" + - "\f_descriptionB\t\n" + - "\a_avatar\"V\n" + - "\x15ChangePasswordRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12!\n" + - "\fnew_password\x18\x02 \x01(\tR\vnewPassword\"P\n" + - "\x13ToggleStatusRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1d\n" + - "\n" + - "set_active\x18\x02 \x01(\bR\tsetActive\"K\n" + - "\x12GroupMemberRequest\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x19\n" + - "\bgroup_dn\x18\x02 \x01(\tR\agroupDn2\xd2\x05\n" + - "\bLdapAuth\x12G\n" + - "\n" + - "VerifyUser\x12\x1b.ldap_service.VerifyRequest\x1a\x1c.ldap_service.VerifyResponse\x12F\n" + - "\bGetUsers\x12\x1a.ldap_service.EmptyRequest\x1a\x1e.ldap_service.UserListResponse\x12K\n" + - "\n" + - "CreateUser\x12\x1f.ldap_service.CreateUserRequest\x1a\x1c.ldap_service.StatusResponse\x12K\n" + - "\n" + - "UpdateUser\x12\x1f.ldap_service.UpdateUserRequest\x1a\x1c.ldap_service.StatusResponse\x12S\n" + - "\x0eChangePassword\x12#.ldap_service.ChangePasswordRequest\x1a\x1c.ldap_service.StatusResponse\x12S\n" + - "\x10ToggleUserStatus\x12!.ldap_service.ToggleStatusRequest\x1a\x1c.ldap_service.StatusResponse\x12H\n" + - "\tGetGroups\x12\x1a.ldap_service.EmptyRequest\x1a\x1f.ldap_service.GroupListResponse\x12P\n" + - "\x0eAddUserToGroup\x12 .ldap_service.GroupMemberRequest\x1a\x1c.ldap_service.StatusResponse\x12U\n" + - "\x13RemoveUserFromGroup\x12 .ldap_service.GroupMemberRequest\x1a\x1c.ldap_service.StatusResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" - -var ( - file_ldap_proto_rawDescOnce sync.Once - file_ldap_proto_rawDescData []byte -) - -func file_ldap_proto_rawDescGZIP() []byte { - file_ldap_proto_rawDescOnce.Do(func() { - file_ldap_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ldap_proto_rawDesc), len(file_ldap_proto_rawDesc))) - }) - return file_ldap_proto_rawDescData -} - -var file_ldap_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_ldap_proto_goTypes = []any{ - (*EmptyRequest)(nil), // 0: ldap_service.EmptyRequest - (*StatusResponse)(nil), // 1: ldap_service.StatusResponse - (*UserData)(nil), // 2: ldap_service.UserData - (*GroupData)(nil), // 3: ldap_service.GroupData - (*VerifyRequest)(nil), // 4: ldap_service.VerifyRequest - (*VerifyResponse)(nil), // 5: ldap_service.VerifyResponse - (*UserListResponse)(nil), // 6: ldap_service.UserListResponse - (*GroupListResponse)(nil), // 7: ldap_service.GroupListResponse - (*CreateUserRequest)(nil), // 8: ldap_service.CreateUserRequest - (*UpdateUserRequest)(nil), // 9: ldap_service.UpdateUserRequest - (*ChangePasswordRequest)(nil), // 10: ldap_service.ChangePasswordRequest - (*ToggleStatusRequest)(nil), // 11: ldap_service.ToggleStatusRequest - (*GroupMemberRequest)(nil), // 12: ldap_service.GroupMemberRequest -} -var file_ldap_proto_depIdxs = []int32{ - 2, // 0: ldap_service.VerifyResponse.user:type_name -> ldap_service.UserData - 2, // 1: ldap_service.UserListResponse.users:type_name -> ldap_service.UserData - 3, // 2: ldap_service.GroupListResponse.groups:type_name -> ldap_service.GroupData - 4, // 3: ldap_service.LdapAuth.VerifyUser:input_type -> ldap_service.VerifyRequest - 0, // 4: ldap_service.LdapAuth.GetUsers:input_type -> ldap_service.EmptyRequest - 8, // 5: ldap_service.LdapAuth.CreateUser:input_type -> ldap_service.CreateUserRequest - 9, // 6: ldap_service.LdapAuth.UpdateUser:input_type -> ldap_service.UpdateUserRequest - 10, // 7: ldap_service.LdapAuth.ChangePassword:input_type -> ldap_service.ChangePasswordRequest - 11, // 8: ldap_service.LdapAuth.ToggleUserStatus:input_type -> ldap_service.ToggleStatusRequest - 0, // 9: ldap_service.LdapAuth.GetGroups:input_type -> ldap_service.EmptyRequest - 12, // 10: ldap_service.LdapAuth.AddUserToGroup:input_type -> ldap_service.GroupMemberRequest - 12, // 11: ldap_service.LdapAuth.RemoveUserFromGroup:input_type -> ldap_service.GroupMemberRequest - 5, // 12: ldap_service.LdapAuth.VerifyUser:output_type -> ldap_service.VerifyResponse - 6, // 13: ldap_service.LdapAuth.GetUsers:output_type -> ldap_service.UserListResponse - 1, // 14: ldap_service.LdapAuth.CreateUser:output_type -> ldap_service.StatusResponse - 1, // 15: ldap_service.LdapAuth.UpdateUser:output_type -> ldap_service.StatusResponse - 1, // 16: ldap_service.LdapAuth.ChangePassword:output_type -> ldap_service.StatusResponse - 1, // 17: ldap_service.LdapAuth.ToggleUserStatus:output_type -> ldap_service.StatusResponse - 7, // 18: ldap_service.LdapAuth.GetGroups:output_type -> ldap_service.GroupListResponse - 1, // 19: ldap_service.LdapAuth.AddUserToGroup:output_type -> ldap_service.StatusResponse - 1, // 20: ldap_service.LdapAuth.RemoveUserFromGroup:output_type -> ldap_service.StatusResponse - 12, // [12:21] is the sub-list for method output_type - 3, // [3:12] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_ldap_proto_init() } -func file_ldap_proto_init() { - if File_ldap_proto != nil { - return - } - file_ldap_proto_msgTypes[8].OneofWrappers = []any{} - file_ldap_proto_msgTypes[9].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_ldap_proto_rawDesc), len(file_ldap_proto_rawDesc)), - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_ldap_proto_goTypes, - DependencyIndexes: file_ldap_proto_depIdxs, - MessageInfos: file_ldap_proto_msgTypes, - }.Build() - File_ldap_proto = out.File - file_ldap_proto_goTypes = nil - file_ldap_proto_depIdxs = nil -} diff --git a/gen/go/ldap_grpc.pb.go b/gen/go/ldap_grpc.pb.go deleted file mode 100644 index 53bd45f..0000000 --- a/gen/go/ldap_grpc.pb.go +++ /dev/null @@ -1,439 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.1 -// - protoc v3.21.12 -// source: ldap.proto - -package pb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - LdapAuth_VerifyUser_FullMethodName = "/ldap_service.LdapAuth/VerifyUser" - LdapAuth_GetUsers_FullMethodName = "/ldap_service.LdapAuth/GetUsers" - LdapAuth_CreateUser_FullMethodName = "/ldap_service.LdapAuth/CreateUser" - LdapAuth_UpdateUser_FullMethodName = "/ldap_service.LdapAuth/UpdateUser" - LdapAuth_ChangePassword_FullMethodName = "/ldap_service.LdapAuth/ChangePassword" - LdapAuth_ToggleUserStatus_FullMethodName = "/ldap_service.LdapAuth/ToggleUserStatus" - LdapAuth_GetGroups_FullMethodName = "/ldap_service.LdapAuth/GetGroups" - LdapAuth_AddUserToGroup_FullMethodName = "/ldap_service.LdapAuth/AddUserToGroup" - LdapAuth_RemoveUserFromGroup_FullMethodName = "/ldap_service.LdapAuth/RemoveUserFromGroup" -) - -// LdapAuthClient is the client API for LdapAuth 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 LdapAuthClient interface { - // --- Вектор 1: Авторизация (Bind от имени пользователя) --- - VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) - // --- Вектор 2: Управление Пользователями (Bind системного аккаунта) --- - GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) - CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) - UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) - ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*StatusResponse, error) - ToggleUserStatus(ctx context.Context, in *ToggleStatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // --- Вектор 3: Управление Группами --- - GetGroups(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*GroupListResponse, error) - AddUserToGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) - RemoveUserFromGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) -} - -type ldapAuthClient struct { - cc grpc.ClientConnInterface -} - -func NewLdapAuthClient(cc grpc.ClientConnInterface) LdapAuthClient { - return &ldapAuthClient{cc} -} - -func (c *ldapAuthClient) VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(VerifyResponse) - err := c.cc.Invoke(ctx, LdapAuth_VerifyUser_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UserListResponse) - err := c.cc.Invoke(ctx, LdapAuth_GetUsers_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, LdapAuth_CreateUser_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, LdapAuth_UpdateUser_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, LdapAuth_ChangePassword_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) ToggleUserStatus(ctx context.Context, in *ToggleStatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, LdapAuth_ToggleUserStatus_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) GetGroups(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*GroupListResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GroupListResponse) - err := c.cc.Invoke(ctx, LdapAuth_GetGroups_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) AddUserToGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, LdapAuth_AddUserToGroup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ldapAuthClient) RemoveUserFromGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, LdapAuth_RemoveUserFromGroup_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LdapAuthServer is the server API for LdapAuth service. -// All implementations must embed UnimplementedLdapAuthServer -// for forward compatibility. -// -// ========================================== -// ГЛАВНЫЙ СЕРВИС -// ========================================== -type LdapAuthServer interface { - // --- Вектор 1: Авторизация (Bind от имени пользователя) --- - VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error) - // --- Вектор 2: Управление Пользователями (Bind системного аккаунта) --- - GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) - CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) - UpdateUser(context.Context, *UpdateUserRequest) (*StatusResponse, error) - ChangePassword(context.Context, *ChangePasswordRequest) (*StatusResponse, error) - ToggleUserStatus(context.Context, *ToggleStatusRequest) (*StatusResponse, error) - // --- Вектор 3: Управление Группами --- - GetGroups(context.Context, *EmptyRequest) (*GroupListResponse, error) - AddUserToGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) - RemoveUserFromGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) - mustEmbedUnimplementedLdapAuthServer() -} - -// UnimplementedLdapAuthServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedLdapAuthServer struct{} - -func (UnimplementedLdapAuthServer) VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method VerifyUser not implemented") -} -func (UnimplementedLdapAuthServer) GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented") -} -func (UnimplementedLdapAuthServer) CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented") -} -func (UnimplementedLdapAuthServer) UpdateUser(context.Context, *UpdateUserRequest) (*StatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented") -} -func (UnimplementedLdapAuthServer) ChangePassword(context.Context, *ChangePasswordRequest) (*StatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ChangePassword not implemented") -} -func (UnimplementedLdapAuthServer) ToggleUserStatus(context.Context, *ToggleStatusRequest) (*StatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ToggleUserStatus not implemented") -} -func (UnimplementedLdapAuthServer) GetGroups(context.Context, *EmptyRequest) (*GroupListResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetGroups not implemented") -} -func (UnimplementedLdapAuthServer) AddUserToGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method AddUserToGroup not implemented") -} -func (UnimplementedLdapAuthServer) RemoveUserFromGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) { - return nil, status.Error(codes.Unimplemented, "method RemoveUserFromGroup not implemented") -} -func (UnimplementedLdapAuthServer) mustEmbedUnimplementedLdapAuthServer() {} -func (UnimplementedLdapAuthServer) testEmbeddedByValue() {} - -// UnsafeLdapAuthServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LdapAuthServer will -// result in compilation errors. -type UnsafeLdapAuthServer interface { - mustEmbedUnimplementedLdapAuthServer() -} - -func RegisterLdapAuthServer(s grpc.ServiceRegistrar, srv LdapAuthServer) { - // If the following call panics, it indicates UnimplementedLdapAuthServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&LdapAuth_ServiceDesc, srv) -} - -func _LdapAuth_VerifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).VerifyUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_VerifyUser_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).VerifyUser(ctx, req.(*VerifyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).GetUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_GetUsers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).GetUsers(ctx, req.(*EmptyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).CreateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_CreateUser_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).CreateUser(ctx, req.(*CreateUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).UpdateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_UpdateUser_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).UpdateUser(ctx, req.(*UpdateUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangePasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).ChangePassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_ChangePassword_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_ToggleUserStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ToggleStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).ToggleUserStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_ToggleUserStatus_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).ToggleUserStatus(ctx, req.(*ToggleStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_GetGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).GetGroups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_GetGroups_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).GetGroups(ctx, req.(*EmptyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_AddUserToGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GroupMemberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).AddUserToGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_AddUserToGroup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).AddUserToGroup(ctx, req.(*GroupMemberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _LdapAuth_RemoveUserFromGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GroupMemberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LdapAuthServer).RemoveUserFromGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LdapAuth_RemoveUserFromGroup_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LdapAuthServer).RemoveUserFromGroup(ctx, req.(*GroupMemberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// LdapAuth_ServiceDesc is the grpc.ServiceDesc for LdapAuth service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var LdapAuth_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ldap_service.LdapAuth", - HandlerType: (*LdapAuthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "VerifyUser", - Handler: _LdapAuth_VerifyUser_Handler, - }, - { - MethodName: "GetUsers", - Handler: _LdapAuth_GetUsers_Handler, - }, - { - MethodName: "CreateUser", - Handler: _LdapAuth_CreateUser_Handler, - }, - { - MethodName: "UpdateUser", - Handler: _LdapAuth_UpdateUser_Handler, - }, - { - MethodName: "ChangePassword", - Handler: _LdapAuth_ChangePassword_Handler, - }, - { - MethodName: "ToggleUserStatus", - Handler: _LdapAuth_ToggleUserStatus_Handler, - }, - { - MethodName: "GetGroups", - Handler: _LdapAuth_GetGroups_Handler, - }, - { - MethodName: "AddUserToGroup", - Handler: _LdapAuth_AddUserToGroup_Handler, - }, - { - MethodName: "RemoveUserFromGroup", - Handler: _LdapAuth_RemoveUserFromGroup_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ldap.proto", -} diff --git a/gen/identity.ts b/gen/identity.ts deleted file mode 100644 index 1db7373..0000000 --- a/gen/identity.ts +++ /dev/null @@ -1,367 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.11.6 -// protoc v3.21.12 -// source: identity.proto - -/* eslint-disable */ -import type { Metadata } from "@grpc/grpc-js"; -import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; -import { Observable } from "rxjs"; - -export const protobufPackage = "identity"; - -export interface LoginRequest { - username: string; - password: string; -} - -export interface LoginResponse { - accessToken: string; - refreshToken: string; - status: string; - need2fa: boolean; - tempToken?: string | undefined; - message?: string | undefined; - errorCode?: string | undefined; -} - -export interface RefreshRequest { - refreshToken: string; -} - -export interface RefreshResponse { - accessToken: string; - refreshToken: string; -} - -export interface LogoutRequest { - accessToken: string; -} - -export interface LogoutResponse { - success: boolean; - message: string; -} - -export interface VerifyTokenRequest { - token: string; -} - -export interface VerifyTokenResponse { - isValid: boolean; - errorMessage?: string | undefined; - id?: string | undefined; - username?: string | undefined; - roleLevel?: number | undefined; - permissions: string[]; - sessionId?: string | undefined; - requiresPin?: boolean | undefined; -} - -export interface GetAccountRoleLevelRequest { - accountId: string; -} - -export interface GetAccountRoleLevelResponse { - found: boolean; - roleLevel: number; -} - -export interface UnlockPinRequest { - accessToken: string; - pinCode: string; -} - -export interface UnlockPinResponse { - success: boolean; - message: string; -} - -export interface Verify2FaRequest { - tempToken: string; - totpCode?: string | undefined; - telegramCode?: string | undefined; -} - -export interface Verify2FaResponse { - accessToken: string; - refreshToken: string; - status: string; - message: string; - reserveCodes: string[]; -} - -export interface AuthenticatedAccessRequest { - accessToken: string; -} - -export interface GetTwoFaStatusRequest { - accessToken: string; -} - -export interface GetTwoFaStatusResponse { - totpEnabled: boolean; - telegramEnabled: boolean; - totpEnrollmentPending: boolean; - telegramEnrollmentPending: boolean; -} - -export interface StartTotpEnrollmentResponse { - secretBase32: string; - otpauthUri: string; - issuer: string; - accountLabel: string; -} - -export interface ConfirmTotpEnrollmentRequest { - accessToken: string; - totpCode: string; -} - -export interface ConfirmTotpEnrollmentResponse { - status: string; - message: string; - reserveCodes: string[]; -} - -export interface CancelTotpEnrollmentResponse { - status: string; - message: string; -} - -export interface DisableTotpRequest { - accessToken: string; - password: string; - totpCode?: string | undefined; -} - -export interface DisableTotpResponse { - status: string; - message: string; -} - -export interface StartTelegramEnrollmentResponse { - enrollmentToken: string; - deepLink: string; - botUsername: string; - expiresAtIso: string; -} - -export interface ConfirmTelegramEnrollmentRequest { - accessToken: string; - enrollmentToken: string; - otpCode: string; -} - -export interface ConfirmTelegramEnrollmentResponse { - status: string; - message: string; - reserveCodes: string[]; -} - -export interface DisableTelegramRequest { - accessToken: string; - password: string; - telegramOtpCode?: string | undefined; -} - -export interface DisableTelegramResponse { - status: string; - message: string; -} - -export const IDENTITY_PACKAGE_NAME = "identity"; - -export interface AuthServiceClient { - login(request: LoginRequest, metadata?: Metadata): Observable; - - refresh(request: RefreshRequest, metadata?: Metadata): Observable; - - verifyToken(request: VerifyTokenRequest, metadata?: Metadata): Observable; - - getAccountRoleLevel( - request: GetAccountRoleLevelRequest, - metadata?: Metadata, - ): Observable; - - logout(request: LogoutRequest, metadata?: Metadata): Observable; - - logoutAll(request: LogoutRequest, metadata?: Metadata): Observable; - - unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable; - - verify2Fa(request: Verify2FaRequest, metadata?: Metadata): Observable; -} - -export interface AuthServiceController { - login(request: LoginRequest, metadata?: Metadata): Promise | Observable | LoginResponse; - - refresh( - request: RefreshRequest, - metadata?: Metadata, - ): Promise | Observable | RefreshResponse; - - verifyToken( - request: VerifyTokenRequest, - metadata?: Metadata, - ): Promise | Observable | VerifyTokenResponse; - - getAccountRoleLevel( - request: GetAccountRoleLevelRequest, - metadata?: Metadata, - ): Promise | Observable | GetAccountRoleLevelResponse; - - logout( - request: LogoutRequest, - metadata?: Metadata, - ): Promise | Observable | LogoutResponse; - - logoutAll( - request: LogoutRequest, - metadata?: Metadata, - ): Promise | Observable | LogoutResponse; - - unlockPin( - request: UnlockPinRequest, - metadata?: Metadata, - ): Promise | Observable | UnlockPinResponse; - - verify2Fa( - request: Verify2FaRequest, - metadata?: Metadata, - ): Promise | Observable | Verify2FaResponse; -} - -export function AuthServiceControllerMethods() { - return function (constructor: Function) { - const grpcMethods: string[] = [ - "login", - "refresh", - "verifyToken", - "getAccountRoleLevel", - "logout", - "logoutAll", - "unlockPin", - "verify2Fa", - ]; - for (const method of grpcMethods) { - const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); - GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor); - } - const grpcStreamMethods: string[] = []; - for (const method of grpcStreamMethods) { - const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); - GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor); - } - }; -} - -export const AUTH_SERVICE_NAME = "AuthService"; - -export interface TwoFaServiceClient { - getTwoFaStatus(request: GetTwoFaStatusRequest, metadata?: Metadata): Observable; - - startTotpEnrollment( - request: AuthenticatedAccessRequest, - metadata?: Metadata, - ): Observable; - - confirmTotpErollment( - request: ConfirmTotpEnrollmentRequest, - metadata?: Metadata, - ): Observable; - - cancelTotpEnrollment( - request: AuthenticatedAccessRequest, - metadata?: Metadata, - ): Observable; - - disableTotp(request: DisableTotpRequest, metadata?: Metadata): Observable; - - startTelegramEnrollment( - request: AuthenticatedAccessRequest, - metadata?: Metadata, - ): Observable; - - confirmTelegramEnrollment( - request: ConfirmTelegramEnrollmentRequest, - metadata?: Metadata, - ): Observable; - - disableTelegram(request: DisableTelegramRequest, metadata?: Metadata): Observable; -} - -export interface TwoFaServiceController { - getTwoFaStatus( - request: GetTwoFaStatusRequest, - metadata?: Metadata, - ): Promise | Observable | GetTwoFaStatusResponse; - - startTotpEnrollment( - request: AuthenticatedAccessRequest, - metadata?: Metadata, - ): Promise | Observable | StartTotpEnrollmentResponse; - - confirmTotpErollment( - request: ConfirmTotpEnrollmentRequest, - metadata?: Metadata, - ): Promise | Observable | ConfirmTotpEnrollmentResponse; - - cancelTotpEnrollment( - request: AuthenticatedAccessRequest, - metadata?: Metadata, - ): Promise | Observable | CancelTotpEnrollmentResponse; - - disableTotp( - request: DisableTotpRequest, - metadata?: Metadata, - ): Promise | Observable | DisableTotpResponse; - - startTelegramEnrollment( - request: AuthenticatedAccessRequest, - metadata?: Metadata, - ): - | Promise - | Observable - | StartTelegramEnrollmentResponse; - - confirmTelegramEnrollment( - request: ConfirmTelegramEnrollmentRequest, - metadata?: Metadata, - ): - | Promise - | Observable - | ConfirmTelegramEnrollmentResponse; - - disableTelegram( - request: DisableTelegramRequest, - metadata?: Metadata, - ): Promise | Observable | DisableTelegramResponse; -} - -export function TwoFaServiceControllerMethods() { - return function (constructor: Function) { - const grpcMethods: string[] = [ - "getTwoFaStatus", - "startTotpEnrollment", - "confirmTotpErollment", - "cancelTotpEnrollment", - "disableTotp", - "startTelegramEnrollment", - "confirmTelegramEnrollment", - "disableTelegram", - ]; - for (const method of grpcMethods) { - const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); - GrpcMethod("TwoFaService", method)(constructor.prototype[method], method, descriptor); - } - const grpcStreamMethods: string[] = []; - for (const method of grpcStreamMethods) { - const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); - GrpcStreamMethod("TwoFaService", method)(constructor.prototype[method], method, descriptor); - } - }; -} - -export const TWO_FA_SERVICE_NAME = "TwoFaService"; diff --git a/gen/ldap.ts b/gen/ldap.ts deleted file mode 100644 index 3dfa0fd..0000000 --- a/gen/ldap.ts +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by protoc-gen-ts_proto. DO NOT EDIT. -// versions: -// protoc-gen-ts_proto v2.11.6 -// protoc v3.21.12 -// source: ldap.proto - -/* eslint-disable */ -import type { Metadata } from "@grpc/grpc-js"; -import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; -import { Observable } from "rxjs"; - -export const protobufPackage = "ldap_service"; - -/** - * ========================================== - * БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ - * ========================================== - */ -export interface EmptyRequest { -} - -/** Стандартный ответ для мутаций (создание, обновление, удаление) */ -export interface StatusResponse { - success: boolean; - errorMessage: string; -} - -/** Полная модель пользователя */ -export interface UserData { - /** Полный путь в AD (Distinguished Name) */ - dn: string; - /** Логин (sAMAccountName) */ - username: string; - /** ФИО (displayName) */ - displayName: string; - /** Почта (mail) */ - email: string; - /** Описание/Должность (description) */ - description: string; - /** Аватарка в байтах (thumbnailPhoto) */ - avatar: Uint8Array; - /** Список групп */ - groups: string[]; - /** Статус аккаунта */ - isActive: boolean; -} - -/** Модель группы */ -export interface GroupData { - dn: string; - /** Короткое имя группы (cn) */ - name: string; -} - -/** --- Авторизация --- */ -export interface VerifyRequest { - username: string; - password: string; -} - -export interface VerifyResponse { - success: boolean; - errorMessage: string; - /** Отдаем полные данные при успешном входе */ - user: UserData | undefined; -} - -/** --- Списки --- */ -export interface UserListResponse { - success: boolean; - errorMessage: string; - users: UserData[]; -} - -export interface GroupListResponse { - success: boolean; - errorMessage: string; - groups: GroupData[]; -} - -/** --- Управление профилем --- */ -export interface CreateUserRequest { - username: string; - fullName: string; - password: string; - /** Сразу при создании можно задать почту */ - email?: string | undefined; -} - -/** Запрос на обновление. Используем optional для частичного обновления. */ -export interface UpdateUserRequest { - /** Обязательное поле: кого обновляем */ - username: string; - /** Новое ФИО (повлечет Rename CN) */ - displayName?: - | string - | undefined; - /** Новая почта */ - email?: - | string - | undefined; - /** Новое описание */ - description?: - | string - | undefined; - /** Новая аватарка (бинарник картинки) */ - avatar?: Uint8Array | undefined; -} - -export interface ChangePasswordRequest { - username: string; - newPassword: string; -} - -export interface ToggleStatusRequest { - username: string; - /** true - включить (512), false - отключить (514) */ - setActive: boolean; -} - -/** --- Управление членством в группах --- */ -export interface GroupMemberRequest { - /** Логин пользователя */ - username: string; - /** Полный путь группы (в которую добавляем / из которой удаляем) */ - groupDn: string; -} - -export const LDAP_SERVICE_PACKAGE_NAME = "ldap_service"; - -/** - * ========================================== - * ГЛАВНЫЙ СЕРВИС - * ========================================== - */ - -export interface LdapAuthClient { - /** --- Вектор 1: Авторизация (Bind от имени пользователя) --- */ - - verifyUser(request: VerifyRequest, metadata?: Metadata): Observable; - - /** --- Вектор 2: Управление Пользователями (Bind системного аккаунта) --- */ - - getUsers(request: EmptyRequest, metadata?: Metadata): Observable; - - createUser(request: CreateUserRequest, metadata?: Metadata): Observable; - - updateUser(request: UpdateUserRequest, metadata?: Metadata): Observable; - - changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable; - - toggleUserStatus(request: ToggleStatusRequest, metadata?: Metadata): Observable; - - /** --- Вектор 3: Управление Группами --- */ - - getGroups(request: EmptyRequest, metadata?: Metadata): Observable; - - addUserToGroup(request: GroupMemberRequest, metadata?: Metadata): Observable; - - removeUserFromGroup(request: GroupMemberRequest, metadata?: Metadata): Observable; -} - -/** - * ========================================== - * ГЛАВНЫЙ СЕРВИС - * ========================================== - */ - -export interface LdapAuthController { - /** --- Вектор 1: Авторизация (Bind от имени пользователя) --- */ - - verifyUser( - request: VerifyRequest, - metadata?: Metadata, - ): Promise | Observable | VerifyResponse; - - /** --- Вектор 2: Управление Пользователями (Bind системного аккаунта) --- */ - - getUsers( - request: EmptyRequest, - metadata?: Metadata, - ): Promise | Observable | UserListResponse; - - createUser( - request: CreateUserRequest, - metadata?: Metadata, - ): Promise | Observable | StatusResponse; - - updateUser( - request: UpdateUserRequest, - metadata?: Metadata, - ): Promise | Observable | StatusResponse; - - changePassword( - request: ChangePasswordRequest, - metadata?: Metadata, - ): Promise | Observable | StatusResponse; - - toggleUserStatus( - request: ToggleStatusRequest, - metadata?: Metadata, - ): Promise | Observable | StatusResponse; - - /** --- Вектор 3: Управление Группами --- */ - - getGroups( - request: EmptyRequest, - metadata?: Metadata, - ): Promise | Observable | GroupListResponse; - - addUserToGroup( - request: GroupMemberRequest, - metadata?: Metadata, - ): Promise | Observable | StatusResponse; - - removeUserFromGroup( - request: GroupMemberRequest, - metadata?: Metadata, - ): Promise | Observable | StatusResponse; -} - -export function LdapAuthControllerMethods() { - return function (constructor: Function) { - const grpcMethods: string[] = [ - "verifyUser", - "getUsers", - "createUser", - "updateUser", - "changePassword", - "toggleUserStatus", - "getGroups", - "addUserToGroup", - "removeUserFromGroup", - ]; - for (const method of grpcMethods) { - const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); - GrpcMethod("LdapAuth", method)(constructor.prototype[method], method, descriptor); - } - const grpcStreamMethods: string[] = []; - for (const method of grpcStreamMethods) { - const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); - GrpcStreamMethod("LdapAuth", method)(constructor.prototype[method], method, descriptor); - } - }; -} - -export const LDAP_AUTH_SERVICE_NAME = "LdapAuth"; diff --git a/package.json b/package.json index b0b5d49..4d403be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lendry-erp/contracts", - "version": "1.0.27", + "version": "1.0.28", "description": "Protobuf definitions and generated TypeScript types", "type": "commonjs", "main": "./dist/index.js", diff --git a/proto/account.proto b/proto/account.proto new file mode 100644 index 0000000..dc088d2 --- /dev/null +++ b/proto/account.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package account; + +service AccountService { + rpc GetAccount(GetAccountRequest) returns (GetAccountResponse); +} + +message GetAccountRequest { + string id = 1; +} + +message GetAccountResponse { + string id = 1; + string username = 2; + string email = 3; + string phone = 4; + string full_name = 5; + bool is_ldap = 6; + string status = 7; + repeated string roles = 8; + string avatar_url = 9; + optional string employee_id = 10; + Presence presence = 11; + string last_active = 12; + string custom_status_text = 13; + string custom_status_emoji = 14; + string timezone = 15; + string language = 16; + bool two_fa_enabled = 17; + bool has_pin = 18; +} + +enum Presence { + PRESENCE_UNSPECIFIED = 0; + OFFLINE = 1; + ONLINE = 2; +} + diff --git a/proto/auth.proto b/proto/auth.proto new file mode 100644 index 0000000..8fe5274 --- /dev/null +++ b/proto/auth.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; + +package auth.v1; + +option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; + +service AuthService { + rpc Login (LoginRequest) returns (LoginResponse); + rpc Refresh (RefreshRequest) returns (RefreshResponse); + rpc VerifyToken (VerifyTokenRequest) returns (VerifyTokenResponse); + rpc GetAccountRoleLevel (GetAccountRoleLevelRequest) returns (GetAccountRoleLevelResponse); + rpc Logout (LogoutRequest) returns (LogoutResponse); + rpc LogoutAll (LogoutRequest) returns (LogoutResponse); + rpc UnlockPin (UnlockPinRequest) returns (UnlockPinResponse); + +} + +message LoginRequest { + string username = 1; + string password = 2; +} + +message LoginResponse { + string access_token = 1; + string refresh_token = 2; + string status = 3; + bool need2fa = 4; + optional string temp_token = 5; + optional string message = 6; + optional string error_code = 7; +} + +message RefreshRequest { + string refresh_token = 1; +} + +message RefreshResponse { + string access_token = 1; + string refresh_token = 2; +} + +message LogoutRequest { + string access_token = 1; +} + +message LogoutResponse { + bool success = 1; + string message = 2; +} + +message VerifyTokenRequest { + string token = 1; +} + +message VerifyTokenResponse { + bool is_valid = 1; + optional string error_message = 2; + optional string id = 3; + optional string username = 4; + optional int32 role_level = 5; + repeated string permissions = 6; + optional string session_id = 7; + optional bool requires_pin = 8; +} + +message GetAccountRoleLevelRequest { + string account_id = 1; +} + +message GetAccountRoleLevelResponse { + bool found = 1; + int32 role_level = 2; +} + +message UnlockPinRequest { + string access_token = 1; + string pin_code = 2; +} + +message UnlockPinResponse { + bool success = 1; + string message = 2; +} + + diff --git a/proto/identity.proto b/proto/identity.proto deleted file mode 100644 index 7be795d..0000000 --- a/proto/identity.proto +++ /dev/null @@ -1,188 +0,0 @@ -syntax = "proto3"; - -package identity; - -option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; - -service AuthService { - rpc Login (LoginRequest) returns (LoginResponse); - rpc Refresh (RefreshRequest) returns (RefreshResponse); - rpc VerifyToken (VerifyTokenRequest) returns (VerifyTokenResponse); - rpc GetAccountRoleLevel (GetAccountRoleLevelRequest) returns (GetAccountRoleLevelResponse); - rpc Logout (LogoutRequest) returns (LogoutResponse); - rpc LogoutAll (LogoutRequest) returns (LogoutResponse); - rpc UnlockPin (UnlockPinRequest) returns (UnlockPinResponse); - rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse); -} - -service TwoFaService { - rpc GetTwoFaStatus (GetTwoFaStatusRequest) returns (GetTwoFaStatusResponse); - rpc StartTotpEnrollment (AuthenticatedAccessRequest) returns (StartTotpEnrollmentResponse); - rpc ConfirmTotpErollment (ConfirmTotpEnrollmentRequest) returns (ConfirmTotpEnrollmentResponse); - rpc CancelTotpEnrollment (AuthenticatedAccessRequest) returns (CancelTotpEnrollmentResponse); - rpc DisableTotp (DisableTotpRequest) returns (DisableTotpResponse); - rpc StartTelegramEnrollment (AuthenticatedAccessRequest) returns (StartTelegramEnrollmentResponse); - rpc ConfirmTelegramEnrollment (ConfirmTelegramEnrollmentRequest) returns (ConfirmTelegramEnrollmentResponse); - rpc DisableTelegram(DisableTelegramRequest) returns (DisableTelegramResponse); -} - -message LoginRequest { - string username = 1; - string password = 2; -} - -message LoginResponse { - string access_token = 1; - string refresh_token = 2; - string status = 3; - bool need2fa = 4; - optional string temp_token = 5; - optional string message = 6; - optional string error_code = 7; -} - -message RefreshRequest { - string refresh_token = 1; -} - -message RefreshResponse { - string access_token = 1; - string refresh_token = 2; -} - -message LogoutRequest { - string access_token = 1; -} - -message LogoutResponse { - bool success = 1; - string message = 2; -} - -message VerifyTokenRequest { - string token = 1; -} - -message VerifyTokenResponse { - bool is_valid = 1; - optional string error_message = 2; - optional string id = 3; - optional string username = 4; - optional int32 role_level = 5; - repeated string permissions = 6; - optional string session_id = 7; - optional bool requires_pin = 8; -} - -message GetAccountRoleLevelRequest { - string account_id = 1; -} - -message GetAccountRoleLevelResponse { - bool found = 1; - int32 role_level = 2; -} - -message UnlockPinRequest { - string access_token = 1; - string pin_code = 2; -} - -message UnlockPinResponse { - bool success = 1; - string message = 2; -} - - -message Verify2FaRequest { - string temp_token = 1; - optional string totp_code = 2; - optional string telegram_code = 3; -} - -message Verify2FaResponse { - string access_token = 1; - string refresh_token = 2; - string status = 3; - string message = 4; - repeated string reserve_codes = 5; -} - -message AuthenticatedAccessRequest { - string access_token = 1; -} - -message GetTwoFaStatusRequest { - string access_token = 1; -} - -message GetTwoFaStatusResponse { - bool totp_enabled = 1; - bool telegram_enabled = 2; - bool totp_enrollment_pending = 3; - bool telegram_enrollment_pending = 4; -} - -message StartTotpEnrollmentResponse { - string secret_base32 = 1; - string otpauth_uri = 2; - string issuer = 3; - string account_label = 4; -} - -message ConfirmTotpEnrollmentRequest { - string access_token = 1; - string totp_code = 2; -} - -message ConfirmTotpEnrollmentResponse { - string status = 1; - string message = 2; - repeated string reserve_codes = 3; -} - -message CancelTotpEnrollmentResponse { - string status = 1; - string message = 2; -} - -message DisableTotpRequest { - string access_token = 1; - string password = 2; - optional string totp_code = 3; -} - -message DisableTotpResponse { - string status = 1; - string message = 2; -} - -message StartTelegramEnrollmentResponse { - string enrollment_token = 1; - string deep_link = 2; - string bot_username = 3; - string expires_at_iso = 4; -} - -message ConfirmTelegramEnrollmentRequest { - string access_token = 1; - string enrollment_token = 2; - string otp_code = 3; -} - -message ConfirmTelegramEnrollmentResponse { - string status = 1; - string message = 2; - repeated string reserve_codes=3; -} - -message DisableTelegramRequest { - string access_token = 1; - string password = 2; - optional string telegram_otp_code = 3; -} - -message DisableTelegramResponse { - string status = 1; - string message = 2; -} \ No newline at end of file diff --git a/proto/ldap-auth.proto b/proto/ldap-auth.proto new file mode 100644 index 0000000..3daa7a0 --- /dev/null +++ b/proto/ldap-auth.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package ldap_auth.v1; + +option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; + + +service LdapAuthService { + rpc VerifyUser (VerifyRequest) returns (VerifyResponse); + +} + +// ========================================== +// БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ +// ========================================== + +// Полная модель пользователя +message UserData { + string dn = 1; // Полный путь в AD (Distinguished Name) + string username = 2; // Логин (sAMAccountName) + string display_name = 3; // ФИО (displayName) + string email = 4; // Почта (mail) + string description = 5; // Описание/Должность (description) + bytes avatar = 6; // Аватарка в байтах (thumbnailPhoto) + repeated string groups = 7; // Список групп + bool is_active = 8; // Статус аккаунта +} + + +// ========================================== +// ЗАПРОСЫ И ОТВЕТЫ (REQUESTS / RESPONSES) +// ========================================== + +// --- Авторизация --- +message VerifyRequest { + string username = 1; + string password = 2; +} + +message VerifyResponse { + bool success = 1; + string error_message = 2; + UserData user = 3; // Отдаем полные данные при успешном входе +} + diff --git a/proto/ldap.proto b/proto/ldap.proto index ab2f94e..554f57f 100644 --- a/proto/ldap.proto +++ b/proto/ldap.proto @@ -1,24 +1,18 @@ syntax = "proto3"; -package ldap_service; +package ldap.v1; option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; -// ========================================== -// ГЛАВНЫЙ СЕРВИС -// ========================================== -service LdapAuth { - // --- Вектор 1: Авторизация (Bind от имени пользователя) --- - rpc VerifyUser (VerifyRequest) returns (VerifyResponse); - - // --- Вектор 2: Управление Пользователями (Bind системного аккаунта) --- +service LdapService { + // Управление Пользователями (Bind системного аккаунта) --- rpc GetUsers (EmptyRequest) returns (UserListResponse); rpc CreateUser (CreateUserRequest) returns (StatusResponse); rpc UpdateUser (UpdateUserRequest) returns (StatusResponse); rpc ChangePassword (ChangePasswordRequest) returns (StatusResponse); rpc ToggleUserStatus (ToggleStatusRequest) returns (StatusResponse); - // --- Вектор 3: Управление Группами --- + // Управление Группами --- rpc GetGroups (EmptyRequest) returns (GroupListResponse); rpc AddUserToGroup (GroupMemberRequest) returns (StatusResponse); rpc RemoveUserFromGroup (GroupMemberRequest) returns (StatusResponse); @@ -53,22 +47,6 @@ message GroupData { string name = 2; // Короткое имя группы (cn) } -// ========================================== -// ЗАПРОСЫ И ОТВЕТЫ (REQUESTS / RESPONSES) -// ========================================== - -// --- Авторизация --- -message VerifyRequest { - string username = 1; - string password = 2; -} - -message VerifyResponse { - bool success = 1; - string error_message = 2; - UserData user = 3; // Отдаем полные данные при успешном входе -} - // --- Списки --- message UserListResponse { bool success = 1; diff --git a/proto/twofa.proto b/proto/twofa.proto new file mode 100644 index 0000000..db95ddc --- /dev/null +++ b/proto/twofa.proto @@ -0,0 +1,111 @@ +syntax = "proto3"; + +package twofa.v1; + +option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; + +service TwoFaService { + rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse); + rpc GetTwoFaStatus (GetTwoFaStatusRequest) returns (GetTwoFaStatusResponse); + rpc StartTotpEnrollment (AuthenticatedAccessRequest) returns (StartTotpEnrollmentResponse); + rpc ConfirmTotpErollment (ConfirmTotpEnrollmentRequest) returns (ConfirmTotpEnrollmentResponse); + rpc CancelTotpEnrollment (AuthenticatedAccessRequest) returns (CancelTotpEnrollmentResponse); + rpc DisableTotp (DisableTotpRequest) returns (DisableTotpResponse); + rpc StartTelegramEnrollment (AuthenticatedAccessRequest) returns (StartTelegramEnrollmentResponse); + rpc ConfirmTelegramEnrollment (ConfirmTelegramEnrollmentRequest) returns (ConfirmTelegramEnrollmentResponse); + rpc DisableTelegram(DisableTelegramRequest) returns (DisableTelegramResponse); +} + +message Verify2FaRequest { + string temp_token = 1; + optional string totp_code = 2; + optional string telegram_code = 3; +} + +message Verify2FaResponse { + string access_token = 1; + string refresh_token = 2; + string status = 3; + string message = 4; + repeated string reserve_codes = 5; +} + +message AuthenticatedAccessRequest { + string access_token = 1; +} + +message GetTwoFaStatusRequest { + string access_token = 1; +} + +message GetTwoFaStatusResponse { + bool totp_enabled = 1; + bool telegram_enabled = 2; + bool totp_enrollment_pending = 3; + bool telegram_enrollment_pending = 4; +} + +message StartTotpEnrollmentResponse { + string secret_base32 = 1; + string otpauth_uri = 2; + string issuer = 3; + string account_label = 4; +} + +message ConfirmTotpEnrollmentRequest { + string access_token = 1; + string totp_code = 2; +} + +message ConfirmTotpEnrollmentResponse { + string status = 1; + string message = 2; + repeated string reserve_codes = 3; +} + +message CancelTotpEnrollmentResponse { + string status = 1; + string message = 2; +} + +message DisableTotpRequest { + string access_token = 1; + string password = 2; + optional string totp_code = 3; +} + +message DisableTotpResponse { + string status = 1; + string message = 2; +} + +message StartTelegramEnrollmentResponse { + string enrollment_token = 1; + string deep_link = 2; + string bot_username = 3; + string expires_at_iso = 4; +} + +message ConfirmTelegramEnrollmentRequest { + string access_token = 1; + string enrollment_token = 2; + string otp_code = 3; +} + +message ConfirmTelegramEnrollmentResponse { + string status = 1; + string message = 2; + repeated string reserve_codes=3; +} + +message DisableTelegramRequest { + string access_token = 1; + string password = 2; + optional string telegram_otp_code = 3; +} + +message DisableTelegramResponse { + string status = 1; + string message = 2; +} +