chore: auto-generate protobuf files [skip ci]

This commit is contained in:
github-actions[bot]
2026-04-09 14:06:47 +00:00
parent 59d4d442b2
commit 6b1d534b65
6 changed files with 1212 additions and 82 deletions

View File

@@ -87,6 +87,27 @@ export interface ChangeDataResponse {
message: string; message: string;
} }
export interface AssignRoleRequest {
userId: string;
/** В gRPC передаем как string, внутри преобразуем в Int */
roleId: string;
}
export interface AssignRoleResponse {
success: boolean;
message: string;
}
export interface RevokeRoleRequest {
userId: string;
roleId: string;
}
export interface RevokeRoleResponse {
success: boolean;
message: string;
}
export interface AdminResetPasswordRequest { export interface AdminResetPasswordRequest {
userId: string; userId: string;
newPassword: string; newPassword: string;
@@ -156,6 +177,10 @@ export interface AccountServiceClient {
changeData(request: ChangeDataRequest, metadata?: Metadata): Observable<ChangeDataResponse>; changeData(request: ChangeDataRequest, metadata?: Metadata): Observable<ChangeDataResponse>;
assignRole(request: AssignRoleRequest, metadata?: Metadata): Observable<AssignRoleResponse>;
revokeRole(request: RevokeRoleRequest, metadata?: Metadata): Observable<RevokeRoleResponse>;
setPin(request: SetPinRequest, metadata?: Metadata): Observable<SetPinResponse>; setPin(request: SetPinRequest, metadata?: Metadata): Observable<SetPinResponse>;
unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable<UnlockPinResponse>; unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable<UnlockPinResponse>;
@@ -196,6 +221,16 @@ export interface AccountServiceController {
metadata?: Metadata, metadata?: Metadata,
): Promise<ChangeDataResponse> | Observable<ChangeDataResponse> | ChangeDataResponse; ): Promise<ChangeDataResponse> | Observable<ChangeDataResponse> | ChangeDataResponse;
assignRole(
request: AssignRoleRequest,
metadata?: Metadata,
): Promise<AssignRoleResponse> | Observable<AssignRoleResponse> | AssignRoleResponse;
revokeRole(
request: RevokeRoleRequest,
metadata?: Metadata,
): Promise<RevokeRoleResponse> | Observable<RevokeRoleResponse> | RevokeRoleResponse;
setPin( setPin(
request: SetPinRequest, request: SetPinRequest,
metadata?: Metadata, metadata?: Metadata,
@@ -226,6 +261,8 @@ export function AccountServiceControllerMethods() {
"createUser", "createUser",
"deleteUser", "deleteUser",
"changeData", "changeData",
"assignRole",
"revokeRole",
"setPin", "setPin",
"unlockPin", "unlockPin",
"getPinStatus", "getPinStatus",

View File

@@ -749,6 +749,214 @@ func (x *ChangeDataResponse) GetMessage() string {
return "" return ""
} }
type AssignRoleRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // В gRPC передаем как string, внутри преобразуем в Int
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AssignRoleRequest) Reset() {
*x = AssignRoleRequest{}
mi := &file_account_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AssignRoleRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AssignRoleRequest) ProtoMessage() {}
func (x *AssignRoleRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_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 AssignRoleRequest.ProtoReflect.Descriptor instead.
func (*AssignRoleRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{10}
}
func (x *AssignRoleRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *AssignRoleRequest) GetRoleId() string {
if x != nil {
return x.RoleId
}
return ""
}
type AssignRoleResponse 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 *AssignRoleResponse) Reset() {
*x = AssignRoleResponse{}
mi := &file_account_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AssignRoleResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AssignRoleResponse) ProtoMessage() {}
func (x *AssignRoleResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_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 AssignRoleResponse.ProtoReflect.Descriptor instead.
func (*AssignRoleResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{11}
}
func (x *AssignRoleResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *AssignRoleResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type RevokeRoleRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RevokeRoleRequest) Reset() {
*x = RevokeRoleRequest{}
mi := &file_account_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RevokeRoleRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RevokeRoleRequest) ProtoMessage() {}
func (x *RevokeRoleRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_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 RevokeRoleRequest.ProtoReflect.Descriptor instead.
func (*RevokeRoleRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{12}
}
func (x *RevokeRoleRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *RevokeRoleRequest) GetRoleId() string {
if x != nil {
return x.RoleId
}
return ""
}
type RevokeRoleResponse 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 *RevokeRoleResponse) Reset() {
*x = RevokeRoleResponse{}
mi := &file_account_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RevokeRoleResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RevokeRoleResponse) ProtoMessage() {}
func (x *RevokeRoleResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_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 RevokeRoleResponse.ProtoReflect.Descriptor instead.
func (*RevokeRoleResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{13}
}
func (x *RevokeRoleResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *RevokeRoleResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type AdminResetPasswordRequest struct { type AdminResetPasswordRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
@@ -759,7 +967,7 @@ type AdminResetPasswordRequest struct {
func (x *AdminResetPasswordRequest) Reset() { func (x *AdminResetPasswordRequest) Reset() {
*x = AdminResetPasswordRequest{} *x = AdminResetPasswordRequest{}
mi := &file_account_proto_msgTypes[10] mi := &file_account_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -771,7 +979,7 @@ func (x *AdminResetPasswordRequest) String() string {
func (*AdminResetPasswordRequest) ProtoMessage() {} func (*AdminResetPasswordRequest) ProtoMessage() {}
func (x *AdminResetPasswordRequest) ProtoReflect() protoreflect.Message { func (x *AdminResetPasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[10] mi := &file_account_proto_msgTypes[14]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -784,7 +992,7 @@ func (x *AdminResetPasswordRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AdminResetPasswordRequest.ProtoReflect.Descriptor instead. // Deprecated: Use AdminResetPasswordRequest.ProtoReflect.Descriptor instead.
func (*AdminResetPasswordRequest) Descriptor() ([]byte, []int) { func (*AdminResetPasswordRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{10} return file_account_proto_rawDescGZIP(), []int{14}
} }
func (x *AdminResetPasswordRequest) GetUserId() string { func (x *AdminResetPasswordRequest) GetUserId() string {
@@ -811,7 +1019,7 @@ type AdminResetPasswordResponse struct {
func (x *AdminResetPasswordResponse) Reset() { func (x *AdminResetPasswordResponse) Reset() {
*x = AdminResetPasswordResponse{} *x = AdminResetPasswordResponse{}
mi := &file_account_proto_msgTypes[11] mi := &file_account_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -823,7 +1031,7 @@ func (x *AdminResetPasswordResponse) String() string {
func (*AdminResetPasswordResponse) ProtoMessage() {} func (*AdminResetPasswordResponse) ProtoMessage() {}
func (x *AdminResetPasswordResponse) ProtoReflect() protoreflect.Message { func (x *AdminResetPasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[11] mi := &file_account_proto_msgTypes[15]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -836,7 +1044,7 @@ func (x *AdminResetPasswordResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use AdminResetPasswordResponse.ProtoReflect.Descriptor instead. // Deprecated: Use AdminResetPasswordResponse.ProtoReflect.Descriptor instead.
func (*AdminResetPasswordResponse) Descriptor() ([]byte, []int) { func (*AdminResetPasswordResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{11} return file_account_proto_rawDescGZIP(), []int{15}
} }
func (x *AdminResetPasswordResponse) GetSuccess() bool { func (x *AdminResetPasswordResponse) GetSuccess() bool {
@@ -864,7 +1072,7 @@ type SetPinRequest struct {
func (x *SetPinRequest) Reset() { func (x *SetPinRequest) Reset() {
*x = SetPinRequest{} *x = SetPinRequest{}
mi := &file_account_proto_msgTypes[12] mi := &file_account_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -876,7 +1084,7 @@ func (x *SetPinRequest) String() string {
func (*SetPinRequest) ProtoMessage() {} func (*SetPinRequest) ProtoMessage() {}
func (x *SetPinRequest) ProtoReflect() protoreflect.Message { func (x *SetPinRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[12] mi := &file_account_proto_msgTypes[16]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -889,7 +1097,7 @@ func (x *SetPinRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetPinRequest.ProtoReflect.Descriptor instead. // Deprecated: Use SetPinRequest.ProtoReflect.Descriptor instead.
func (*SetPinRequest) Descriptor() ([]byte, []int) { func (*SetPinRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{12} return file_account_proto_rawDescGZIP(), []int{16}
} }
func (x *SetPinRequest) GetUserId() string { func (x *SetPinRequest) GetUserId() string {
@@ -923,7 +1131,7 @@ type SetPinResponse struct {
func (x *SetPinResponse) Reset() { func (x *SetPinResponse) Reset() {
*x = SetPinResponse{} *x = SetPinResponse{}
mi := &file_account_proto_msgTypes[13] mi := &file_account_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -935,7 +1143,7 @@ func (x *SetPinResponse) String() string {
func (*SetPinResponse) ProtoMessage() {} func (*SetPinResponse) ProtoMessage() {}
func (x *SetPinResponse) ProtoReflect() protoreflect.Message { func (x *SetPinResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[13] mi := &file_account_proto_msgTypes[17]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -948,7 +1156,7 @@ func (x *SetPinResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetPinResponse.ProtoReflect.Descriptor instead. // Deprecated: Use SetPinResponse.ProtoReflect.Descriptor instead.
func (*SetPinResponse) Descriptor() ([]byte, []int) { func (*SetPinResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{13} return file_account_proto_rawDescGZIP(), []int{17}
} }
func (x *SetPinResponse) GetSuccess() bool { func (x *SetPinResponse) GetSuccess() bool {
@@ -976,7 +1184,7 @@ type UnlockPinRequest struct {
func (x *UnlockPinRequest) Reset() { func (x *UnlockPinRequest) Reset() {
*x = UnlockPinRequest{} *x = UnlockPinRequest{}
mi := &file_account_proto_msgTypes[14] mi := &file_account_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -988,7 +1196,7 @@ func (x *UnlockPinRequest) String() string {
func (*UnlockPinRequest) ProtoMessage() {} func (*UnlockPinRequest) ProtoMessage() {}
func (x *UnlockPinRequest) ProtoReflect() protoreflect.Message { func (x *UnlockPinRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[14] mi := &file_account_proto_msgTypes[18]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -1001,7 +1209,7 @@ func (x *UnlockPinRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UnlockPinRequest.ProtoReflect.Descriptor instead. // Deprecated: Use UnlockPinRequest.ProtoReflect.Descriptor instead.
func (*UnlockPinRequest) Descriptor() ([]byte, []int) { func (*UnlockPinRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{14} return file_account_proto_rawDescGZIP(), []int{18}
} }
func (x *UnlockPinRequest) GetUserId() string { func (x *UnlockPinRequest) GetUserId() string {
@@ -1035,7 +1243,7 @@ type UnlockPinResponse struct {
func (x *UnlockPinResponse) Reset() { func (x *UnlockPinResponse) Reset() {
*x = UnlockPinResponse{} *x = UnlockPinResponse{}
mi := &file_account_proto_msgTypes[15] mi := &file_account_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -1047,7 +1255,7 @@ func (x *UnlockPinResponse) String() string {
func (*UnlockPinResponse) ProtoMessage() {} func (*UnlockPinResponse) ProtoMessage() {}
func (x *UnlockPinResponse) ProtoReflect() protoreflect.Message { func (x *UnlockPinResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[15] mi := &file_account_proto_msgTypes[19]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -1060,7 +1268,7 @@ func (x *UnlockPinResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UnlockPinResponse.ProtoReflect.Descriptor instead. // Deprecated: Use UnlockPinResponse.ProtoReflect.Descriptor instead.
func (*UnlockPinResponse) Descriptor() ([]byte, []int) { func (*UnlockPinResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{15} return file_account_proto_rawDescGZIP(), []int{19}
} }
func (x *UnlockPinResponse) GetSuccess() bool { func (x *UnlockPinResponse) GetSuccess() bool {
@@ -1087,7 +1295,7 @@ type GetPinStatusRequest struct {
func (x *GetPinStatusRequest) Reset() { func (x *GetPinStatusRequest) Reset() {
*x = GetPinStatusRequest{} *x = GetPinStatusRequest{}
mi := &file_account_proto_msgTypes[16] mi := &file_account_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -1099,7 +1307,7 @@ func (x *GetPinStatusRequest) String() string {
func (*GetPinStatusRequest) ProtoMessage() {} func (*GetPinStatusRequest) ProtoMessage() {}
func (x *GetPinStatusRequest) ProtoReflect() protoreflect.Message { func (x *GetPinStatusRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[16] mi := &file_account_proto_msgTypes[20]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -1112,7 +1320,7 @@ func (x *GetPinStatusRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetPinStatusRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetPinStatusRequest.ProtoReflect.Descriptor instead.
func (*GetPinStatusRequest) Descriptor() ([]byte, []int) { func (*GetPinStatusRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{16} return file_account_proto_rawDescGZIP(), []int{20}
} }
func (x *GetPinStatusRequest) GetUserId() string { func (x *GetPinStatusRequest) GetUserId() string {
@@ -1140,7 +1348,7 @@ type GetPinStatusResponse struct {
func (x *GetPinStatusResponse) Reset() { func (x *GetPinStatusResponse) Reset() {
*x = GetPinStatusResponse{} *x = GetPinStatusResponse{}
mi := &file_account_proto_msgTypes[17] mi := &file_account_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -1152,7 +1360,7 @@ func (x *GetPinStatusResponse) String() string {
func (*GetPinStatusResponse) ProtoMessage() {} func (*GetPinStatusResponse) ProtoMessage() {}
func (x *GetPinStatusResponse) ProtoReflect() protoreflect.Message { func (x *GetPinStatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[17] mi := &file_account_proto_msgTypes[21]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -1165,7 +1373,7 @@ func (x *GetPinStatusResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetPinStatusResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetPinStatusResponse.ProtoReflect.Descriptor instead.
func (*GetPinStatusResponse) Descriptor() ([]byte, []int) { func (*GetPinStatusResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{17} return file_account_proto_rawDescGZIP(), []int{21}
} }
func (x *GetPinStatusResponse) GetHasPin() bool { func (x *GetPinStatusResponse) GetHasPin() bool {
@@ -1200,7 +1408,7 @@ type RemovePinRequest struct {
func (x *RemovePinRequest) Reset() { func (x *RemovePinRequest) Reset() {
*x = RemovePinRequest{} *x = RemovePinRequest{}
mi := &file_account_proto_msgTypes[18] mi := &file_account_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -1212,7 +1420,7 @@ func (x *RemovePinRequest) String() string {
func (*RemovePinRequest) ProtoMessage() {} func (*RemovePinRequest) ProtoMessage() {}
func (x *RemovePinRequest) ProtoReflect() protoreflect.Message { func (x *RemovePinRequest) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[18] mi := &file_account_proto_msgTypes[22]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -1225,7 +1433,7 @@ func (x *RemovePinRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemovePinRequest.ProtoReflect.Descriptor instead. // Deprecated: Use RemovePinRequest.ProtoReflect.Descriptor instead.
func (*RemovePinRequest) Descriptor() ([]byte, []int) { func (*RemovePinRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{18} return file_account_proto_rawDescGZIP(), []int{22}
} }
func (x *RemovePinRequest) GetPin() string { func (x *RemovePinRequest) GetPin() string {
@@ -1259,7 +1467,7 @@ type RemovePinResponse struct {
func (x *RemovePinResponse) Reset() { func (x *RemovePinResponse) Reset() {
*x = RemovePinResponse{} *x = RemovePinResponse{}
mi := &file_account_proto_msgTypes[19] mi := &file_account_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -1271,7 +1479,7 @@ func (x *RemovePinResponse) String() string {
func (*RemovePinResponse) ProtoMessage() {} func (*RemovePinResponse) ProtoMessage() {}
func (x *RemovePinResponse) ProtoReflect() protoreflect.Message { func (x *RemovePinResponse) ProtoReflect() protoreflect.Message {
mi := &file_account_proto_msgTypes[19] mi := &file_account_proto_msgTypes[23]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -1284,7 +1492,7 @@ func (x *RemovePinResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemovePinResponse.ProtoReflect.Descriptor instead. // Deprecated: Use RemovePinResponse.ProtoReflect.Descriptor instead.
func (*RemovePinResponse) Descriptor() ([]byte, []int) { func (*RemovePinResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{19} return file_account_proto_rawDescGZIP(), []int{23}
} }
func (x *RemovePinResponse) GetSuccess() bool { func (x *RemovePinResponse) GetSuccess() bool {
@@ -1381,6 +1589,18 @@ const file_account_proto_rawDesc = "" +
"\t_language\"H\n" + "\t_language\"H\n" +
"\x12ChangeDataResponse\x12\x18\n" + "\x12ChangeDataResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\"E\n" +
"\x11AssignRoleRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" +
"\arole_id\x18\x02 \x01(\tR\x06roleId\"H\n" +
"\x12AssignRoleResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\"E\n" +
"\x11RevokeRoleRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" +
"\arole_id\x18\x02 \x01(\tR\x06roleId\"H\n" +
"\x12RevokeRoleResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\"W\n" + "\amessage\x18\x02 \x01(\tR\amessage\"W\n" +
"\x19AdminResetPasswordRequest\x12\x17\n" + "\x19AdminResetPasswordRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12!\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12!\n" +
@@ -1420,7 +1640,7 @@ const file_account_proto_rawDesc = "" +
"session_id\x18\x03 \x01(\tR\tsessionId\"G\n" + "session_id\x18\x03 \x01(\tR\tsessionId\"G\n" +
"\x11RemovePinResponse\x12\x18\n" + "\x11RemovePinResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage2\xaa\x06\n" + "\amessage\x18\x02 \x01(\tR\amessage2\xc4\a\n" +
"\x0eAccountService\x12K\n" + "\x0eAccountService\x12K\n" +
"\n" + "\n" +
"GetAccount\x12\x1d.account.v1.GetAccountRequest\x1a\x1e.account.v1.GetAccountResponse\x12W\n" + "GetAccount\x12\x1d.account.v1.GetAccountRequest\x1a\x1e.account.v1.GetAccountResponse\x12W\n" +
@@ -1431,7 +1651,11 @@ const file_account_proto_rawDesc = "" +
"\n" + "\n" +
"DeleteUser\x12\x1d.account.v1.DeleteUserRequest\x1a\x1e.account.v1.DeleteUserResponse\x12K\n" + "DeleteUser\x12\x1d.account.v1.DeleteUserRequest\x1a\x1e.account.v1.DeleteUserResponse\x12K\n" +
"\n" + "\n" +
"ChangeData\x12\x1d.account.v1.ChangeDataRequest\x1a\x1e.account.v1.ChangeDataResponse\x12?\n" + "ChangeData\x12\x1d.account.v1.ChangeDataRequest\x1a\x1e.account.v1.ChangeDataResponse\x12K\n" +
"\n" +
"AssignRole\x12\x1d.account.v1.AssignRoleRequest\x1a\x1e.account.v1.AssignRoleResponse\x12K\n" +
"\n" +
"RevokeRole\x12\x1d.account.v1.RevokeRoleRequest\x1a\x1e.account.v1.RevokeRoleResponse\x12?\n" +
"\x06SetPin\x12\x19.account.v1.SetPinRequest\x1a\x1a.account.v1.SetPinResponse\x12H\n" + "\x06SetPin\x12\x19.account.v1.SetPinRequest\x1a\x1a.account.v1.SetPinResponse\x12H\n" +
"\tUnlockPin\x12\x1c.account.v1.UnlockPinRequest\x1a\x1d.account.v1.UnlockPinResponse\x12Q\n" + "\tUnlockPin\x12\x1c.account.v1.UnlockPinRequest\x1a\x1d.account.v1.UnlockPinResponse\x12Q\n" +
"\fGetPinStatus\x12\x1f.account.v1.GetPinStatusRequest\x1a .account.v1.GetPinStatusResponse\x12H\n" + "\fGetPinStatus\x12\x1f.account.v1.GetPinStatusRequest\x1a .account.v1.GetPinStatusResponse\x12H\n" +
@@ -1449,7 +1673,7 @@ func file_account_proto_rawDescGZIP() []byte {
return file_account_proto_rawDescData return file_account_proto_rawDescData
} }
var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
var file_account_proto_goTypes = []any{ var file_account_proto_goTypes = []any{
(*GetAccountRequest)(nil), // 0: account.v1.GetAccountRequest (*GetAccountRequest)(nil), // 0: account.v1.GetAccountRequest
(*GetAccountResponse)(nil), // 1: account.v1.GetAccountResponse (*GetAccountResponse)(nil), // 1: account.v1.GetAccountResponse
@@ -1461,40 +1685,48 @@ var file_account_proto_goTypes = []any{
(*DeleteUserResponse)(nil), // 7: account.v1.DeleteUserResponse (*DeleteUserResponse)(nil), // 7: account.v1.DeleteUserResponse
(*ChangeDataRequest)(nil), // 8: account.v1.ChangeDataRequest (*ChangeDataRequest)(nil), // 8: account.v1.ChangeDataRequest
(*ChangeDataResponse)(nil), // 9: account.v1.ChangeDataResponse (*ChangeDataResponse)(nil), // 9: account.v1.ChangeDataResponse
(*AdminResetPasswordRequest)(nil), // 10: account.v1.AdminResetPasswordRequest (*AssignRoleRequest)(nil), // 10: account.v1.AssignRoleRequest
(*AdminResetPasswordResponse)(nil), // 11: account.v1.AdminResetPasswordResponse (*AssignRoleResponse)(nil), // 11: account.v1.AssignRoleResponse
(*SetPinRequest)(nil), // 12: account.v1.SetPinRequest (*RevokeRoleRequest)(nil), // 12: account.v1.RevokeRoleRequest
(*SetPinResponse)(nil), // 13: account.v1.SetPinResponse (*RevokeRoleResponse)(nil), // 13: account.v1.RevokeRoleResponse
(*UnlockPinRequest)(nil), // 14: account.v1.UnlockPinRequest (*AdminResetPasswordRequest)(nil), // 14: account.v1.AdminResetPasswordRequest
(*UnlockPinResponse)(nil), // 15: account.v1.UnlockPinResponse (*AdminResetPasswordResponse)(nil), // 15: account.v1.AdminResetPasswordResponse
(*GetPinStatusRequest)(nil), // 16: account.v1.GetPinStatusRequest (*SetPinRequest)(nil), // 16: account.v1.SetPinRequest
(*GetPinStatusResponse)(nil), // 17: account.v1.GetPinStatusResponse (*SetPinResponse)(nil), // 17: account.v1.SetPinResponse
(*RemovePinRequest)(nil), // 18: account.v1.RemovePinRequest (*UnlockPinRequest)(nil), // 18: account.v1.UnlockPinRequest
(*RemovePinResponse)(nil), // 19: account.v1.RemovePinResponse (*UnlockPinResponse)(nil), // 19: account.v1.UnlockPinResponse
(*GetPinStatusRequest)(nil), // 20: account.v1.GetPinStatusRequest
(*GetPinStatusResponse)(nil), // 21: account.v1.GetPinStatusResponse
(*RemovePinRequest)(nil), // 22: account.v1.RemovePinRequest
(*RemovePinResponse)(nil), // 23: account.v1.RemovePinResponse
} }
var file_account_proto_depIdxs = []int32{ var file_account_proto_depIdxs = []int32{
0, // 0: account.v1.AccountService.GetAccount:input_type -> account.v1.GetAccountRequest 0, // 0: account.v1.AccountService.GetAccount:input_type -> account.v1.GetAccountRequest
2, // 1: account.v1.AccountService.ChangePassword:input_type -> account.v1.ChangePasswordRequest 2, // 1: account.v1.AccountService.ChangePassword:input_type -> account.v1.ChangePasswordRequest
10, // 2: account.v1.AccountService.AdminResetPassword:input_type -> account.v1.AdminResetPasswordRequest 14, // 2: account.v1.AccountService.AdminResetPassword:input_type -> account.v1.AdminResetPasswordRequest
4, // 3: account.v1.AccountService.CreateUser:input_type -> account.v1.CreateUserRequest 4, // 3: account.v1.AccountService.CreateUser:input_type -> account.v1.CreateUserRequest
6, // 4: account.v1.AccountService.DeleteUser:input_type -> account.v1.DeleteUserRequest 6, // 4: account.v1.AccountService.DeleteUser:input_type -> account.v1.DeleteUserRequest
8, // 5: account.v1.AccountService.ChangeData:input_type -> account.v1.ChangeDataRequest 8, // 5: account.v1.AccountService.ChangeData:input_type -> account.v1.ChangeDataRequest
12, // 6: account.v1.AccountService.SetPin:input_type -> account.v1.SetPinRequest 10, // 6: account.v1.AccountService.AssignRole:input_type -> account.v1.AssignRoleRequest
14, // 7: account.v1.AccountService.UnlockPin:input_type -> account.v1.UnlockPinRequest 12, // 7: account.v1.AccountService.RevokeRole:input_type -> account.v1.RevokeRoleRequest
16, // 8: account.v1.AccountService.GetPinStatus:input_type -> account.v1.GetPinStatusRequest 16, // 8: account.v1.AccountService.SetPin:input_type -> account.v1.SetPinRequest
18, // 9: account.v1.AccountService.RemovePin:input_type -> account.v1.RemovePinRequest 18, // 9: account.v1.AccountService.UnlockPin:input_type -> account.v1.UnlockPinRequest
1, // 10: account.v1.AccountService.GetAccount:output_type -> account.v1.GetAccountResponse 20, // 10: account.v1.AccountService.GetPinStatus:input_type -> account.v1.GetPinStatusRequest
3, // 11: account.v1.AccountService.ChangePassword:output_type -> account.v1.ChangePasswordResponse 22, // 11: account.v1.AccountService.RemovePin:input_type -> account.v1.RemovePinRequest
11, // 12: account.v1.AccountService.AdminResetPassword:output_type -> account.v1.AdminResetPasswordResponse 1, // 12: account.v1.AccountService.GetAccount:output_type -> account.v1.GetAccountResponse
5, // 13: account.v1.AccountService.CreateUser:output_type -> account.v1.CreateUserResponse 3, // 13: account.v1.AccountService.ChangePassword:output_type -> account.v1.ChangePasswordResponse
7, // 14: account.v1.AccountService.DeleteUser:output_type -> account.v1.DeleteUserResponse 15, // 14: account.v1.AccountService.AdminResetPassword:output_type -> account.v1.AdminResetPasswordResponse
9, // 15: account.v1.AccountService.ChangeData:output_type -> account.v1.ChangeDataResponse 5, // 15: account.v1.AccountService.CreateUser:output_type -> account.v1.CreateUserResponse
13, // 16: account.v1.AccountService.SetPin:output_type -> account.v1.SetPinResponse 7, // 16: account.v1.AccountService.DeleteUser:output_type -> account.v1.DeleteUserResponse
15, // 17: account.v1.AccountService.UnlockPin:output_type -> account.v1.UnlockPinResponse 9, // 17: account.v1.AccountService.ChangeData:output_type -> account.v1.ChangeDataResponse
17, // 18: account.v1.AccountService.GetPinStatus:output_type -> account.v1.GetPinStatusResponse 11, // 18: account.v1.AccountService.AssignRole:output_type -> account.v1.AssignRoleResponse
19, // 19: account.v1.AccountService.RemovePin:output_type -> account.v1.RemovePinResponse 13, // 19: account.v1.AccountService.RevokeRole:output_type -> account.v1.RevokeRoleResponse
10, // [10:20] is the sub-list for method output_type 17, // 20: account.v1.AccountService.SetPin:output_type -> account.v1.SetPinResponse
0, // [0:10] is the sub-list for method input_type 19, // 21: account.v1.AccountService.UnlockPin:output_type -> account.v1.UnlockPinResponse
21, // 22: account.v1.AccountService.GetPinStatus:output_type -> account.v1.GetPinStatusResponse
23, // 23: account.v1.AccountService.RemovePin:output_type -> account.v1.RemovePinResponse
12, // [12:24] is the sub-list for method output_type
0, // [0:12] 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 type_name
0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name 0, // [0:0] is the sub-list for field type_name
@@ -1514,7 +1746,7 @@ func file_account_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_account_proto_rawDesc), len(file_account_proto_rawDesc)), RawDescriptor: unsafe.Slice(unsafe.StringData(file_account_proto_rawDesc), len(file_account_proto_rawDesc)),
NumEnums: 0, NumEnums: 0,
NumMessages: 20, NumMessages: 24,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@@ -25,6 +25,8 @@ const (
AccountService_CreateUser_FullMethodName = "/account.v1.AccountService/CreateUser" AccountService_CreateUser_FullMethodName = "/account.v1.AccountService/CreateUser"
AccountService_DeleteUser_FullMethodName = "/account.v1.AccountService/DeleteUser" AccountService_DeleteUser_FullMethodName = "/account.v1.AccountService/DeleteUser"
AccountService_ChangeData_FullMethodName = "/account.v1.AccountService/ChangeData" AccountService_ChangeData_FullMethodName = "/account.v1.AccountService/ChangeData"
AccountService_AssignRole_FullMethodName = "/account.v1.AccountService/AssignRole"
AccountService_RevokeRole_FullMethodName = "/account.v1.AccountService/RevokeRole"
AccountService_SetPin_FullMethodName = "/account.v1.AccountService/SetPin" AccountService_SetPin_FullMethodName = "/account.v1.AccountService/SetPin"
AccountService_UnlockPin_FullMethodName = "/account.v1.AccountService/UnlockPin" AccountService_UnlockPin_FullMethodName = "/account.v1.AccountService/UnlockPin"
AccountService_GetPinStatus_FullMethodName = "/account.v1.AccountService/GetPinStatus" AccountService_GetPinStatus_FullMethodName = "/account.v1.AccountService/GetPinStatus"
@@ -41,6 +43,8 @@ type AccountServiceClient interface {
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error) ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error)
AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error)
RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error)
SetPin(ctx context.Context, in *SetPinRequest, opts ...grpc.CallOption) (*SetPinResponse, error) SetPin(ctx context.Context, in *SetPinRequest, opts ...grpc.CallOption) (*SetPinResponse, error)
UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error) UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error)
GetPinStatus(ctx context.Context, in *GetPinStatusRequest, opts ...grpc.CallOption) (*GetPinStatusResponse, error) GetPinStatus(ctx context.Context, in *GetPinStatusRequest, opts ...grpc.CallOption) (*GetPinStatusResponse, error)
@@ -115,6 +119,26 @@ func (c *accountServiceClient) ChangeData(ctx context.Context, in *ChangeDataReq
return out, nil return out, nil
} }
func (c *accountServiceClient) AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AssignRoleResponse)
err := c.cc.Invoke(ctx, AccountService_AssignRole_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RevokeRoleResponse)
err := c.cc.Invoke(ctx, AccountService_RevokeRole_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountServiceClient) SetPin(ctx context.Context, in *SetPinRequest, opts ...grpc.CallOption) (*SetPinResponse, error) { func (c *accountServiceClient) SetPin(ctx context.Context, in *SetPinRequest, opts ...grpc.CallOption) (*SetPinResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SetPinResponse) out := new(SetPinResponse)
@@ -165,6 +189,8 @@ type AccountServiceServer interface {
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error)
AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error)
RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error)
SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error) SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error)
UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error) UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error)
GetPinStatus(context.Context, *GetPinStatusRequest) (*GetPinStatusResponse, error) GetPinStatus(context.Context, *GetPinStatusRequest) (*GetPinStatusResponse, error)
@@ -197,6 +223,12 @@ func (UnimplementedAccountServiceServer) DeleteUser(context.Context, *DeleteUser
func (UnimplementedAccountServiceServer) ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) { func (UnimplementedAccountServiceServer) ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ChangeData not implemented") return nil, status.Error(codes.Unimplemented, "method ChangeData not implemented")
} }
func (UnimplementedAccountServiceServer) AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method AssignRole not implemented")
}
func (UnimplementedAccountServiceServer) RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RevokeRole not implemented")
}
func (UnimplementedAccountServiceServer) SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error) { func (UnimplementedAccountServiceServer) SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error) {
return nil, status.Error(codes.Unimplemented, "method SetPin not implemented") return nil, status.Error(codes.Unimplemented, "method SetPin not implemented")
} }
@@ -338,6 +370,42 @@ func _AccountService_ChangeData_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _AccountService_AssignRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AssignRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).AssignRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountService_AssignRole_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).AssignRole(ctx, req.(*AssignRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_RevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RevokeRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountServiceServer).RevokeRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountService_RevokeRole_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountServiceServer).RevokeRole(ctx, req.(*RevokeRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountService_SetPin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _AccountService_SetPin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetPinRequest) in := new(SetPinRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -441,6 +509,14 @@ var AccountService_ServiceDesc = grpc.ServiceDesc{
MethodName: "ChangeData", MethodName: "ChangeData",
Handler: _AccountService_ChangeData_Handler, Handler: _AccountService_ChangeData_Handler,
}, },
{
MethodName: "AssignRole",
Handler: _AccountService_AssignRole_Handler,
},
{
MethodName: "RevokeRole",
Handler: _AccountService_RevokeRole_Handler,
},
{ {
MethodName: "SetPin", MethodName: "SetPin",
Handler: _AccountService_SetPin_Handler, Handler: _AccountService_SetPin_Handler,

View File

@@ -289,6 +289,454 @@ func (x *GetAllRolesResponse) GetRoles() []*Roles {
return nil return nil
} }
type CreateRoleRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
PermissionCodes []string `protobuf:"bytes,3,rep,name=permission_codes,json=permissionCodes,proto3" json:"permission_codes,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateRoleRequest) Reset() {
*x = CreateRoleRequest{}
mi := &file_rbac_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateRoleRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateRoleRequest) ProtoMessage() {}
func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 CreateRoleRequest.ProtoReflect.Descriptor instead.
func (*CreateRoleRequest) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{5}
}
func (x *CreateRoleRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CreateRoleRequest) GetLevel() int32 {
if x != nil {
return x.Level
}
return 0
}
func (x *CreateRoleRequest) GetPermissionCodes() []string {
if x != nil {
return x.PermissionCodes
}
return nil
}
type UpdateRoleRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
Level *int32 `protobuf:"varint,3,opt,name=level,proto3,oneof" json:"level,omitempty"`
PermissionCodes []string `protobuf:"bytes,4,rep,name=permission_codes,json=permissionCodes,proto3" json:"permission_codes,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateRoleRequest) Reset() {
*x = UpdateRoleRequest{}
mi := &file_rbac_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateRoleRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateRoleRequest) ProtoMessage() {}
func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 UpdateRoleRequest.ProtoReflect.Descriptor instead.
func (*UpdateRoleRequest) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{6}
}
func (x *UpdateRoleRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *UpdateRoleRequest) GetName() string {
if x != nil && x.Name != nil {
return *x.Name
}
return ""
}
func (x *UpdateRoleRequest) GetLevel() int32 {
if x != nil && x.Level != nil {
return *x.Level
}
return 0
}
func (x *UpdateRoleRequest) GetPermissionCodes() []string {
if x != nil {
return x.PermissionCodes
}
return nil
}
type ModifyRoleResponse 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 *ModifyRoleResponse) Reset() {
*x = ModifyRoleResponse{}
mi := &file_rbac_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ModifyRoleResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ModifyRoleResponse) ProtoMessage() {}
func (x *ModifyRoleResponse) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 ModifyRoleResponse.ProtoReflect.Descriptor instead.
func (*ModifyRoleResponse) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{7}
}
func (x *ModifyRoleResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *ModifyRoleResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type DeleteRoleRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteRoleRequest) Reset() {
*x = DeleteRoleRequest{}
mi := &file_rbac_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteRoleRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRoleRequest) ProtoMessage() {}
func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 DeleteRoleRequest.ProtoReflect.Descriptor instead.
func (*DeleteRoleRequest) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{8}
}
func (x *DeleteRoleRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type DeleteRoleResponse 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"`
FallbackRoleName *string `protobuf:"bytes,3,opt,name=fallback_role_name,json=fallbackRoleName,proto3,oneof" json:"fallback_role_name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteRoleResponse) Reset() {
*x = DeleteRoleResponse{}
mi := &file_rbac_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteRoleResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteRoleResponse) ProtoMessage() {}
func (x *DeleteRoleResponse) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 DeleteRoleResponse.ProtoReflect.Descriptor instead.
func (*DeleteRoleResponse) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{9}
}
func (x *DeleteRoleResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *DeleteRoleResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *DeleteRoleResponse) GetFallbackRoleName() string {
if x != nil && x.FallbackRoleName != nil {
return *x.FallbackRoleName
}
return ""
}
type CreatePermissionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Module string `protobuf:"bytes,3,opt,name=module,proto3" json:"module,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreatePermissionRequest) Reset() {
*x = CreatePermissionRequest{}
mi := &file_rbac_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreatePermissionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreatePermissionRequest) ProtoMessage() {}
func (x *CreatePermissionRequest) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 CreatePermissionRequest.ProtoReflect.Descriptor instead.
func (*CreatePermissionRequest) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{10}
}
func (x *CreatePermissionRequest) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *CreatePermissionRequest) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *CreatePermissionRequest) GetModule() string {
if x != nil {
return x.Module
}
return ""
}
type UpdatePermissionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
RoleIds []string `protobuf:"bytes,2,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` // Привязка к конкретным ролям
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdatePermissionRequest) Reset() {
*x = UpdatePermissionRequest{}
mi := &file_rbac_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdatePermissionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdatePermissionRequest) ProtoMessage() {}
func (x *UpdatePermissionRequest) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 UpdatePermissionRequest.ProtoReflect.Descriptor instead.
func (*UpdatePermissionRequest) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{11}
}
func (x *UpdatePermissionRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *UpdatePermissionRequest) GetRoleIds() []string {
if x != nil {
return x.RoleIds
}
return nil
}
type ModifyPermissionResponse 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 *ModifyPermissionResponse) Reset() {
*x = ModifyPermissionResponse{}
mi := &file_rbac_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ModifyPermissionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ModifyPermissionResponse) ProtoMessage() {}
func (x *ModifyPermissionResponse) ProtoReflect() protoreflect.Message {
mi := &file_rbac_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 ModifyPermissionResponse.ProtoReflect.Descriptor instead.
func (*ModifyPermissionResponse) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{12}
}
func (x *ModifyPermissionResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *ModifyPermissionResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type Roles struct { type Roles struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
@@ -303,7 +751,7 @@ type Roles struct {
func (x *Roles) Reset() { func (x *Roles) Reset() {
*x = Roles{} *x = Roles{}
mi := &file_rbac_proto_msgTypes[5] mi := &file_rbac_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -315,7 +763,7 @@ func (x *Roles) String() string {
func (*Roles) ProtoMessage() {} func (*Roles) ProtoMessage() {}
func (x *Roles) ProtoReflect() protoreflect.Message { func (x *Roles) ProtoReflect() protoreflect.Message {
mi := &file_rbac_proto_msgTypes[5] mi := &file_rbac_proto_msgTypes[13]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -328,7 +776,7 @@ func (x *Roles) ProtoReflect() protoreflect.Message {
// Deprecated: Use Roles.ProtoReflect.Descriptor instead. // Deprecated: Use Roles.ProtoReflect.Descriptor instead.
func (*Roles) Descriptor() ([]byte, []int) { func (*Roles) Descriptor() ([]byte, []int) {
return file_rbac_proto_rawDescGZIP(), []int{5} return file_rbac_proto_rawDescGZIP(), []int{13}
} }
func (x *Roles) GetId() string { func (x *Roles) GetId() string {
@@ -397,15 +845,54 @@ const file_rbac_proto_rawDesc = "" +
"\n" + "\n" +
"session_id\x18\x02 \x01(\tR\tsessionId\";\n" + "session_id\x18\x02 \x01(\tR\tsessionId\";\n" +
"\x13GetAllRolesResponse\x12$\n" + "\x13GetAllRolesResponse\x12$\n" +
"\x05roles\x18\x01 \x03(\v2\x0e.rbac.v1.RolesR\x05roles\"\xa2\x01\n" + "\x05roles\x18\x01 \x03(\v2\x0e.rbac.v1.RolesR\x05roles\"h\n" +
"\x11CreateRoleRequest\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
"\x05level\x18\x02 \x01(\x05R\x05level\x12)\n" +
"\x10permission_codes\x18\x03 \x03(\tR\x0fpermissionCodes\"\x95\x01\n" +
"\x11UpdateRoleRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n" +
"\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12\x19\n" +
"\x05level\x18\x03 \x01(\x05H\x01R\x05level\x88\x01\x01\x12)\n" +
"\x10permission_codes\x18\x04 \x03(\tR\x0fpermissionCodesB\a\n" +
"\x05_nameB\b\n" +
"\x06_level\"H\n" +
"\x12ModifyRoleResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\"#\n" +
"\x11DeleteRoleRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"\x92\x01\n" +
"\x12DeleteRoleResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x121\n" +
"\x12fallback_role_name\x18\x03 \x01(\tH\x00R\x10fallbackRoleName\x88\x01\x01B\x15\n" +
"\x13_fallback_role_name\"g\n" +
"\x17CreatePermissionRequest\x12\x12\n" +
"\x04code\x18\x01 \x01(\tR\x04code\x12 \n" +
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" +
"\x06module\x18\x03 \x01(\tR\x06module\"D\n" +
"\x17UpdatePermissionRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" +
"\brole_ids\x18\x02 \x03(\tR\aroleIds\"N\n" +
"\x18ModifyPermissionResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\"\xa2\x01\n" +
"\x05Roles\x12\x0e\n" + "\x05Roles\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" +
"\x05level\x18\x03 \x01(\x05R\x05level\x12 \n" + "\x05level\x18\x03 \x01(\x05R\x05level\x12 \n" +
"\vpermissions\x18\x04 \x03(\tR\vpermissions\x12!\n" + "\vpermissions\x18\x04 \x03(\tR\vpermissions\x12!\n" +
"\fldap_mapping\x18\x05 \x03(\tR\vldapMapping\x12\x1a\n" + "\fldap_mapping\x18\x05 \x03(\tR\vldapMapping\x12\x1a\n" +
"\baccounts\x18\x06 \x03(\tR\baccounts2\xb3\x01\n" + "\baccounts\x18\x06 \x03(\tR\baccounts2\xba\x04\n" +
"\vRbacService\x12Z\n" + "\vRbacService\x12E\n" +
"\n" +
"CreateRole\x12\x1a.rbac.v1.CreateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" +
"\n" +
"UpdateRole\x12\x1a.rbac.v1.UpdateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" +
"\n" +
"DeleteRole\x12\x1a.rbac.v1.DeleteRoleRequest\x1a\x1b.rbac.v1.DeleteRoleResponse\x12W\n" +
"\x10CreatePermission\x12 .rbac.v1.CreatePermissionRequest\x1a!.rbac.v1.ModifyPermissionResponse\x12W\n" +
"\x10UpdatePermission\x12 .rbac.v1.UpdatePermissionRequest\x1a!.rbac.v1.ModifyPermissionResponse\x12Z\n" +
"\x11GetAllPermissions\x12!.rbac.v1.GetAllPermissionsRequest\x1a\".rbac.v1.GetAllPermissionsResponse\x12H\n" + "\x11GetAllPermissions\x12!.rbac.v1.GetAllPermissionsRequest\x1a\".rbac.v1.GetAllPermissionsResponse\x12H\n" +
"\vGetAllRoles\x12\x1b.rbac.v1.GetAllRolesRequest\x1a\x1c.rbac.v1.GetAllRolesResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" "\vGetAllRoles\x12\x1b.rbac.v1.GetAllRolesRequest\x1a\x1c.rbac.v1.GetAllRolesResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
@@ -421,24 +908,42 @@ func file_rbac_proto_rawDescGZIP() []byte {
return file_rbac_proto_rawDescData return file_rbac_proto_rawDescData
} }
var file_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_rbac_proto_goTypes = []any{ var file_rbac_proto_goTypes = []any{
(*GetAllPermissionsRequest)(nil), // 0: rbac.v1.GetAllPermissionsRequest (*GetAllPermissionsRequest)(nil), // 0: rbac.v1.GetAllPermissionsRequest
(*GetAllPermissionsResponse)(nil), // 1: rbac.v1.GetAllPermissionsResponse (*GetAllPermissionsResponse)(nil), // 1: rbac.v1.GetAllPermissionsResponse
(*Permission)(nil), // 2: rbac.v1.Permission (*Permission)(nil), // 2: rbac.v1.Permission
(*GetAllRolesRequest)(nil), // 3: rbac.v1.GetAllRolesRequest (*GetAllRolesRequest)(nil), // 3: rbac.v1.GetAllRolesRequest
(*GetAllRolesResponse)(nil), // 4: rbac.v1.GetAllRolesResponse (*GetAllRolesResponse)(nil), // 4: rbac.v1.GetAllRolesResponse
(*Roles)(nil), // 5: rbac.v1.Roles (*CreateRoleRequest)(nil), // 5: rbac.v1.CreateRoleRequest
(*UpdateRoleRequest)(nil), // 6: rbac.v1.UpdateRoleRequest
(*ModifyRoleResponse)(nil), // 7: rbac.v1.ModifyRoleResponse
(*DeleteRoleRequest)(nil), // 8: rbac.v1.DeleteRoleRequest
(*DeleteRoleResponse)(nil), // 9: rbac.v1.DeleteRoleResponse
(*CreatePermissionRequest)(nil), // 10: rbac.v1.CreatePermissionRequest
(*UpdatePermissionRequest)(nil), // 11: rbac.v1.UpdatePermissionRequest
(*ModifyPermissionResponse)(nil), // 12: rbac.v1.ModifyPermissionResponse
(*Roles)(nil), // 13: rbac.v1.Roles
} }
var file_rbac_proto_depIdxs = []int32{ var file_rbac_proto_depIdxs = []int32{
2, // 0: rbac.v1.GetAllPermissionsResponse.permissions:type_name -> rbac.v1.Permission 2, // 0: rbac.v1.GetAllPermissionsResponse.permissions:type_name -> rbac.v1.Permission
5, // 1: rbac.v1.GetAllRolesResponse.roles:type_name -> rbac.v1.Roles 13, // 1: rbac.v1.GetAllRolesResponse.roles:type_name -> rbac.v1.Roles
0, // 2: rbac.v1.RbacService.GetAllPermissions:input_type -> rbac.v1.GetAllPermissionsRequest 5, // 2: rbac.v1.RbacService.CreateRole:input_type -> rbac.v1.CreateRoleRequest
3, // 3: rbac.v1.RbacService.GetAllRoles:input_type -> rbac.v1.GetAllRolesRequest 6, // 3: rbac.v1.RbacService.UpdateRole:input_type -> rbac.v1.UpdateRoleRequest
1, // 4: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse 8, // 4: rbac.v1.RbacService.DeleteRole:input_type -> rbac.v1.DeleteRoleRequest
4, // 5: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse 10, // 5: rbac.v1.RbacService.CreatePermission:input_type -> rbac.v1.CreatePermissionRequest
4, // [4:6] is the sub-list for method output_type 11, // 6: rbac.v1.RbacService.UpdatePermission:input_type -> rbac.v1.UpdatePermissionRequest
2, // [2:4] is the sub-list for method input_type 0, // 7: rbac.v1.RbacService.GetAllPermissions:input_type -> rbac.v1.GetAllPermissionsRequest
3, // 8: rbac.v1.RbacService.GetAllRoles:input_type -> rbac.v1.GetAllRolesRequest
7, // 9: rbac.v1.RbacService.CreateRole:output_type -> rbac.v1.ModifyRoleResponse
7, // 10: rbac.v1.RbacService.UpdateRole:output_type -> rbac.v1.ModifyRoleResponse
9, // 11: rbac.v1.RbacService.DeleteRole:output_type -> rbac.v1.DeleteRoleResponse
12, // 12: rbac.v1.RbacService.CreatePermission:output_type -> rbac.v1.ModifyPermissionResponse
12, // 13: rbac.v1.RbacService.UpdatePermission:output_type -> rbac.v1.ModifyPermissionResponse
1, // 14: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse
4, // 15: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse
9, // [9:16] is the sub-list for method output_type
2, // [2:9] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee 2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name 0, // [0:2] is the sub-list for field type_name
@@ -449,13 +954,15 @@ func file_rbac_proto_init() {
if File_rbac_proto != nil { if File_rbac_proto != nil {
return return
} }
file_rbac_proto_msgTypes[6].OneofWrappers = []any{}
file_rbac_proto_msgTypes[9].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_rbac_proto_rawDesc), len(file_rbac_proto_rawDesc)), RawDescriptor: unsafe.Slice(unsafe.StringData(file_rbac_proto_rawDesc), len(file_rbac_proto_rawDesc)),
NumEnums: 0, NumEnums: 0,
NumMessages: 6, NumMessages: 14,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@@ -19,6 +19,11 @@ import (
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion9
const ( const (
RbacService_CreateRole_FullMethodName = "/rbac.v1.RbacService/CreateRole"
RbacService_UpdateRole_FullMethodName = "/rbac.v1.RbacService/UpdateRole"
RbacService_DeleteRole_FullMethodName = "/rbac.v1.RbacService/DeleteRole"
RbacService_CreatePermission_FullMethodName = "/rbac.v1.RbacService/CreatePermission"
RbacService_UpdatePermission_FullMethodName = "/rbac.v1.RbacService/UpdatePermission"
RbacService_GetAllPermissions_FullMethodName = "/rbac.v1.RbacService/GetAllPermissions" RbacService_GetAllPermissions_FullMethodName = "/rbac.v1.RbacService/GetAllPermissions"
RbacService_GetAllRoles_FullMethodName = "/rbac.v1.RbacService/GetAllRoles" RbacService_GetAllRoles_FullMethodName = "/rbac.v1.RbacService/GetAllRoles"
) )
@@ -27,6 +32,11 @@ const (
// //
// 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. // 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 RbacServiceClient interface { type RbacServiceClient interface {
CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error)
CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error)
UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error)
GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error)
GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error)
} }
@@ -39,6 +49,56 @@ func NewRbacServiceClient(cc grpc.ClientConnInterface) RbacServiceClient {
return &rbacServiceClient{cc} return &rbacServiceClient{cc}
} }
func (c *rbacServiceClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ModifyRoleResponse)
err := c.cc.Invoke(ctx, RbacService_CreateRole_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rbacServiceClient) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ModifyRoleResponse)
err := c.cc.Invoke(ctx, RbacService_UpdateRole_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rbacServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteRoleResponse)
err := c.cc.Invoke(ctx, RbacService_DeleteRole_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rbacServiceClient) CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ModifyPermissionResponse)
err := c.cc.Invoke(ctx, RbacService_CreatePermission_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rbacServiceClient) UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ModifyPermissionResponse)
err := c.cc.Invoke(ctx, RbacService_UpdatePermission_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rbacServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) { func (c *rbacServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetAllPermissionsResponse) out := new(GetAllPermissionsResponse)
@@ -63,6 +123,11 @@ func (c *rbacServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesRequ
// All implementations must embed UnimplementedRbacServiceServer // All implementations must embed UnimplementedRbacServiceServer
// for forward compatibility. // for forward compatibility.
type RbacServiceServer interface { type RbacServiceServer interface {
CreateRole(context.Context, *CreateRoleRequest) (*ModifyRoleResponse, error)
UpdateRole(context.Context, *UpdateRoleRequest) (*ModifyRoleResponse, error)
DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error)
CreatePermission(context.Context, *CreatePermissionRequest) (*ModifyPermissionResponse, error)
UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error)
GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error)
GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error)
mustEmbedUnimplementedRbacServiceServer() mustEmbedUnimplementedRbacServiceServer()
@@ -75,6 +140,21 @@ type RbacServiceServer interface {
// pointer dereference when methods are called. // pointer dereference when methods are called.
type UnimplementedRbacServiceServer struct{} type UnimplementedRbacServiceServer struct{}
func (UnimplementedRbacServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*ModifyRoleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented")
}
func (UnimplementedRbacServiceServer) UpdateRole(context.Context, *UpdateRoleRequest) (*ModifyRoleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented")
}
func (UnimplementedRbacServiceServer) DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented")
}
func (UnimplementedRbacServiceServer) CreatePermission(context.Context, *CreatePermissionRequest) (*ModifyPermissionResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CreatePermission not implemented")
}
func (UnimplementedRbacServiceServer) UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UpdatePermission not implemented")
}
func (UnimplementedRbacServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) { func (UnimplementedRbacServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented") return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented")
} }
@@ -102,6 +182,96 @@ func RegisterRbacServiceServer(s grpc.ServiceRegistrar, srv RbacServiceServer) {
s.RegisterService(&RbacService_ServiceDesc, srv) s.RegisterService(&RbacService_ServiceDesc, srv)
} }
func _RbacService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RbacServiceServer).CreateRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RbacService_CreateRole_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RbacServiceServer).CreateRole(ctx, req.(*CreateRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RbacService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RbacServiceServer).UpdateRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RbacService_UpdateRole_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RbacServiceServer).UpdateRole(ctx, req.(*UpdateRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RbacService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteRoleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RbacServiceServer).DeleteRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RbacService_DeleteRole_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RbacServiceServer).DeleteRole(ctx, req.(*DeleteRoleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RbacService_CreatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePermissionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RbacServiceServer).CreatePermission(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RbacService_CreatePermission_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RbacServiceServer).CreatePermission(ctx, req.(*CreatePermissionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RbacService_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePermissionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RbacServiceServer).UpdatePermission(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RbacService_UpdatePermission_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RbacServiceServer).UpdatePermission(ctx, req.(*UpdatePermissionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RbacService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _RbacService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetAllPermissionsRequest) in := new(GetAllPermissionsRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -145,6 +315,26 @@ var RbacService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rbac.v1.RbacService", ServiceName: "rbac.v1.RbacService",
HandlerType: (*RbacServiceServer)(nil), HandlerType: (*RbacServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{
MethodName: "CreateRole",
Handler: _RbacService_CreateRole_Handler,
},
{
MethodName: "UpdateRole",
Handler: _RbacService_UpdateRole_Handler,
},
{
MethodName: "DeleteRole",
Handler: _RbacService_DeleteRole_Handler,
},
{
MethodName: "CreatePermission",
Handler: _RbacService_CreatePermission_Handler,
},
{
MethodName: "UpdatePermission",
Handler: _RbacService_UpdatePermission_Handler,
},
{ {
MethodName: "GetAllPermissions", MethodName: "GetAllPermissions",
Handler: _RbacService_GetAllPermissions_Handler, Handler: _RbacService_GetAllPermissions_Handler,

View File

@@ -37,6 +37,51 @@ export interface GetAllRolesResponse {
roles: Roles[]; roles: Roles[];
} }
export interface CreateRoleRequest {
name: string;
level: number;
permissionCodes: string[];
}
export interface UpdateRoleRequest {
id: string;
name?: string | undefined;
level?: number | undefined;
permissionCodes: string[];
}
export interface ModifyRoleResponse {
success: boolean;
message: string;
}
export interface DeleteRoleRequest {
id: string;
}
export interface DeleteRoleResponse {
success: boolean;
message: string;
fallbackRoleName?: string | undefined;
}
export interface CreatePermissionRequest {
code: string;
description: string;
module: string;
}
export interface UpdatePermissionRequest {
id: string;
/** Привязка к конкретным ролям */
roleIds: string[];
}
export interface ModifyPermissionResponse {
success: boolean;
message: string;
}
export interface Roles { export interface Roles {
id: string; id: string;
name: string; name: string;
@@ -49,12 +94,47 @@ export interface Roles {
export const RBAC_V1_PACKAGE_NAME = "rbac.v1"; export const RBAC_V1_PACKAGE_NAME = "rbac.v1";
export interface RbacServiceClient { export interface RbacServiceClient {
createRole(request: CreateRoleRequest, metadata?: Metadata): Observable<ModifyRoleResponse>;
updateRole(request: UpdateRoleRequest, metadata?: Metadata): Observable<ModifyRoleResponse>;
deleteRole(request: DeleteRoleRequest, metadata?: Metadata): Observable<DeleteRoleResponse>;
createPermission(request: CreatePermissionRequest, metadata?: Metadata): Observable<ModifyPermissionResponse>;
updatePermission(request: UpdatePermissionRequest, metadata?: Metadata): Observable<ModifyPermissionResponse>;
getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable<GetAllPermissionsResponse>; getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable<GetAllPermissionsResponse>;
getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable<GetAllRolesResponse>; getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable<GetAllRolesResponse>;
} }
export interface RbacServiceController { export interface RbacServiceController {
createRole(
request: CreateRoleRequest,
metadata?: Metadata,
): Promise<ModifyRoleResponse> | Observable<ModifyRoleResponse> | ModifyRoleResponse;
updateRole(
request: UpdateRoleRequest,
metadata?: Metadata,
): Promise<ModifyRoleResponse> | Observable<ModifyRoleResponse> | ModifyRoleResponse;
deleteRole(
request: DeleteRoleRequest,
metadata?: Metadata,
): Promise<DeleteRoleResponse> | Observable<DeleteRoleResponse> | DeleteRoleResponse;
createPermission(
request: CreatePermissionRequest,
metadata?: Metadata,
): Promise<ModifyPermissionResponse> | Observable<ModifyPermissionResponse> | ModifyPermissionResponse;
updatePermission(
request: UpdatePermissionRequest,
metadata?: Metadata,
): Promise<ModifyPermissionResponse> | Observable<ModifyPermissionResponse> | ModifyPermissionResponse;
getAllPermissions( getAllPermissions(
request: GetAllPermissionsRequest, request: GetAllPermissionsRequest,
metadata?: Metadata, metadata?: Metadata,
@@ -68,7 +148,15 @@ export interface RbacServiceController {
export function RbacServiceControllerMethods() { export function RbacServiceControllerMethods() {
return function (constructor: Function) { return function (constructor: Function) {
const grpcMethods: string[] = ["getAllPermissions", "getAllRoles"]; const grpcMethods: string[] = [
"createRole",
"updateRole",
"deleteRole",
"createPermission",
"updatePermission",
"getAllPermissions",
"getAllRoles",
];
for (const method of grpcMethods) { for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("RbacService", method)(constructor.prototype[method], method, descriptor); GrpcMethod("RbacService", method)(constructor.prototype[method], method, descriptor);