diff --git a/api/Makefile b/api/Makefile index c44c056ee944c801df132d8ea7bf1a0bd3b5df6d..a6f2d07587fad5d2a21d63806e951d1792b5176d 100644 --- a/api/Makefile +++ b/api/Makefile @@ -1,4 +1,6 @@ - build: buf mod update proto buf generate + +lint: + buf lint diff --git a/api/go/gosdn/rbac/rbac.pb.go b/api/go/gosdn/rbac/rbac.pb.go index 1752a165cb9c46c69269b95a8193636906b8796b..05a9241273775affa66687b10800f395d807b417 100644 --- a/api/go/gosdn/rbac/rbac.pb.go +++ b/api/go/gosdn/rbac/rbac.pb.go @@ -72,156 +72,6 @@ func (Status) EnumDescriptor() ([]byte, []int) { return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{0} } -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Roles map[string]string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Key = pnd uuid, value= role name - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{0} -} - -func (x *User) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *User) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *User) GetRoles() map[string]string { - if x != nil { - return x.Roles - } - return nil -} - -func (x *User) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *User) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -type Role struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (x *Role) Reset() { - *x = Role{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Role) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Role) ProtoMessage() {} - -func (x *Role) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Role.ProtoReflect.Descriptor instead. -func (*Role) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{1} -} - -func (x *Role) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Role) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Role) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Role) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - // Login type LoginRequest struct { state protoimpl.MessageState @@ -236,7 +86,7 @@ type LoginRequest struct { func (x *LoginRequest) Reset() { *x = LoginRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[2] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -249,7 +99,7 @@ func (x *LoginRequest) String() string { func (*LoginRequest) ProtoMessage() {} func (x *LoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[2] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -262,7 +112,7 @@ func (x *LoginRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. func (*LoginRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{2} + return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{0} } func (x *LoginRequest) GetTimestamp() int64 { @@ -299,7 +149,7 @@ type LoginResponse struct { func (x *LoginResponse) Reset() { *x = LoginResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[3] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -312,7 +162,7 @@ func (x *LoginResponse) String() string { func (*LoginResponse) ProtoMessage() {} func (x *LoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[3] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -325,7 +175,7 @@ func (x *LoginResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. func (*LoginResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{3} + return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{1} } func (x *LoginResponse) GetTimestamp() int64 { @@ -362,7 +212,7 @@ type LogoutRequest struct { func (x *LogoutRequest) Reset() { *x = LogoutRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[4] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +225,7 @@ func (x *LogoutRequest) String() string { func (*LogoutRequest) ProtoMessage() {} func (x *LogoutRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[4] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,7 +238,7 @@ func (x *LogoutRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. func (*LogoutRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{4} + return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{2} } func (x *LogoutRequest) GetTimestamp() int64 { @@ -417,7 +267,7 @@ type LogoutResponse struct { func (x *LogoutResponse) Reset() { *x = LogoutResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[5] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -430,7 +280,7 @@ func (x *LogoutResponse) String() string { func (*LogoutResponse) ProtoMessage() {} func (x *LogoutResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[5] + mi := &file_gosdn_rbac_rbac_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -443,7 +293,7 @@ func (x *LogoutResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead. func (*LogoutResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{5} + return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{3} } func (x *LogoutResponse) GetTimestamp() int64 { @@ -460,1678 +310,118 @@ func (x *LogoutResponse) GetStatus() Status { return Status_STATUS_UNSPECIFIED } -// CreateUsers -type CreateUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"` -} - -func (x *CreateUsersRequest) Reset() { - *x = CreateUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUsersRequest) ProtoMessage() {} +var File_gosdn_rbac_rbac_proto protoreflect.FileDescriptor -func (x *CreateUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +var file_gosdn_rbac_rbac_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x2f, 0x72, 0x62, 0x61, + 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, + 0x62, 0x61, 0x63, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x70, 0x77, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x77, 0x64, 0x22, + 0x6f, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x49, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x0e, 0x4c, + 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x41, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0xbb, 0x01, 0x0a, 0x0b, 0x41, + 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x05, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, + 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, + 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x5b, 0x0a, 0x06, 0x4c, + 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, + 0x61, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x4c, 0x6f, + 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x2f, 0x7b, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x30, 0x5a, 0x2e, 0x63, 0x6f, 0x64, 0x65, + 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, + 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } -// Deprecated: Use CreateUsersRequest.ProtoReflect.Descriptor instead. -func (*CreateUsersRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{6} -} +var ( + file_gosdn_rbac_rbac_proto_rawDescOnce sync.Once + file_gosdn_rbac_rbac_proto_rawDescData = file_gosdn_rbac_rbac_proto_rawDesc +) -func (x *CreateUsersRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 +func file_gosdn_rbac_rbac_proto_rawDescGZIP() []byte { + file_gosdn_rbac_rbac_proto_rawDescOnce.Do(func() { + file_gosdn_rbac_rbac_proto_rawDescData = protoimpl.X.CompressGZIP(file_gosdn_rbac_rbac_proto_rawDescData) + }) + return file_gosdn_rbac_rbac_proto_rawDescData } -func (x *CreateUsersRequest) GetUser() []*User { - if x != nil { - return x.User - } - return nil +var file_gosdn_rbac_rbac_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_gosdn_rbac_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_gosdn_rbac_rbac_proto_goTypes = []interface{}{ + (Status)(0), // 0: gosdn.rbac.Status + (*LoginRequest)(nil), // 1: gosdn.rbac.LoginRequest + (*LoginResponse)(nil), // 2: gosdn.rbac.LoginResponse + (*LogoutRequest)(nil), // 3: gosdn.rbac.LogoutRequest + (*LogoutResponse)(nil), // 4: gosdn.rbac.LogoutResponse } - -type CreateUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +var file_gosdn_rbac_rbac_proto_depIdxs = []int32{ + 0, // 0: gosdn.rbac.LoginResponse.status:type_name -> gosdn.rbac.Status + 0, // 1: gosdn.rbac.LogoutResponse.status:type_name -> gosdn.rbac.Status + 1, // 2: gosdn.rbac.AuthService.Login:input_type -> gosdn.rbac.LoginRequest + 3, // 3: gosdn.rbac.AuthService.Logout:input_type -> gosdn.rbac.LogoutRequest + 2, // 4: gosdn.rbac.AuthService.Login:output_type -> gosdn.rbac.LoginResponse + 4, // 5: gosdn.rbac.AuthService.Logout:output_type -> gosdn.rbac.LogoutResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] 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 extendee + 0, // [0:2] is the sub-list for field type_name } -func (x *CreateUsersResponse) Reset() { - *x = CreateUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func init() { file_gosdn_rbac_rbac_proto_init() } +func file_gosdn_rbac_rbac_proto_init() { + if File_gosdn_rbac_rbac_proto != nil { + return } -} - -func (x *CreateUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUsersResponse) ProtoMessage() {} - -func (x *CreateUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateUsersResponse.ProtoReflect.Descriptor instead. -func (*CreateUsersResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{7} -} - -func (x *CreateUsersResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *CreateUsersResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -// GetUser -type GetUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetUserRequest) Reset() { - *x = GetUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserRequest) ProtoMessage() {} - -func (x *GetUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. -func (*GetUserRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{8} -} - -func (x *GetUserRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetUserRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` - User *User `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetUserResponse) Reset() { - *x = GetUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserResponse) ProtoMessage() {} - -func (x *GetUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. -func (*GetUserResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{9} -} - -func (x *GetUserResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetUserResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *GetUserResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -// GetUsers -type GetUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *GetUsersRequest) Reset() { - *x = GetUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUsersRequest) ProtoMessage() {} - -func (x *GetUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUsersRequest.ProtoReflect.Descriptor instead. -func (*GetUsersRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{10} -} - -func (x *GetUsersRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type GetUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` - User []*User `protobuf:"bytes,3,rep,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetUsersResponse) Reset() { - *x = GetUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUsersResponse) ProtoMessage() {} - -func (x *GetUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUsersResponse.ProtoReflect.Descriptor instead. -func (*GetUsersResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{11} -} - -func (x *GetUsersResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetUsersResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *GetUsersResponse) GetUser() []*User { - if x != nil { - return x.User - } - return nil -} - -// UpdateUsers -type UpdateUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"` -} - -func (x *UpdateUsersRequest) Reset() { - *x = UpdateUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUsersRequest) ProtoMessage() {} - -func (x *UpdateUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUsersRequest.ProtoReflect.Descriptor instead. -func (*UpdateUsersRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{12} -} - -func (x *UpdateUsersRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *UpdateUsersRequest) GetUser() []*User { - if x != nil { - return x.User - } - return nil -} - -type UpdateUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` -} - -func (x *UpdateUsersResponse) Reset() { - *x = UpdateUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUsersResponse) ProtoMessage() {} - -func (x *UpdateUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUsersResponse.ProtoReflect.Descriptor instead. -func (*UpdateUsersResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{13} -} - -func (x *UpdateUsersResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *UpdateUsersResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -// DeleteUsers -type DeleteUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Username []string `protobuf:"bytes,2,rep,name=username,proto3" json:"username,omitempty"` -} - -func (x *DeleteUsersRequest) Reset() { - *x = DeleteUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUsersRequest) ProtoMessage() {} - -func (x *DeleteUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUsersRequest.ProtoReflect.Descriptor instead. -func (*DeleteUsersRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{14} -} - -func (x *DeleteUsersRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeleteUsersRequest) GetUsername() []string { - if x != nil { - return x.Username - } - return nil -} - -type DeleteUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` -} - -func (x *DeleteUsersResponse) Reset() { - *x = DeleteUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUsersResponse) ProtoMessage() {} - -func (x *DeleteUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUsersResponse.ProtoReflect.Descriptor instead. -func (*DeleteUsersResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{15} -} - -func (x *DeleteUsersResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeleteUsersResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -// CreateRoles -type CreateRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Roles []*Role `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` -} - -func (x *CreateRolesRequest) Reset() { - *x = CreateRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRolesRequest) ProtoMessage() {} - -func (x *CreateRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRolesRequest.ProtoReflect.Descriptor instead. -func (*CreateRolesRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{16} -} - -func (x *CreateRolesRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *CreateRolesRequest) GetRoles() []*Role { - if x != nil { - return x.Roles - } - return nil -} - -type CreateRolesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` -} - -func (x *CreateRolesResponse) Reset() { - *x = CreateRolesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRolesResponse) ProtoMessage() {} - -func (x *CreateRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRolesResponse.ProtoReflect.Descriptor instead. -func (*CreateRolesResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{17} -} - -func (x *CreateRolesResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *CreateRolesResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -// GetRole -type GetRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - RoleName string `protobuf:"bytes,2,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` -} - -func (x *GetRoleRequest) Reset() { - *x = GetRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleRequest) ProtoMessage() {} - -func (x *GetRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRoleRequest.ProtoReflect.Descriptor instead. -func (*GetRoleRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{18} -} - -func (x *GetRoleRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetRoleRequest) GetRoleName() string { - if x != nil { - return x.RoleName - } - return "" -} - -type GetRoleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` - Role *Role `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` -} - -func (x *GetRoleResponse) Reset() { - *x = GetRoleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleResponse) ProtoMessage() {} - -func (x *GetRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRoleResponse.ProtoReflect.Descriptor instead. -func (*GetRoleResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{19} -} - -func (x *GetRoleResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetRoleResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *GetRoleResponse) GetRole() *Role { - if x != nil { - return x.Role - } - return nil -} - -// GetRoles -type GetRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *GetRolesRequest) Reset() { - *x = GetRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRolesRequest) ProtoMessage() {} - -func (x *GetRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRolesRequest.ProtoReflect.Descriptor instead. -func (*GetRolesRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{20} -} - -func (x *GetRolesRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type GetRolesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` - Roles []*Role `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` -} - -func (x *GetRolesResponse) Reset() { - *x = GetRolesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRolesResponse) ProtoMessage() {} - -func (x *GetRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRolesResponse.ProtoReflect.Descriptor instead. -func (*GetRolesResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{21} -} - -func (x *GetRolesResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetRolesResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *GetRolesResponse) GetRoles() []*Role { - if x != nil { - return x.Roles - } - return nil -} - -// UpdateRoles -type UpdateRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Roles []*Role `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` -} - -func (x *UpdateRolesRequest) Reset() { - *x = UpdateRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRolesRequest) ProtoMessage() {} - -func (x *UpdateRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRolesRequest.ProtoReflect.Descriptor instead. -func (*UpdateRolesRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{22} -} - -func (x *UpdateRolesRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *UpdateRolesRequest) GetRoles() []*Role { - if x != nil { - return x.Roles - } - return nil -} - -type UpdateRolesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` -} - -func (x *UpdateRolesResponse) Reset() { - *x = UpdateRolesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRolesResponse) ProtoMessage() {} - -func (x *UpdateRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRolesResponse.ProtoReflect.Descriptor instead. -func (*UpdateRolesResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{23} -} - -func (x *UpdateRolesResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *UpdateRolesResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -// DeletePermissionsForRole -type DeletePermissionsForRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - RoleName string `protobuf:"bytes,2,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` - PermissionsToDelete []string `protobuf:"bytes,3,rep,name=permissions_to_delete,json=permissionsToDelete,proto3" json:"permissions_to_delete,omitempty"` -} - -func (x *DeletePermissionsForRoleRequest) Reset() { - *x = DeletePermissionsForRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeletePermissionsForRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePermissionsForRoleRequest) ProtoMessage() {} - -func (x *DeletePermissionsForRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeletePermissionsForRoleRequest.ProtoReflect.Descriptor instead. -func (*DeletePermissionsForRoleRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{24} -} - -func (x *DeletePermissionsForRoleRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeletePermissionsForRoleRequest) GetRoleName() string { - if x != nil { - return x.RoleName - } - return "" -} - -func (x *DeletePermissionsForRoleRequest) GetPermissionsToDelete() []string { - if x != nil { - return x.PermissionsToDelete - } - return nil -} - -type DeletePermissionsForRoleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` -} - -func (x *DeletePermissionsForRoleResponse) Reset() { - *x = DeletePermissionsForRoleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeletePermissionsForRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePermissionsForRoleResponse) ProtoMessage() {} - -func (x *DeletePermissionsForRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeletePermissionsForRoleResponse.ProtoReflect.Descriptor instead. -func (*DeletePermissionsForRoleResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{25} -} - -func (x *DeletePermissionsForRoleResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeletePermissionsForRoleResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -// DeleteRoles -type DeleteRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - RoleName []string `protobuf:"bytes,2,rep,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` -} - -func (x *DeleteRolesRequest) Reset() { - *x = DeleteRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRolesRequest) ProtoMessage() {} - -func (x *DeleteRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRolesRequest.ProtoReflect.Descriptor instead. -func (*DeleteRolesRequest) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{26} -} - -func (x *DeleteRolesRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeleteRolesRequest) GetRoleName() []string { - if x != nil { - return x.RoleName - } - return nil -} - -type DeleteRolesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` -} - -func (x *DeleteRolesResponse) Reset() { - *x = DeleteRolesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRolesResponse) ProtoMessage() {} - -func (x *DeleteRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_rbac_rbac_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRolesResponse.ProtoReflect.Descriptor instead. -func (*DeleteRolesResponse) Descriptor() ([]byte, []int) { - return file_gosdn_rbac_rbac_proto_rawDescGZIP(), []int{27} -} - -func (x *DeleteRolesResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeleteRolesResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -var File_gosdn_rbac_rbac_proto protoreflect.FileDescriptor - -var file_gosdn_rbac_rbac_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x2f, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, - 0x62, 0x61, 0x63, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x31, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x6f, - 0x6c, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x38, 0x0a, 0x0a, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x6e, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, - 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x5a, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x77, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x77, 0x64, 0x22, 0x6f, 0x0a, 0x0d, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x49, 0x0a, 0x0d, - 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x22, 0x58, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, - 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5f, 0x0a, - 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x42, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x12, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5f, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4e, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, - 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x5a, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, 0x0a, 0x05, - 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, - 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, - 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x24, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, - 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, - 0x61, 0x63, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x5a, - 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x1f, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, - 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x70, 0x65, 0x72, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x54, 0x6f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x22, 0x6c, - 0x0a, 0x20, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4f, 0x0a, 0x12, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5f, 0x0a, - 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x41, - 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, - 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, - 0x02, 0x32, 0xaa, 0x0a, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x4f, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a, 0x22, 0x06, 0x2f, 0x6c, 0x6f, 0x67, - 0x69, 0x6e, 0x12, 0x5b, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x19, 0x2e, 0x67, - 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x72, 0x62, 0x61, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x6c, 0x6f, - 0x67, 0x6f, 0x75, 0x74, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, - 0x68, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1e, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x67, 0x65, - 0x74, 0x12, 0x55, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, - 0x12, 0x06, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x68, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, - 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x12, 0x65, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x68, 0x0a, 0x0b, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1a, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, - 0x0a, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x12, 0x55, 0x0a, 0x08, 0x47, - 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, - 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x72, 0x6f, 0x6c, - 0x65, 0x73, 0x12, 0x68, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, - 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, - 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x98, 0x01, 0x0a, - 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, - 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x72, - 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x70, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x65, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, - 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, - 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, - 0x0d, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x30, - 0x5a, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, - 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_gosdn_rbac_rbac_proto_rawDescOnce sync.Once - file_gosdn_rbac_rbac_proto_rawDescData = file_gosdn_rbac_rbac_proto_rawDesc -) - -func file_gosdn_rbac_rbac_proto_rawDescGZIP() []byte { - file_gosdn_rbac_rbac_proto_rawDescOnce.Do(func() { - file_gosdn_rbac_rbac_proto_rawDescData = protoimpl.X.CompressGZIP(file_gosdn_rbac_rbac_proto_rawDescData) - }) - return file_gosdn_rbac_rbac_proto_rawDescData -} - -var file_gosdn_rbac_rbac_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_gosdn_rbac_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 29) -var file_gosdn_rbac_rbac_proto_goTypes = []interface{}{ - (Status)(0), // 0: gosdn.rbac.Status - (*User)(nil), // 1: gosdn.rbac.User - (*Role)(nil), // 2: gosdn.rbac.Role - (*LoginRequest)(nil), // 3: gosdn.rbac.LoginRequest - (*LoginResponse)(nil), // 4: gosdn.rbac.LoginResponse - (*LogoutRequest)(nil), // 5: gosdn.rbac.LogoutRequest - (*LogoutResponse)(nil), // 6: gosdn.rbac.LogoutResponse - (*CreateUsersRequest)(nil), // 7: gosdn.rbac.CreateUsersRequest - (*CreateUsersResponse)(nil), // 8: gosdn.rbac.CreateUsersResponse - (*GetUserRequest)(nil), // 9: gosdn.rbac.GetUserRequest - (*GetUserResponse)(nil), // 10: gosdn.rbac.GetUserResponse - (*GetUsersRequest)(nil), // 11: gosdn.rbac.GetUsersRequest - (*GetUsersResponse)(nil), // 12: gosdn.rbac.GetUsersResponse - (*UpdateUsersRequest)(nil), // 13: gosdn.rbac.UpdateUsersRequest - (*UpdateUsersResponse)(nil), // 14: gosdn.rbac.UpdateUsersResponse - (*DeleteUsersRequest)(nil), // 15: gosdn.rbac.DeleteUsersRequest - (*DeleteUsersResponse)(nil), // 16: gosdn.rbac.DeleteUsersResponse - (*CreateRolesRequest)(nil), // 17: gosdn.rbac.CreateRolesRequest - (*CreateRolesResponse)(nil), // 18: gosdn.rbac.CreateRolesResponse - (*GetRoleRequest)(nil), // 19: gosdn.rbac.GetRoleRequest - (*GetRoleResponse)(nil), // 20: gosdn.rbac.GetRoleResponse - (*GetRolesRequest)(nil), // 21: gosdn.rbac.GetRolesRequest - (*GetRolesResponse)(nil), // 22: gosdn.rbac.GetRolesResponse - (*UpdateRolesRequest)(nil), // 23: gosdn.rbac.UpdateRolesRequest - (*UpdateRolesResponse)(nil), // 24: gosdn.rbac.UpdateRolesResponse - (*DeletePermissionsForRoleRequest)(nil), // 25: gosdn.rbac.DeletePermissionsForRoleRequest - (*DeletePermissionsForRoleResponse)(nil), // 26: gosdn.rbac.DeletePermissionsForRoleResponse - (*DeleteRolesRequest)(nil), // 27: gosdn.rbac.DeleteRolesRequest - (*DeleteRolesResponse)(nil), // 28: gosdn.rbac.DeleteRolesResponse - nil, // 29: gosdn.rbac.User.RolesEntry -} -var file_gosdn_rbac_rbac_proto_depIdxs = []int32{ - 29, // 0: gosdn.rbac.User.roles:type_name -> gosdn.rbac.User.RolesEntry - 0, // 1: gosdn.rbac.LoginResponse.status:type_name -> gosdn.rbac.Status - 0, // 2: gosdn.rbac.LogoutResponse.status:type_name -> gosdn.rbac.Status - 1, // 3: gosdn.rbac.CreateUsersRequest.user:type_name -> gosdn.rbac.User - 0, // 4: gosdn.rbac.CreateUsersResponse.status:type_name -> gosdn.rbac.Status - 0, // 5: gosdn.rbac.GetUserResponse.status:type_name -> gosdn.rbac.Status - 1, // 6: gosdn.rbac.GetUserResponse.user:type_name -> gosdn.rbac.User - 0, // 7: gosdn.rbac.GetUsersResponse.status:type_name -> gosdn.rbac.Status - 1, // 8: gosdn.rbac.GetUsersResponse.user:type_name -> gosdn.rbac.User - 1, // 9: gosdn.rbac.UpdateUsersRequest.user:type_name -> gosdn.rbac.User - 0, // 10: gosdn.rbac.UpdateUsersResponse.status:type_name -> gosdn.rbac.Status - 0, // 11: gosdn.rbac.DeleteUsersResponse.status:type_name -> gosdn.rbac.Status - 2, // 12: gosdn.rbac.CreateRolesRequest.roles:type_name -> gosdn.rbac.Role - 0, // 13: gosdn.rbac.CreateRolesResponse.status:type_name -> gosdn.rbac.Status - 0, // 14: gosdn.rbac.GetRoleResponse.status:type_name -> gosdn.rbac.Status - 2, // 15: gosdn.rbac.GetRoleResponse.role:type_name -> gosdn.rbac.Role - 0, // 16: gosdn.rbac.GetRolesResponse.status:type_name -> gosdn.rbac.Status - 2, // 17: gosdn.rbac.GetRolesResponse.roles:type_name -> gosdn.rbac.Role - 2, // 18: gosdn.rbac.UpdateRolesRequest.roles:type_name -> gosdn.rbac.Role - 0, // 19: gosdn.rbac.UpdateRolesResponse.status:type_name -> gosdn.rbac.Status - 0, // 20: gosdn.rbac.DeletePermissionsForRoleResponse.status:type_name -> gosdn.rbac.Status - 0, // 21: gosdn.rbac.DeleteRolesResponse.status:type_name -> gosdn.rbac.Status - 3, // 22: gosdn.rbac.AuthService.Login:input_type -> gosdn.rbac.LoginRequest - 5, // 23: gosdn.rbac.AuthService.Logout:input_type -> gosdn.rbac.LogoutRequest - 7, // 24: gosdn.rbac.AuthService.CreateUsers:input_type -> gosdn.rbac.CreateUsersRequest - 9, // 25: gosdn.rbac.AuthService.GetUser:input_type -> gosdn.rbac.GetUserRequest - 11, // 26: gosdn.rbac.AuthService.GetUsers:input_type -> gosdn.rbac.GetUsersRequest - 13, // 27: gosdn.rbac.AuthService.UpdateUsers:input_type -> gosdn.rbac.UpdateUsersRequest - 15, // 28: gosdn.rbac.AuthService.DeleteUsers:input_type -> gosdn.rbac.DeleteUsersRequest - 17, // 29: gosdn.rbac.AuthService.CreateRoles:input_type -> gosdn.rbac.CreateRolesRequest - 19, // 30: gosdn.rbac.AuthService.GetRole:input_type -> gosdn.rbac.GetRoleRequest - 21, // 31: gosdn.rbac.AuthService.GetRoles:input_type -> gosdn.rbac.GetRolesRequest - 23, // 32: gosdn.rbac.AuthService.UpdateRoles:input_type -> gosdn.rbac.UpdateRolesRequest - 25, // 33: gosdn.rbac.AuthService.DeletePermissionsForRole:input_type -> gosdn.rbac.DeletePermissionsForRoleRequest - 27, // 34: gosdn.rbac.AuthService.DeleteRoles:input_type -> gosdn.rbac.DeleteRolesRequest - 4, // 35: gosdn.rbac.AuthService.Login:output_type -> gosdn.rbac.LoginResponse - 6, // 36: gosdn.rbac.AuthService.Logout:output_type -> gosdn.rbac.LogoutResponse - 8, // 37: gosdn.rbac.AuthService.CreateUsers:output_type -> gosdn.rbac.CreateUsersResponse - 10, // 38: gosdn.rbac.AuthService.GetUser:output_type -> gosdn.rbac.GetUserResponse - 12, // 39: gosdn.rbac.AuthService.GetUsers:output_type -> gosdn.rbac.GetUsersResponse - 14, // 40: gosdn.rbac.AuthService.UpdateUsers:output_type -> gosdn.rbac.UpdateUsersResponse - 16, // 41: gosdn.rbac.AuthService.DeleteUsers:output_type -> gosdn.rbac.DeleteUsersResponse - 18, // 42: gosdn.rbac.AuthService.CreateRoles:output_type -> gosdn.rbac.CreateRolesResponse - 20, // 43: gosdn.rbac.AuthService.GetRole:output_type -> gosdn.rbac.GetRoleResponse - 22, // 44: gosdn.rbac.AuthService.GetRoles:output_type -> gosdn.rbac.GetRolesResponse - 24, // 45: gosdn.rbac.AuthService.UpdateRoles:output_type -> gosdn.rbac.UpdateRolesResponse - 26, // 46: gosdn.rbac.AuthService.DeletePermissionsForRole:output_type -> gosdn.rbac.DeletePermissionsForRoleResponse - 28, // 47: gosdn.rbac.AuthService.DeleteRoles:output_type -> gosdn.rbac.DeleteRolesResponse - 35, // [35:48] is the sub-list for method output_type - 22, // [22:35] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_gosdn_rbac_rbac_proto_init() } -func file_gosdn_rbac_rbac_proto_init() { - if File_gosdn_rbac_rbac_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_gosdn_rbac_rbac_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } + if !protoimpl.UnsafeEnabled { + file_gosdn_rbac_rbac_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } } file_gosdn_rbac_rbac_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Role); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginResponse); i { case 0: return &v.state @@ -2143,7 +433,7 @@ func file_gosdn_rbac_rbac_proto_init() { return nil } } - file_gosdn_rbac_rbac_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_gosdn_rbac_rbac_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogoutRequest); i { case 0: return &v.state @@ -2155,7 +445,7 @@ func file_gosdn_rbac_rbac_proto_init() { return nil } } - file_gosdn_rbac_rbac_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_gosdn_rbac_rbac_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogoutResponse); i { case 0: return &v.state @@ -2167,270 +457,6 @@ func file_gosdn_rbac_rbac_proto_init() { return nil } } - file_gosdn_rbac_rbac_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRolesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRoleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRoleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRolesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRolesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeletePermissionsForRoleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeletePermissionsForRoleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_rbac_rbac_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRolesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2438,7 +464,7 @@ func file_gosdn_rbac_rbac_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gosdn_rbac_rbac_proto_rawDesc, NumEnums: 1, - NumMessages: 29, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/gosdn/rbac/rbac.pb.gw.go b/api/go/gosdn/rbac/rbac.pb.gw.go index d5a6a249c7f645750c501e9826e9df51aaa37ece..68c8aa9a184f7a0b0a185583cfb0d97b79b2edf0 100644 --- a/api/go/gosdn/rbac/rbac.pb.gw.go +++ b/api/go/gosdn/rbac/rbac.pb.gw.go @@ -135,665 +135,24 @@ func local_request_AuthService_Logout_0(ctx context.Context, marshaler runtime.M } -func request_AuthService_CreateUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUsersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_CreateUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateUsersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateUsers(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_GetUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetUserRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetUser_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetUserRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetUser_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetUser(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_GetUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_GetUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_GetUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetUsers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AuthService_UpdateUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateUsersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdateUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_UpdateUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateUsersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdateUsers(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_DeleteUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeleteUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteUsersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeleteUsers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteUsers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AuthService_CreateRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRolesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreateRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_CreateRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRolesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreateRoles(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_GetRole_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRoleRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRoleRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetRole(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_GetRoles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_GetRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRolesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetRoles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_GetRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRolesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_GetRoles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetRoles(ctx, &protoReq) - return msg, metadata, err - -} - -func request_AuthService_UpdateRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateRolesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdateRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_UpdateRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateRolesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdateRoles(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_DeletePermissionsForRole_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_DeletePermissionsForRole_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeletePermissionsForRoleRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeletePermissionsForRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeletePermissionsForRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_DeletePermissionsForRole_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeletePermissionsForRoleRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeletePermissionsForRole_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeletePermissionsForRole(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_AuthService_DeleteRoles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_AuthService_DeleteRoles_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRolesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeleteRoles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_AuthService_DeleteRoles_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRolesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_DeleteRoles_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteRoles(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". -// UnaryRPC :call AuthServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead. -func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error { - - mux.Handle("POST", pattern_AuthService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/Login", runtime.WithHTTPPathPattern("/login")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_Login_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/Logout", runtime.WithHTTPPathPattern("/logout/{username}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_Logout_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_Logout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_CreateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/CreateUsers", runtime.WithHTTPPathPattern("/users/create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_CreateUsers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_CreateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetUser", runtime.WithHTTPPathPattern("/users/get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_GetUser_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetUsers", runtime.WithHTTPPathPattern("/users")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_GetUsers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_UpdateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/UpdateUsers", runtime.WithHTTPPathPattern("/users/update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_UpdateUsers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_UpdateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AuthService_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeleteUsers", runtime.WithHTTPPathPattern("/users/delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_DeleteUsers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_CreateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/CreateRoles", runtime.WithHTTPPathPattern("/roles/create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_CreateRoles_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_CreateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetRole", runtime.WithHTTPPathPattern("/roles/get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_GetRole_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetRoles", runtime.WithHTTPPathPattern("/roles")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_GetRoles_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_UpdateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/UpdateRoles", runtime.WithHTTPPathPattern("/roles/update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_AuthService_UpdateRoles_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_UpdateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) +// RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". +// UnaryRPC :call AuthServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead. +func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error { - mux.Handle("DELETE", pattern_AuthService_DeletePermissionsForRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_AuthService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeletePermissionsForRole", runtime.WithHTTPPathPattern("/roles/delete/permissions")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/Login", runtime.WithHTTPPathPattern("/login")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_AuthService_DeletePermissionsForRole_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_AuthService_Login_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -801,22 +160,22 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_AuthService_DeletePermissionsForRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_AuthService_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_AuthService_DeleteRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_AuthService_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeleteRoles", runtime.WithHTTPPathPattern("/roles/delete")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.AuthService/Logout", runtime.WithHTTPPathPattern("/logout/{username}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_AuthService_DeleteRoles_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_AuthService_Logout_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -824,7 +183,7 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_AuthService_DeleteRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_AuthService_Logout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -909,226 +268,6 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("POST", pattern_AuthService_CreateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/CreateUsers", runtime.WithHTTPPathPattern("/users/create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_CreateUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_CreateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetUser", runtime.WithHTTPPathPattern("/users/get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_GetUser_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetUsers", runtime.WithHTTPPathPattern("/users")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_GetUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_UpdateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/UpdateUsers", runtime.WithHTTPPathPattern("/users/update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_UpdateUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_UpdateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AuthService_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeleteUsers", runtime.WithHTTPPathPattern("/users/delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_DeleteUsers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_CreateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/CreateRoles", runtime.WithHTTPPathPattern("/roles/create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_CreateRoles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_CreateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetRole", runtime.WithHTTPPathPattern("/roles/get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_GetRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_AuthService_GetRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/GetRoles", runtime.WithHTTPPathPattern("/roles")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_GetRoles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_GetRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_AuthService_UpdateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/UpdateRoles", runtime.WithHTTPPathPattern("/roles/update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_UpdateRoles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_UpdateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AuthService_DeletePermissionsForRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeletePermissionsForRole", runtime.WithHTTPPathPattern("/roles/delete/permissions")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_DeletePermissionsForRole_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_DeletePermissionsForRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_AuthService_DeleteRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.AuthService/DeleteRoles", runtime.WithHTTPPathPattern("/roles/delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_AuthService_DeleteRoles_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_AuthService_DeleteRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -1136,54 +275,10 @@ var ( pattern_AuthService_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"login"}, "")) pattern_AuthService_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"logout", "username"}, "")) - - pattern_AuthService_CreateUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "create"}, "")) - - pattern_AuthService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "get"}, "")) - - pattern_AuthService_GetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"users"}, "")) - - pattern_AuthService_UpdateUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "update"}, "")) - - pattern_AuthService_DeleteUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "delete"}, "")) - - pattern_AuthService_CreateRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "create"}, "")) - - pattern_AuthService_GetRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "get"}, "")) - - pattern_AuthService_GetRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"roles"}, "")) - - pattern_AuthService_UpdateRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "update"}, "")) - - pattern_AuthService_DeletePermissionsForRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"roles", "delete", "permissions"}, "")) - - pattern_AuthService_DeleteRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "delete"}, "")) ) var ( forward_AuthService_Login_0 = runtime.ForwardResponseMessage forward_AuthService_Logout_0 = runtime.ForwardResponseMessage - - forward_AuthService_CreateUsers_0 = runtime.ForwardResponseMessage - - forward_AuthService_GetUser_0 = runtime.ForwardResponseMessage - - forward_AuthService_GetUsers_0 = runtime.ForwardResponseMessage - - forward_AuthService_UpdateUsers_0 = runtime.ForwardResponseMessage - - forward_AuthService_DeleteUsers_0 = runtime.ForwardResponseMessage - - forward_AuthService_CreateRoles_0 = runtime.ForwardResponseMessage - - forward_AuthService_GetRole_0 = runtime.ForwardResponseMessage - - forward_AuthService_GetRoles_0 = runtime.ForwardResponseMessage - - forward_AuthService_UpdateRoles_0 = runtime.ForwardResponseMessage - - forward_AuthService_DeletePermissionsForRole_0 = runtime.ForwardResponseMessage - - forward_AuthService_DeleteRoles_0 = runtime.ForwardResponseMessage ) diff --git a/api/go/gosdn/rbac/rbac_grpc.pb.go b/api/go/gosdn/rbac/rbac_grpc.pb.go index 8ba7a4f688c04eab25cfa6115824fa7519b102ad..31485d97070a51a77b5214b980c5e23b1499ff7f 100644 --- a/api/go/gosdn/rbac/rbac_grpc.pb.go +++ b/api/go/gosdn/rbac/rbac_grpc.pb.go @@ -22,40 +22,6 @@ type AuthServiceClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) // Allows a user to log out from an existing session. Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) - // Create users with the provided parameters, creation of multiple users requires login beforehand. - // Highest possible permissions of new users is of current permission level. - // If not logged in: Created user has lowest possible permissions, only one user can be created this way. - CreateUsers(ctx context.Context, in *CreateUsersRequest, opts ...grpc.CallOption) (*CreateUsersResponse, error) - // Requests information about one user, requires login beforehand.option - GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) - // Requests information about available users, requires login beforehand. - // Requires highest possible permissions. - GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error) - // Updates users with the provided parameters, requires login beforehand. - // Requires highest permissions to change other users, everyone else can only update their own account. - // Requires highest permissions to change multiple users at the same time. - UpdateUsers(ctx context.Context, in *UpdateUsersRequest, opts ...grpc.CallOption) (*UpdateUsersResponse, error) - // Deletes users, requires login beforehand. - // Requires highest permissions. - DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) - // Creates roles, requires login beforehand. - // Requires highest permissions. - CreateRoles(ctx context.Context, in *CreateRolesRequest, opts ...grpc.CallOption) (*CreateRolesResponse, error) - // Requests one role with its permissions, requires login beforehand. - // Requires highest permissions. - GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) - // Requests all roles with their permissions, requires login beforehand. - // Requires highest permissions. - GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error) - // Updates roles by setting the provided permissions, requires login beforehand. - // Requires highest permissions. - UpdateRoles(ctx context.Context, in *UpdateRolesRequest, opts ...grpc.CallOption) (*UpdateRolesResponse, error) - // Deletes permissions from given role, requires login beforehand. - // Requires highest permissions. - DeletePermissionsForRole(ctx context.Context, in *DeletePermissionsForRoleRequest, opts ...grpc.CallOption) (*DeletePermissionsForRoleResponse, error) - // Deletes roles with their permissions, requires login beforehand. - // Requires highest permissions. - DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) } type authServiceClient struct { @@ -84,105 +50,6 @@ func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts return out, nil } -func (c *authServiceClient) CreateUsers(ctx context.Context, in *CreateUsersRequest, opts ...grpc.CallOption) (*CreateUsersResponse, error) { - out := new(CreateUsersResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/CreateUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { - out := new(GetUserResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/GetUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error) { - out := new(GetUsersResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/GetUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) UpdateUsers(ctx context.Context, in *UpdateUsersRequest, opts ...grpc.CallOption) (*UpdateUsersResponse, error) { - out := new(UpdateUsersResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/UpdateUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) { - out := new(DeleteUsersResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/DeleteUsers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) CreateRoles(ctx context.Context, in *CreateRolesRequest, opts ...grpc.CallOption) (*CreateRolesResponse, error) { - out := new(CreateRolesResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/CreateRoles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) { - out := new(GetRoleResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/GetRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error) { - out := new(GetRolesResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/GetRoles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) UpdateRoles(ctx context.Context, in *UpdateRolesRequest, opts ...grpc.CallOption) (*UpdateRolesResponse, error) { - out := new(UpdateRolesResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/UpdateRoles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) DeletePermissionsForRole(ctx context.Context, in *DeletePermissionsForRoleRequest, opts ...grpc.CallOption) (*DeletePermissionsForRoleResponse, error) { - out := new(DeletePermissionsForRoleResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/DeletePermissionsForRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) { - out := new(DeleteRolesResponse) - err := c.cc.Invoke(ctx, "/gosdn.rbac.AuthService/DeleteRoles", in, out, opts...) - 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 @@ -191,40 +58,6 @@ type AuthServiceServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) // Allows a user to log out from an existing session. Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) - // Create users with the provided parameters, creation of multiple users requires login beforehand. - // Highest possible permissions of new users is of current permission level. - // If not logged in: Created user has lowest possible permissions, only one user can be created this way. - CreateUsers(context.Context, *CreateUsersRequest) (*CreateUsersResponse, error) - // Requests information about one user, requires login beforehand.option - GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) - // Requests information about available users, requires login beforehand. - // Requires highest possible permissions. - GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) - // Updates users with the provided parameters, requires login beforehand. - // Requires highest permissions to change other users, everyone else can only update their own account. - // Requires highest permissions to change multiple users at the same time. - UpdateUsers(context.Context, *UpdateUsersRequest) (*UpdateUsersResponse, error) - // Deletes users, requires login beforehand. - // Requires highest permissions. - DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error) - // Creates roles, requires login beforehand. - // Requires highest permissions. - CreateRoles(context.Context, *CreateRolesRequest) (*CreateRolesResponse, error) - // Requests one role with its permissions, requires login beforehand. - // Requires highest permissions. - GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) - // Requests all roles with their permissions, requires login beforehand. - // Requires highest permissions. - GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error) - // Updates roles by setting the provided permissions, requires login beforehand. - // Requires highest permissions. - UpdateRoles(context.Context, *UpdateRolesRequest) (*UpdateRolesResponse, error) - // Deletes permissions from given role, requires login beforehand. - // Requires highest permissions. - DeletePermissionsForRole(context.Context, *DeletePermissionsForRoleRequest) (*DeletePermissionsForRoleResponse, error) - // Deletes roles with their permissions, requires login beforehand. - // Requires highest permissions. - DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error) mustEmbedUnimplementedAuthServiceServer() } @@ -238,39 +71,6 @@ func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*Lo func (UnimplementedAuthServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") } -func (UnimplementedAuthServiceServer) CreateUsers(context.Context, *CreateUsersRequest) (*CreateUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateUsers not implemented") -} -func (UnimplementedAuthServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") -} -func (UnimplementedAuthServiceServer) GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUsers not implemented") -} -func (UnimplementedAuthServiceServer) UpdateUsers(context.Context, *UpdateUsersRequest) (*UpdateUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUsers not implemented") -} -func (UnimplementedAuthServiceServer) DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUsers not implemented") -} -func (UnimplementedAuthServiceServer) CreateRoles(context.Context, *CreateRolesRequest) (*CreateRolesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRoles not implemented") -} -func (UnimplementedAuthServiceServer) GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented") -} -func (UnimplementedAuthServiceServer) GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRoles not implemented") -} -func (UnimplementedAuthServiceServer) UpdateRoles(context.Context, *UpdateRolesRequest) (*UpdateRolesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateRoles not implemented") -} -func (UnimplementedAuthServiceServer) DeletePermissionsForRole(context.Context, *DeletePermissionsForRoleRequest) (*DeletePermissionsForRoleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeletePermissionsForRole not implemented") -} -func (UnimplementedAuthServiceServer) DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRoles not implemented") -} func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} // UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. @@ -320,204 +120,6 @@ func _AuthService_Logout_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _AuthService_CreateUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).CreateUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/CreateUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).CreateUsers(ctx, req.(*CreateUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).GetUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/GetUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).GetUser(ctx, req.(*GetUserRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).GetUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/GetUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).GetUsers(ctx, req.(*GetUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_UpdateUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).UpdateUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/UpdateUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).UpdateUsers(ctx, req.(*UpdateUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUsersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).DeleteUsers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/DeleteUsers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).DeleteUsers(ctx, req.(*DeleteUsersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_CreateRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).CreateRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/CreateRoles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).CreateRoles(ctx, req.(*CreateRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).GetRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/GetRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).GetRole(ctx, req.(*GetRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_GetRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).GetRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/GetRoles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).GetRoles(ctx, req.(*GetRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_UpdateRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).UpdateRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/UpdateRoles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).UpdateRoles(ctx, req.(*UpdateRolesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_DeletePermissionsForRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeletePermissionsForRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).DeletePermissionsForRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/DeletePermissionsForRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).DeletePermissionsForRole(ctx, req.(*DeletePermissionsForRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_DeleteRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRolesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).DeleteRoles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.rbac.AuthService/DeleteRoles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).DeleteRoles(ctx, req.(*DeleteRolesRequest)) - } - 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) @@ -533,50 +135,6 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Logout", Handler: _AuthService_Logout_Handler, }, - { - MethodName: "CreateUsers", - Handler: _AuthService_CreateUsers_Handler, - }, - { - MethodName: "GetUser", - Handler: _AuthService_GetUser_Handler, - }, - { - MethodName: "GetUsers", - Handler: _AuthService_GetUsers_Handler, - }, - { - MethodName: "UpdateUsers", - Handler: _AuthService_UpdateUsers_Handler, - }, - { - MethodName: "DeleteUsers", - Handler: _AuthService_DeleteUsers_Handler, - }, - { - MethodName: "CreateRoles", - Handler: _AuthService_CreateRoles_Handler, - }, - { - MethodName: "GetRole", - Handler: _AuthService_GetRole_Handler, - }, - { - MethodName: "GetRoles", - Handler: _AuthService_GetRoles_Handler, - }, - { - MethodName: "UpdateRoles", - Handler: _AuthService_UpdateRoles_Handler, - }, - { - MethodName: "DeletePermissionsForRole", - Handler: _AuthService_DeletePermissionsForRole_Handler, - }, - { - MethodName: "DeleteRoles", - Handler: _AuthService_DeleteRoles_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "gosdn/rbac/rbac.proto", diff --git a/api/go/gosdn/rbac/role.pb.go b/api/go/gosdn/rbac/role.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..e3dfae038facef552767a4dfb61c881d77077c54 --- /dev/null +++ b/api/go/gosdn/rbac/role.pb.go @@ -0,0 +1,1163 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: gosdn/rbac/role.proto + +package rbac + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +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 Role struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (x *Role) Reset() { + *x = Role{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Role) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Role) ProtoMessage() {} + +func (x *Role) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Role.ProtoReflect.Descriptor instead. +func (*Role) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{0} +} + +func (x *Role) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Role) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Role) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Role) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +// CreateRoles +type CreateRolesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Roles []*Role `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` +} + +func (x *CreateRolesRequest) Reset() { + *x = CreateRolesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRolesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRolesRequest) ProtoMessage() {} + +func (x *CreateRolesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRolesRequest.ProtoReflect.Descriptor instead. +func (*CreateRolesRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateRolesRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *CreateRolesRequest) GetRoles() []*Role { + if x != nil { + return x.Roles + } + return nil +} + +type CreateRolesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *CreateRolesResponse) Reset() { + *x = CreateRolesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRolesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRolesResponse) ProtoMessage() {} + +func (x *CreateRolesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRolesResponse.ProtoReflect.Descriptor instead. +func (*CreateRolesResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateRolesResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *CreateRolesResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +// GetRole +type GetRoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + RoleName string `protobuf:"bytes,2,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` +} + +func (x *GetRoleRequest) Reset() { + *x = GetRoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRoleRequest) ProtoMessage() {} + +func (x *GetRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRoleRequest.ProtoReflect.Descriptor instead. +func (*GetRoleRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{3} +} + +func (x *GetRoleRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetRoleRequest) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +type GetRoleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` + Role *Role `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` +} + +func (x *GetRoleResponse) Reset() { + *x = GetRoleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRoleResponse) ProtoMessage() {} + +func (x *GetRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRoleResponse.ProtoReflect.Descriptor instead. +func (*GetRoleResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{4} +} + +func (x *GetRoleResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetRoleResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *GetRoleResponse) GetRole() *Role { + if x != nil { + return x.Role + } + return nil +} + +// GetRoles +type GetRolesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *GetRolesRequest) Reset() { + *x = GetRolesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRolesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRolesRequest) ProtoMessage() {} + +func (x *GetRolesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRolesRequest.ProtoReflect.Descriptor instead. +func (*GetRolesRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{5} +} + +func (x *GetRolesRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type GetRolesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` + Roles []*Role `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` +} + +func (x *GetRolesResponse) Reset() { + *x = GetRolesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRolesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRolesResponse) ProtoMessage() {} + +func (x *GetRolesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRolesResponse.ProtoReflect.Descriptor instead. +func (*GetRolesResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{6} +} + +func (x *GetRolesResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetRolesResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *GetRolesResponse) GetRoles() []*Role { + if x != nil { + return x.Roles + } + return nil +} + +// UpdateRoles +type UpdateRolesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Roles []*Role `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` +} + +func (x *UpdateRolesRequest) Reset() { + *x = UpdateRolesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRolesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRolesRequest) ProtoMessage() {} + +func (x *UpdateRolesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRolesRequest.ProtoReflect.Descriptor instead. +func (*UpdateRolesRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateRolesRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateRolesRequest) GetRoles() []*Role { + if x != nil { + return x.Roles + } + return nil +} + +type UpdateRolesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *UpdateRolesResponse) Reset() { + *x = UpdateRolesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRolesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRolesResponse) ProtoMessage() {} + +func (x *UpdateRolesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRolesResponse.ProtoReflect.Descriptor instead. +func (*UpdateRolesResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateRolesResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateRolesResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +// DeletePermissionsForRole +type DeletePermissionsForRoleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + RoleName string `protobuf:"bytes,2,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` + PermissionsToDelete []string `protobuf:"bytes,3,rep,name=permissions_to_delete,json=permissionsToDelete,proto3" json:"permissions_to_delete,omitempty"` +} + +func (x *DeletePermissionsForRoleRequest) Reset() { + *x = DeletePermissionsForRoleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePermissionsForRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePermissionsForRoleRequest) ProtoMessage() {} + +func (x *DeletePermissionsForRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePermissionsForRoleRequest.ProtoReflect.Descriptor instead. +func (*DeletePermissionsForRoleRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{9} +} + +func (x *DeletePermissionsForRoleRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeletePermissionsForRoleRequest) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +func (x *DeletePermissionsForRoleRequest) GetPermissionsToDelete() []string { + if x != nil { + return x.PermissionsToDelete + } + return nil +} + +type DeletePermissionsForRoleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *DeletePermissionsForRoleResponse) Reset() { + *x = DeletePermissionsForRoleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePermissionsForRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePermissionsForRoleResponse) ProtoMessage() {} + +func (x *DeletePermissionsForRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePermissionsForRoleResponse.ProtoReflect.Descriptor instead. +func (*DeletePermissionsForRoleResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{10} +} + +func (x *DeletePermissionsForRoleResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeletePermissionsForRoleResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +// DeleteRoles +type DeleteRolesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + RoleName []string `protobuf:"bytes,2,rep,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` +} + +func (x *DeleteRolesRequest) Reset() { + *x = DeleteRolesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRolesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRolesRequest) ProtoMessage() {} + +func (x *DeleteRolesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRolesRequest.ProtoReflect.Descriptor instead. +func (*DeleteRolesRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{11} +} + +func (x *DeleteRolesRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteRolesRequest) GetRoleName() []string { + if x != nil { + return x.RoleName + } + return nil +} + +type DeleteRolesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *DeleteRolesResponse) Reset() { + *x = DeleteRolesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_role_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRolesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRolesResponse) ProtoMessage() {} + +func (x *DeleteRolesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_role_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRolesResponse.ProtoReflect.Descriptor instead. +func (*DeleteRolesResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_role_proto_rawDescGZIP(), []int{12} +} + +func (x *DeleteRolesResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteRolesResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +var File_gosdn_rbac_role_proto protoreflect.FileDescriptor + +var file_gosdn_rbac_role_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x2f, 0x72, 0x6f, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, + 0x62, 0x61, 0x63, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x2f, + 0x72, 0x62, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6e, 0x0a, 0x04, 0x52, 0x6f, + 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5a, 0x0a, 0x12, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, + 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, + 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, + 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, + 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x72, 0x62, 0x61, 0x63, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, + 0x22, 0x5a, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, + 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x13, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x90, 0x01, + 0x0a, 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x15, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x54, 0x6f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x22, 0x6c, 0x0a, 0x20, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4f, + 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0x5f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, + 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x32, 0x92, 0x05, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x68, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, + 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x72, 0x6f, + 0x6c, 0x65, 0x73, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, + 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x67, + 0x65, 0x74, 0x12, 0x55, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1b, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x08, 0x12, 0x06, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x68, 0x0a, 0x0b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x46, + 0x6f, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x52, + 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x65, + 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, + 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gosdn_rbac_role_proto_rawDescOnce sync.Once + file_gosdn_rbac_role_proto_rawDescData = file_gosdn_rbac_role_proto_rawDesc +) + +func file_gosdn_rbac_role_proto_rawDescGZIP() []byte { + file_gosdn_rbac_role_proto_rawDescOnce.Do(func() { + file_gosdn_rbac_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_gosdn_rbac_role_proto_rawDescData) + }) + return file_gosdn_rbac_role_proto_rawDescData +} + +var file_gosdn_rbac_role_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_gosdn_rbac_role_proto_goTypes = []interface{}{ + (*Role)(nil), // 0: gosdn.rbac.Role + (*CreateRolesRequest)(nil), // 1: gosdn.rbac.CreateRolesRequest + (*CreateRolesResponse)(nil), // 2: gosdn.rbac.CreateRolesResponse + (*GetRoleRequest)(nil), // 3: gosdn.rbac.GetRoleRequest + (*GetRoleResponse)(nil), // 4: gosdn.rbac.GetRoleResponse + (*GetRolesRequest)(nil), // 5: gosdn.rbac.GetRolesRequest + (*GetRolesResponse)(nil), // 6: gosdn.rbac.GetRolesResponse + (*UpdateRolesRequest)(nil), // 7: gosdn.rbac.UpdateRolesRequest + (*UpdateRolesResponse)(nil), // 8: gosdn.rbac.UpdateRolesResponse + (*DeletePermissionsForRoleRequest)(nil), // 9: gosdn.rbac.DeletePermissionsForRoleRequest + (*DeletePermissionsForRoleResponse)(nil), // 10: gosdn.rbac.DeletePermissionsForRoleResponse + (*DeleteRolesRequest)(nil), // 11: gosdn.rbac.DeleteRolesRequest + (*DeleteRolesResponse)(nil), // 12: gosdn.rbac.DeleteRolesResponse + (Status)(0), // 13: gosdn.rbac.Status +} +var file_gosdn_rbac_role_proto_depIdxs = []int32{ + 0, // 0: gosdn.rbac.CreateRolesRequest.roles:type_name -> gosdn.rbac.Role + 13, // 1: gosdn.rbac.CreateRolesResponse.status:type_name -> gosdn.rbac.Status + 13, // 2: gosdn.rbac.GetRoleResponse.status:type_name -> gosdn.rbac.Status + 0, // 3: gosdn.rbac.GetRoleResponse.role:type_name -> gosdn.rbac.Role + 13, // 4: gosdn.rbac.GetRolesResponse.status:type_name -> gosdn.rbac.Status + 0, // 5: gosdn.rbac.GetRolesResponse.roles:type_name -> gosdn.rbac.Role + 0, // 6: gosdn.rbac.UpdateRolesRequest.roles:type_name -> gosdn.rbac.Role + 13, // 7: gosdn.rbac.UpdateRolesResponse.status:type_name -> gosdn.rbac.Status + 13, // 8: gosdn.rbac.DeletePermissionsForRoleResponse.status:type_name -> gosdn.rbac.Status + 13, // 9: gosdn.rbac.DeleteRolesResponse.status:type_name -> gosdn.rbac.Status + 1, // 10: gosdn.rbac.RoleService.CreateRoles:input_type -> gosdn.rbac.CreateRolesRequest + 3, // 11: gosdn.rbac.RoleService.GetRole:input_type -> gosdn.rbac.GetRoleRequest + 5, // 12: gosdn.rbac.RoleService.GetRoles:input_type -> gosdn.rbac.GetRolesRequest + 7, // 13: gosdn.rbac.RoleService.UpdateRoles:input_type -> gosdn.rbac.UpdateRolesRequest + 9, // 14: gosdn.rbac.RoleService.DeletePermissionsForRole:input_type -> gosdn.rbac.DeletePermissionsForRoleRequest + 11, // 15: gosdn.rbac.RoleService.DeleteRoles:input_type -> gosdn.rbac.DeleteRolesRequest + 2, // 16: gosdn.rbac.RoleService.CreateRoles:output_type -> gosdn.rbac.CreateRolesResponse + 4, // 17: gosdn.rbac.RoleService.GetRole:output_type -> gosdn.rbac.GetRoleResponse + 6, // 18: gosdn.rbac.RoleService.GetRoles:output_type -> gosdn.rbac.GetRolesResponse + 8, // 19: gosdn.rbac.RoleService.UpdateRoles:output_type -> gosdn.rbac.UpdateRolesResponse + 10, // 20: gosdn.rbac.RoleService.DeletePermissionsForRole:output_type -> gosdn.rbac.DeletePermissionsForRoleResponse + 12, // 21: gosdn.rbac.RoleService.DeleteRoles:output_type -> gosdn.rbac.DeleteRolesResponse + 16, // [16:22] is the sub-list for method output_type + 10, // [10:16] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_gosdn_rbac_role_proto_init() } +func file_gosdn_rbac_role_proto_init() { + if File_gosdn_rbac_role_proto != nil { + return + } + file_gosdn_rbac_rbac_proto_init() + if !protoimpl.UnsafeEnabled { + file_gosdn_rbac_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Role); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRolesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRolesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRoleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRolesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRolesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRolesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRolesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePermissionsForRoleRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePermissionsForRoleResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRolesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_role_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRolesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gosdn_rbac_role_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gosdn_rbac_role_proto_goTypes, + DependencyIndexes: file_gosdn_rbac_role_proto_depIdxs, + MessageInfos: file_gosdn_rbac_role_proto_msgTypes, + }.Build() + File_gosdn_rbac_role_proto = out.File + file_gosdn_rbac_role_proto_rawDesc = nil + file_gosdn_rbac_role_proto_goTypes = nil + file_gosdn_rbac_role_proto_depIdxs = nil +} diff --git a/api/go/gosdn/rbac/role.pb.gw.go b/api/go/gosdn/rbac/role.pb.gw.go new file mode 100644 index 0000000000000000000000000000000000000000..b8ae805bd41fa37bef52ec7ef1fd15fbbd528f07 --- /dev/null +++ b/api/go/gosdn/rbac/role.pb.gw.go @@ -0,0 +1,580 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: gosdn/rbac/role.proto + +/* +Package rbac is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package rbac + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_RoleService_CreateRoles_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateRolesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoleService_CreateRoles_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateRolesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateRoles(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RoleService_GetRole_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RoleService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRoleRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_GetRole_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoleService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRoleRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_GetRole_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRole(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RoleService_GetRoles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RoleService_GetRoles_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRolesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_GetRoles_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoleService_GetRoles_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetRolesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_GetRoles_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRoles(ctx, &protoReq) + return msg, metadata, err + +} + +func request_RoleService_UpdateRoles_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateRolesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoleService_UpdateRoles_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateRolesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateRoles(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RoleService_DeletePermissionsForRole_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RoleService_DeletePermissionsForRole_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePermissionsForRoleRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_DeletePermissionsForRole_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeletePermissionsForRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoleService_DeletePermissionsForRole_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeletePermissionsForRoleRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_DeletePermissionsForRole_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeletePermissionsForRole(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RoleService_DeleteRoles_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_RoleService_DeleteRoles_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteRolesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_DeleteRoles_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteRoles(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RoleService_DeleteRoles_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteRolesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RoleService_DeleteRoles_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteRoles(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterRoleServiceHandlerServer registers the http handlers for service RoleService to "mux". +// UnaryRPC :call RoleServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRoleServiceHandlerFromEndpoint instead. +func RegisterRoleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RoleServiceServer) error { + + mux.Handle("POST", pattern_RoleService_CreateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.RoleService/CreateRoles", runtime.WithHTTPPathPattern("/roles/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoleService_CreateRoles_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_CreateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoleService_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.RoleService/GetRole", runtime.WithHTTPPathPattern("/roles/get")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoleService_GetRole_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_GetRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoleService_GetRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.RoleService/GetRoles", runtime.WithHTTPPathPattern("/roles")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoleService_GetRoles_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_GetRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_RoleService_UpdateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.RoleService/UpdateRoles", runtime.WithHTTPPathPattern("/roles/update")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoleService_UpdateRoles_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_UpdateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RoleService_DeletePermissionsForRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.RoleService/DeletePermissionsForRole", runtime.WithHTTPPathPattern("/roles/delete/permissions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoleService_DeletePermissionsForRole_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_DeletePermissionsForRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RoleService_DeleteRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.RoleService/DeleteRoles", runtime.WithHTTPPathPattern("/roles/delete")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RoleService_DeleteRoles_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_DeleteRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterRoleServiceHandlerFromEndpoint is same as RegisterRoleServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRoleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRoleServiceHandler(ctx, mux, conn) +} + +// RegisterRoleServiceHandler registers the http handlers for service RoleService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRoleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRoleServiceHandlerClient(ctx, mux, NewRoleServiceClient(conn)) +} + +// RegisterRoleServiceHandlerClient registers the http handlers for service RoleService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RoleServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RoleServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RoleServiceClient" to call the correct interceptors. +func RegisterRoleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RoleServiceClient) error { + + mux.Handle("POST", pattern_RoleService_CreateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.RoleService/CreateRoles", runtime.WithHTTPPathPattern("/roles/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoleService_CreateRoles_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_CreateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoleService_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.RoleService/GetRole", runtime.WithHTTPPathPattern("/roles/get")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoleService_GetRole_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_GetRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RoleService_GetRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.RoleService/GetRoles", runtime.WithHTTPPathPattern("/roles")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoleService_GetRoles_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_GetRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_RoleService_UpdateRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.RoleService/UpdateRoles", runtime.WithHTTPPathPattern("/roles/update")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoleService_UpdateRoles_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_UpdateRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RoleService_DeletePermissionsForRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.RoleService/DeletePermissionsForRole", runtime.WithHTTPPathPattern("/roles/delete/permissions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoleService_DeletePermissionsForRole_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_DeletePermissionsForRole_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_RoleService_DeleteRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.RoleService/DeleteRoles", runtime.WithHTTPPathPattern("/roles/delete")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RoleService_DeleteRoles_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_RoleService_DeleteRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RoleService_CreateRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "create"}, "")) + + pattern_RoleService_GetRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "get"}, "")) + + pattern_RoleService_GetRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"roles"}, "")) + + pattern_RoleService_UpdateRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "update"}, "")) + + pattern_RoleService_DeletePermissionsForRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"roles", "delete", "permissions"}, "")) + + pattern_RoleService_DeleteRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"roles", "delete"}, "")) +) + +var ( + forward_RoleService_CreateRoles_0 = runtime.ForwardResponseMessage + + forward_RoleService_GetRole_0 = runtime.ForwardResponseMessage + + forward_RoleService_GetRoles_0 = runtime.ForwardResponseMessage + + forward_RoleService_UpdateRoles_0 = runtime.ForwardResponseMessage + + forward_RoleService_DeletePermissionsForRole_0 = runtime.ForwardResponseMessage + + forward_RoleService_DeleteRoles_0 = runtime.ForwardResponseMessage +) diff --git a/api/go/gosdn/rbac/role_grpc.pb.go b/api/go/gosdn/rbac/role_grpc.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..0fffec9266de8ec08b1de79a5f6da6027906b88c --- /dev/null +++ b/api/go/gosdn/rbac/role_grpc.pb.go @@ -0,0 +1,305 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package rbac + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RoleServiceClient is the client API for RoleService 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 RoleServiceClient interface { + // Creates roles, requires login beforehand. + // Requires highest permissions. + CreateRoles(ctx context.Context, in *CreateRolesRequest, opts ...grpc.CallOption) (*CreateRolesResponse, error) + // Requests one role with its permissions, requires login beforehand. + // Requires highest permissions. + GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) + // Requests all roles with their permissions, requires login beforehand. + // Requires highest permissions. + GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error) + // Updates roles by setting the provided permissions, requires login beforehand. + // Requires highest permissions. + UpdateRoles(ctx context.Context, in *UpdateRolesRequest, opts ...grpc.CallOption) (*UpdateRolesResponse, error) + // Deletes permissions from given role, requires login beforehand. + // Requires highest permissions. + DeletePermissionsForRole(ctx context.Context, in *DeletePermissionsForRoleRequest, opts ...grpc.CallOption) (*DeletePermissionsForRoleResponse, error) + // Deletes roles with their permissions, requires login beforehand. + // Requires highest permissions. + DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) +} + +type roleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient { + return &roleServiceClient{cc} +} + +func (c *roleServiceClient) CreateRoles(ctx context.Context, in *CreateRolesRequest, opts ...grpc.CallOption) (*CreateRolesResponse, error) { + out := new(CreateRolesResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/CreateRoles", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*GetRoleResponse, error) { + out := new(GetRoleResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/GetRole", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error) { + out := new(GetRolesResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/GetRoles", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) UpdateRoles(ctx context.Context, in *UpdateRolesRequest, opts ...grpc.CallOption) (*UpdateRolesResponse, error) { + out := new(UpdateRolesResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/UpdateRoles", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) DeletePermissionsForRole(ctx context.Context, in *DeletePermissionsForRoleRequest, opts ...grpc.CallOption) (*DeletePermissionsForRoleResponse, error) { + out := new(DeletePermissionsForRoleResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/DeletePermissionsForRole", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) DeleteRoles(ctx context.Context, in *DeleteRolesRequest, opts ...grpc.CallOption) (*DeleteRolesResponse, error) { + out := new(DeleteRolesResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.RoleService/DeleteRoles", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RoleServiceServer is the server API for RoleService service. +// All implementations must embed UnimplementedRoleServiceServer +// for forward compatibility +type RoleServiceServer interface { + // Creates roles, requires login beforehand. + // Requires highest permissions. + CreateRoles(context.Context, *CreateRolesRequest) (*CreateRolesResponse, error) + // Requests one role with its permissions, requires login beforehand. + // Requires highest permissions. + GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) + // Requests all roles with their permissions, requires login beforehand. + // Requires highest permissions. + GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error) + // Updates roles by setting the provided permissions, requires login beforehand. + // Requires highest permissions. + UpdateRoles(context.Context, *UpdateRolesRequest) (*UpdateRolesResponse, error) + // Deletes permissions from given role, requires login beforehand. + // Requires highest permissions. + DeletePermissionsForRole(context.Context, *DeletePermissionsForRoleRequest) (*DeletePermissionsForRoleResponse, error) + // Deletes roles with their permissions, requires login beforehand. + // Requires highest permissions. + DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error) + mustEmbedUnimplementedRoleServiceServer() +} + +// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRoleServiceServer struct { +} + +func (UnimplementedRoleServiceServer) CreateRoles(context.Context, *CreateRolesRequest) (*CreateRolesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRoles not implemented") +} +func (UnimplementedRoleServiceServer) GetRole(context.Context, *GetRoleRequest) (*GetRoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented") +} +func (UnimplementedRoleServiceServer) GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRoles not implemented") +} +func (UnimplementedRoleServiceServer) UpdateRoles(context.Context, *UpdateRolesRequest) (*UpdateRolesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRoles not implemented") +} +func (UnimplementedRoleServiceServer) DeletePermissionsForRole(context.Context, *DeletePermissionsForRoleRequest) (*DeletePermissionsForRoleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePermissionsForRole not implemented") +} +func (UnimplementedRoleServiceServer) DeleteRoles(context.Context, *DeleteRolesRequest) (*DeleteRolesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRoles not implemented") +} +func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {} + +// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RoleServiceServer will +// result in compilation errors. +type UnsafeRoleServiceServer interface { + mustEmbedUnimplementedRoleServiceServer() +} + +func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) { + s.RegisterService(&RoleService_ServiceDesc, srv) +} + +func _RoleService_CreateRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).CreateRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.RoleService/CreateRoles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).CreateRoles(ctx, req.(*CreateRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.RoleService/GetRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetRole(ctx, req.(*GetRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.RoleService/GetRoles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetRoles(ctx, req.(*GetRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_UpdateRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).UpdateRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.RoleService/UpdateRoles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).UpdateRoles(ctx, req.(*UpdateRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_DeletePermissionsForRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePermissionsForRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).DeletePermissionsForRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.RoleService/DeletePermissionsForRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).DeletePermissionsForRole(ctx, req.(*DeletePermissionsForRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_DeleteRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).DeleteRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.RoleService/DeleteRoles", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).DeleteRoles(ctx, req.(*DeleteRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RoleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gosdn.rbac.RoleService", + HandlerType: (*RoleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRoles", + Handler: _RoleService_CreateRoles_Handler, + }, + { + MethodName: "GetRole", + Handler: _RoleService_GetRole_Handler, + }, + { + MethodName: "GetRoles", + Handler: _RoleService_GetRoles_Handler, + }, + { + MethodName: "UpdateRoles", + Handler: _RoleService_UpdateRoles_Handler, + }, + { + MethodName: "DeletePermissionsForRole", + Handler: _RoleService_DeletePermissionsForRole_Handler, + }, + { + MethodName: "DeleteRoles", + Handler: _RoleService_DeleteRoles_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gosdn/rbac/role.proto", +} diff --git a/api/go/gosdn/rbac/user.pb.go b/api/go/gosdn/rbac/user.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..f999c7ddee55ebdc9a4de8f525a42ab5ea03669c --- /dev/null +++ b/api/go/gosdn/rbac/user.pb.go @@ -0,0 +1,1004 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: gosdn/rbac/user.proto + +package rbac + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +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 User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Roles map[string]string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Key = pnd uuid, value= role name + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *User) GetRoles() map[string]string { + if x != nil { + return x.Roles + } + return nil +} + +func (x *User) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *User) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// CreateUsers +type CreateUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"` +} + +func (x *CreateUsersRequest) Reset() { + *x = CreateUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUsersRequest) ProtoMessage() {} + +func (x *CreateUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUsersRequest.ProtoReflect.Descriptor instead. +func (*CreateUsersRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateUsersRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *CreateUsersRequest) GetUser() []*User { + if x != nil { + return x.User + } + return nil +} + +type CreateUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *CreateUsersResponse) Reset() { + *x = CreateUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUsersResponse) ProtoMessage() {} + +func (x *CreateUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUsersResponse.ProtoReflect.Descriptor instead. +func (*CreateUsersResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateUsersResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *CreateUsersResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +// GetUser +type GetUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{3} +} + +func (x *GetUserRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetUserRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` + User *User `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *GetUserResponse) Reset() { + *x = GetUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserResponse) ProtoMessage() {} + +func (x *GetUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. +func (*GetUserResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{4} +} + +func (x *GetUserResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetUserResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *GetUserResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +// GetUsers +type GetUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *GetUsersRequest) Reset() { + *x = GetUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUsersRequest) ProtoMessage() {} + +func (x *GetUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUsersRequest.ProtoReflect.Descriptor instead. +func (*GetUsersRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{5} +} + +func (x *GetUsersRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type GetUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` + User []*User `protobuf:"bytes,3,rep,name=user,proto3" json:"user,omitempty"` +} + +func (x *GetUsersResponse) Reset() { + *x = GetUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUsersResponse) ProtoMessage() {} + +func (x *GetUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUsersResponse.ProtoReflect.Descriptor instead. +func (*GetUsersResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{6} +} + +func (x *GetUsersResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetUsersResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *GetUsersResponse) GetUser() []*User { + if x != nil { + return x.User + } + return nil +} + +// UpdateUsers +type UpdateUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"` +} + +func (x *UpdateUsersRequest) Reset() { + *x = UpdateUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUsersRequest) ProtoMessage() {} + +func (x *UpdateUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUsersRequest.ProtoReflect.Descriptor instead. +func (*UpdateUsersRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateUsersRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateUsersRequest) GetUser() []*User { + if x != nil { + return x.User + } + return nil +} + +type UpdateUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *UpdateUsersResponse) Reset() { + *x = UpdateUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUsersResponse) ProtoMessage() {} + +func (x *UpdateUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUsersResponse.ProtoReflect.Descriptor instead. +func (*UpdateUsersResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateUsersResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateUsersResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +// DeleteUsers +type DeleteUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Username []string `protobuf:"bytes,2,rep,name=username,proto3" json:"username,omitempty"` +} + +func (x *DeleteUsersRequest) Reset() { + *x = DeleteUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUsersRequest) ProtoMessage() {} + +func (x *DeleteUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUsersRequest.ProtoReflect.Descriptor instead. +func (*DeleteUsersRequest) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteUsersRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteUsersRequest) GetUsername() []string { + if x != nil { + return x.Username + } + return nil +} + +type DeleteUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.rbac.Status" json:"status,omitempty"` +} + +func (x *DeleteUsersResponse) Reset() { + *x = DeleteUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_rbac_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUsersResponse) ProtoMessage() {} + +func (x *DeleteUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_rbac_user_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUsersResponse.ProtoReflect.Descriptor instead. +func (*DeleteUsersResponse) Descriptor() ([]byte, []int) { + return file_gosdn_rbac_user_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteUsersResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteUsersResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +var File_gosdn_rbac_user_proto protoreflect.FileDescriptor + +var file_gosdn_rbac_user_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, + 0x62, 0x61, 0x63, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x2f, + 0x72, 0x62, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x01, 0x0a, 0x04, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, + 0x62, 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x38, 0x0a, 0x0a, + 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x58, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x22, 0x5f, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, + 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x42, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x58, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5f, 0x0a, 0x13, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4e, 0x0a, 0x12, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x13, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xf7, 0x03, 0x0a, 0x0b, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x0b, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x0c, 0x12, 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x67, 0x65, 0x74, 0x12, 0x55, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, + 0x62, 0x61, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x08, 0x12, 0x06, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x12, 0x68, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, + 0x0d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x65, + 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x72, 0x62, 0x61, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, + 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2f, 0x72, 0x62, 0x61, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gosdn_rbac_user_proto_rawDescOnce sync.Once + file_gosdn_rbac_user_proto_rawDescData = file_gosdn_rbac_user_proto_rawDesc +) + +func file_gosdn_rbac_user_proto_rawDescGZIP() []byte { + file_gosdn_rbac_user_proto_rawDescOnce.Do(func() { + file_gosdn_rbac_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_gosdn_rbac_user_proto_rawDescData) + }) + return file_gosdn_rbac_user_proto_rawDescData +} + +var file_gosdn_rbac_user_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_gosdn_rbac_user_proto_goTypes = []interface{}{ + (*User)(nil), // 0: gosdn.rbac.User + (*CreateUsersRequest)(nil), // 1: gosdn.rbac.CreateUsersRequest + (*CreateUsersResponse)(nil), // 2: gosdn.rbac.CreateUsersResponse + (*GetUserRequest)(nil), // 3: gosdn.rbac.GetUserRequest + (*GetUserResponse)(nil), // 4: gosdn.rbac.GetUserResponse + (*GetUsersRequest)(nil), // 5: gosdn.rbac.GetUsersRequest + (*GetUsersResponse)(nil), // 6: gosdn.rbac.GetUsersResponse + (*UpdateUsersRequest)(nil), // 7: gosdn.rbac.UpdateUsersRequest + (*UpdateUsersResponse)(nil), // 8: gosdn.rbac.UpdateUsersResponse + (*DeleteUsersRequest)(nil), // 9: gosdn.rbac.DeleteUsersRequest + (*DeleteUsersResponse)(nil), // 10: gosdn.rbac.DeleteUsersResponse + nil, // 11: gosdn.rbac.User.RolesEntry + (Status)(0), // 12: gosdn.rbac.Status +} +var file_gosdn_rbac_user_proto_depIdxs = []int32{ + 11, // 0: gosdn.rbac.User.roles:type_name -> gosdn.rbac.User.RolesEntry + 0, // 1: gosdn.rbac.CreateUsersRequest.user:type_name -> gosdn.rbac.User + 12, // 2: gosdn.rbac.CreateUsersResponse.status:type_name -> gosdn.rbac.Status + 12, // 3: gosdn.rbac.GetUserResponse.status:type_name -> gosdn.rbac.Status + 0, // 4: gosdn.rbac.GetUserResponse.user:type_name -> gosdn.rbac.User + 12, // 5: gosdn.rbac.GetUsersResponse.status:type_name -> gosdn.rbac.Status + 0, // 6: gosdn.rbac.GetUsersResponse.user:type_name -> gosdn.rbac.User + 0, // 7: gosdn.rbac.UpdateUsersRequest.user:type_name -> gosdn.rbac.User + 12, // 8: gosdn.rbac.UpdateUsersResponse.status:type_name -> gosdn.rbac.Status + 12, // 9: gosdn.rbac.DeleteUsersResponse.status:type_name -> gosdn.rbac.Status + 1, // 10: gosdn.rbac.UserService.CreateUsers:input_type -> gosdn.rbac.CreateUsersRequest + 3, // 11: gosdn.rbac.UserService.GetUser:input_type -> gosdn.rbac.GetUserRequest + 5, // 12: gosdn.rbac.UserService.GetUsers:input_type -> gosdn.rbac.GetUsersRequest + 7, // 13: gosdn.rbac.UserService.UpdateUsers:input_type -> gosdn.rbac.UpdateUsersRequest + 9, // 14: gosdn.rbac.UserService.DeleteUsers:input_type -> gosdn.rbac.DeleteUsersRequest + 2, // 15: gosdn.rbac.UserService.CreateUsers:output_type -> gosdn.rbac.CreateUsersResponse + 4, // 16: gosdn.rbac.UserService.GetUser:output_type -> gosdn.rbac.GetUserResponse + 6, // 17: gosdn.rbac.UserService.GetUsers:output_type -> gosdn.rbac.GetUsersResponse + 8, // 18: gosdn.rbac.UserService.UpdateUsers:output_type -> gosdn.rbac.UpdateUsersResponse + 10, // 19: gosdn.rbac.UserService.DeleteUsers:output_type -> gosdn.rbac.DeleteUsersResponse + 15, // [15:20] is the sub-list for method output_type + 10, // [10:15] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_gosdn_rbac_user_proto_init() } +func file_gosdn_rbac_user_proto_init() { + if File_gosdn_rbac_user_proto != nil { + return + } + file_gosdn_rbac_rbac_proto_init() + if !protoimpl.UnsafeEnabled { + file_gosdn_rbac_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUsersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUsersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUsersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUsersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUsersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUsersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUsersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_rbac_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUsersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gosdn_rbac_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gosdn_rbac_user_proto_goTypes, + DependencyIndexes: file_gosdn_rbac_user_proto_depIdxs, + MessageInfos: file_gosdn_rbac_user_proto_msgTypes, + }.Build() + File_gosdn_rbac_user_proto = out.File + file_gosdn_rbac_user_proto_rawDesc = nil + file_gosdn_rbac_user_proto_goTypes = nil + file_gosdn_rbac_user_proto_depIdxs = nil +} diff --git a/api/go/gosdn/rbac/user.pb.gw.go b/api/go/gosdn/rbac/user.pb.gw.go new file mode 100644 index 0000000000000000000000000000000000000000..c39793fc5b9c8420254608814567cbc91ed8fcab --- /dev/null +++ b/api/go/gosdn/rbac/user.pb.gw.go @@ -0,0 +1,497 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: gosdn/rbac/user.proto + +/* +Package rbac is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package rbac + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_UserService_CreateUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateUsersRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_CreateUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateUsersRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateUsers(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserService_GetUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUserRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUserRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUser(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserService_GetUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserService_GetUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUsersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_GetUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetUsersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_GetUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUsers(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserService_UpdateUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUsersRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_UpdateUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUsersRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUsers(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_UserService_DeleteUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserService_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteUsersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_DeleteUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_DeleteUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteUsersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_DeleteUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteUsers(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". +// UnaryRPC :call UserServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead. +func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error { + + mux.Handle("POST", pattern_UserService_CreateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.UserService/CreateUsers", runtime.WithHTTPPathPattern("/users/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_CreateUsers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_CreateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.UserService/GetUser", runtime.WithHTTPPathPattern("/users/get")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_GetUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserService_GetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.UserService/GetUsers", runtime.WithHTTPPathPattern("/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_GetUsers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_GetUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserService_UpdateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.UserService/UpdateUsers", runtime.WithHTTPPathPattern("/users/update")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_UpdateUsers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_UpdateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_UserService_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.rbac.UserService/DeleteUsers", runtime.WithHTTPPathPattern("/users/delete")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_DeleteUsers_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterUserServiceHandler(ctx, mux, conn) +} + +// RegisterUserServiceHandler registers the http handlers for service UserService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUserServiceHandlerClient(ctx, mux, NewUserServiceClient(conn)) +} + +// RegisterUserServiceHandlerClient registers the http handlers for service UserService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UserServiceClient" to call the correct interceptors. +func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error { + + mux.Handle("POST", pattern_UserService_CreateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.UserService/CreateUsers", runtime.WithHTTPPathPattern("/users/create")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_CreateUsers_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_CreateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.UserService/GetUser", runtime.WithHTTPPathPattern("/users/get")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_GetUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_GetUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_UserService_GetUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.UserService/GetUsers", runtime.WithHTTPPathPattern("/users")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_GetUsers_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_GetUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserService_UpdateUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.UserService/UpdateUsers", runtime.WithHTTPPathPattern("/users/update")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_UpdateUsers_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_UpdateUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_UserService_DeleteUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.rbac.UserService/DeleteUsers", runtime.WithHTTPPathPattern("/users/delete")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_DeleteUsers_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_DeleteUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_UserService_CreateUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "create"}, "")) + + pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "get"}, "")) + + pattern_UserService_GetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"users"}, "")) + + pattern_UserService_UpdateUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "update"}, "")) + + pattern_UserService_DeleteUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"users", "delete"}, "")) +) + +var ( + forward_UserService_CreateUsers_0 = runtime.ForwardResponseMessage + + forward_UserService_GetUser_0 = runtime.ForwardResponseMessage + + forward_UserService_GetUsers_0 = runtime.ForwardResponseMessage + + forward_UserService_UpdateUsers_0 = runtime.ForwardResponseMessage + + forward_UserService_DeleteUsers_0 = runtime.ForwardResponseMessage +) diff --git a/api/go/gosdn/rbac/user_grpc.pb.go b/api/go/gosdn/rbac/user_grpc.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..bbd8ec9388000b5d1cfe2b4e3973ea2c7f8ecd20 --- /dev/null +++ b/api/go/gosdn/rbac/user_grpc.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package rbac + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // Create users with the provided parameters, creation of multiple users requires login beforehand. + // Highest possible permissions of new users is of current permission level. + // If not logged in: Created user has lowest possible permissions, only one user can be created this way. + CreateUsers(ctx context.Context, in *CreateUsersRequest, opts ...grpc.CallOption) (*CreateUsersResponse, error) + // Requests information about one user, requires login beforehand.option + GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) + // Requests information about available users, requires login beforehand. + // Requires highest possible permissions. + GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error) + // Updates users with the provided parameters, requires login beforehand. + // Requires highest permissions to change other users, everyone else can only update their own account. + // Requires highest permissions to change multiple users at the same time. + UpdateUsers(ctx context.Context, in *UpdateUsersRequest, opts ...grpc.CallOption) (*UpdateUsersResponse, error) + // Deletes users, requires login beforehand. + // Requires highest permissions. + DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) CreateUsers(ctx context.Context, in *CreateUsersRequest, opts ...grpc.CallOption) (*CreateUsersResponse, error) { + out := new(CreateUsersResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.UserService/CreateUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { + out := new(GetUserResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.UserService/GetUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error) { + out := new(GetUsersResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.UserService/GetUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUsers(ctx context.Context, in *UpdateUsersRequest, opts ...grpc.CallOption) (*UpdateUsersResponse, error) { + out := new(UpdateUsersResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.UserService/UpdateUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteUsers(ctx context.Context, in *DeleteUsersRequest, opts ...grpc.CallOption) (*DeleteUsersResponse, error) { + out := new(DeleteUsersResponse) + err := c.cc.Invoke(ctx, "/gosdn.rbac.UserService/DeleteUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // Create users with the provided parameters, creation of multiple users requires login beforehand. + // Highest possible permissions of new users is of current permission level. + // If not logged in: Created user has lowest possible permissions, only one user can be created this way. + CreateUsers(context.Context, *CreateUsersRequest) (*CreateUsersResponse, error) + // Requests information about one user, requires login beforehand.option + GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) + // Requests information about available users, requires login beforehand. + // Requires highest possible permissions. + GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) + // Updates users with the provided parameters, requires login beforehand. + // Requires highest permissions to change other users, everyone else can only update their own account. + // Requires highest permissions to change multiple users at the same time. + UpdateUsers(context.Context, *UpdateUsersRequest) (*UpdateUsersResponse, error) + // Deletes users, requires login beforehand. + // Requires highest permissions. + DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) CreateUsers(context.Context, *CreateUsersRequest) (*CreateUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUsers not implemented") +} +func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") +} +func (UnimplementedUserServiceServer) GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUsers not implemented") +} +func (UnimplementedUserServiceServer) UpdateUsers(context.Context, *UpdateUsersRequest) (*UpdateUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUsers not implemented") +} +func (UnimplementedUserServiceServer) DeleteUsers(context.Context, *DeleteUsersRequest) (*DeleteUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUsers not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_CreateUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.UserService/CreateUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateUsers(ctx, req.(*CreateUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.UserService/GetUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.UserService/GetUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetUsers(ctx, req.(*GetUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.UserService/UpdateUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUsers(ctx, req.(*UpdateUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.rbac.UserService/DeleteUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteUsers(ctx, req.(*DeleteUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gosdn.rbac.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateUsers", + Handler: _UserService_CreateUsers_Handler, + }, + { + MethodName: "GetUser", + Handler: _UserService_GetUser_Handler, + }, + { + MethodName: "GetUsers", + Handler: _UserService_GetUsers_Handler, + }, + { + MethodName: "UpdateUsers", + Handler: _UserService_UpdateUsers_Handler, + }, + { + MethodName: "DeleteUsers", + Handler: _UserService_DeleteUsers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gosdn/rbac/user.proto", +} diff --git a/api/openapiv2/gosdn_northbound.swagger.json b/api/openapiv2/gosdn_northbound.swagger.json index 95b7be71018bc35e08df3ed6b008d4a14773b659..4a016bc2c27b39a0706fa3505d0640987c8a9acc 100644 --- a/api/openapiv2/gosdn_northbound.swagger.json +++ b/api/openapiv2/gosdn_northbound.swagger.json @@ -37,6 +37,12 @@ }, { "name": "AuthService" + }, + { + "name": "RoleService" + }, + { + "name": "UserService" } ], "consumes": [ @@ -812,7 +818,7 @@ "/roles": { "get": { "summary": "Requests all roles with their permissions, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_GetRoles", + "operationId": "RoleService_GetRoles", "responses": { "200": { "description": "A successful response.", @@ -837,14 +843,14 @@ } ], "tags": [ - "AuthService" + "RoleService" ] } }, "/roles/create": { "post": { "summary": "Creates roles, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_CreateRoles", + "operationId": "RoleService_CreateRoles", "responses": { "200": { "description": "A successful response.", @@ -870,14 +876,14 @@ } ], "tags": [ - "AuthService" + "RoleService" ] } }, "/roles/delete": { "delete": { "summary": "Deletes roles with their permissions, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_DeleteRoles", + "operationId": "RoleService_DeleteRoles", "responses": { "200": { "description": "A successful response.", @@ -912,14 +918,14 @@ } ], "tags": [ - "AuthService" + "RoleService" ] } }, "/roles/delete/permissions": { "delete": { "summary": "Deletes permissions from given role, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_DeletePermissionsForRole", + "operationId": "RoleService_DeletePermissionsForRole", "responses": { "200": { "description": "A successful response.", @@ -960,14 +966,14 @@ } ], "tags": [ - "AuthService" + "RoleService" ] } }, "/roles/get": { "get": { "summary": "Requests one role with its permissions, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_GetRole", + "operationId": "RoleService_GetRole", "responses": { "200": { "description": "A successful response.", @@ -998,14 +1004,14 @@ } ], "tags": [ - "AuthService" + "RoleService" ] } }, "/roles/update": { "post": { "summary": "Updates roles by setting the provided permissions, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_UpdateRoles", + "operationId": "RoleService_UpdateRoles", "responses": { "200": { "description": "A successful response.", @@ -1031,14 +1037,14 @@ } ], "tags": [ - "AuthService" + "RoleService" ] } }, "/users": { "get": { "summary": "Requests information about available users, requires login beforehand.\nRequires highest possible permissions.", - "operationId": "AuthService_GetUsers", + "operationId": "UserService_GetUsers", "responses": { "200": { "description": "A successful response.", @@ -1063,14 +1069,14 @@ } ], "tags": [ - "AuthService" + "UserService" ] } }, "/users/create": { "post": { "summary": "Create users with the provided parameters, creation of multiple users requires login beforehand.\nHighest possible permissions of new users is of current permission level.\nIf not logged in: Created user has lowest possible permissions, only one user can be created this way.", - "operationId": "AuthService_CreateUsers", + "operationId": "UserService_CreateUsers", "responses": { "200": { "description": "A successful response.", @@ -1096,14 +1102,14 @@ } ], "tags": [ - "AuthService" + "UserService" ] } }, "/users/delete": { "delete": { "summary": "Deletes users, requires login beforehand.\nRequires highest permissions.", - "operationId": "AuthService_DeleteUsers", + "operationId": "UserService_DeleteUsers", "responses": { "200": { "description": "A successful response.", @@ -1138,14 +1144,14 @@ } ], "tags": [ - "AuthService" + "UserService" ] } }, "/users/get": { "get": { "summary": "Requests information about one user, requires login beforehand.option", - "operationId": "AuthService_GetUser", + "operationId": "UserService_GetUser", "responses": { "200": { "description": "A successful response.", @@ -1176,14 +1182,14 @@ } ], "tags": [ - "AuthService" + "UserService" ] } }, "/users/update": { "post": { "summary": "Updates users with the provided parameters, requires login beforehand.\nRequires highest permissions to change other users, everyone else can only update their own account.\nRequires highest permissions to change multiple users at the same time.", - "operationId": "AuthService_UpdateUsers", + "operationId": "UserService_UpdateUsers", "responses": { "200": { "description": "A successful response.", @@ -1209,7 +1215,7 @@ } ], "tags": [ - "AuthService" + "UserService" ] } } diff --git a/api/proto/buf.lock b/api/proto/buf.lock index cbd6cb43b338d5f4f6833b84cfc1f5ae1ee0510b..60d8de11dc18ebb85fc6bab0acf9be9c0d7d0b24 100644 --- a/api/proto/buf.lock +++ b/api/proto/buf.lock @@ -4,8 +4,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: b6631422c6964600bf3bdd9bf09c6636 + commit: f3590c56d388417ebbedefae77ac12bf - remote: buf.build owner: grpc-ecosystem repository: grpc-gateway - commit: f85c60ac38544f2d8f346491c9d916e5 + commit: febd9e8be39b4f4b878b9c64bcc203fd diff --git a/api/proto/gosdn/rbac/rbac.proto b/api/proto/gosdn/rbac/rbac.proto index 6208518c6ec663aecd4855270924ff4944bf6428..201d908527b32dcaf7b23e7b2874e285a9283fcc 100644 --- a/api/proto/gosdn/rbac/rbac.proto +++ b/api/proto/gosdn/rbac/rbac.proto @@ -24,99 +24,6 @@ service AuthService { post: "/logout/{username}" }; } - - // Create users with the provided parameters, creation of multiple users requires login beforehand. - // Highest possible permissions of new users is of current permission level. - // If not logged in: Created user has lowest possible permissions, only one user can be created this way. - rpc CreateUsers(CreateUsersRequest) returns (CreateUsersResponse) { - option (google.api.http) = { - post: "/users/create" - body: "*" - }; - } - - // Requests information about one user, requires login beforehand.option - rpc GetUser (GetUserRequest) returns (GetUserResponse) { - option (google.api.http) = { - get: "/users/get" - }; - } - - // Requests information about available users, requires login beforehand. - // Requires highest possible permissions. - rpc GetUsers (GetUsersRequest) returns (GetUsersResponse) { - option (google.api.http) = { - get: "/users" - }; - } - - // Updates users with the provided parameters, requires login beforehand. - // Requires highest permissions to change other users, everyone else can only update their own account. - // Requires highest permissions to change multiple users at the same time. - rpc UpdateUsers (UpdateUsersRequest) returns (UpdateUsersResponse) { - option (google.api.http) = { - post: "/users/update" - body: "*" - }; - } - - // Deletes users, requires login beforehand. - // Requires highest permissions. - rpc DeleteUsers(DeleteUsersRequest) returns (DeleteUsersResponse) { - option (google.api.http) = { - delete: "/users/delete" - }; - } - - // Creates roles, requires login beforehand. - // Requires highest permissions. - rpc CreateRoles(CreateRolesRequest) returns (CreateRolesResponse) { - option (google.api.http) = { - post: "/roles/create" - body: "*" - }; - } - - // Requests one role with its permissions, requires login beforehand. - // Requires highest permissions. - rpc GetRole(GetRoleRequest) returns (GetRoleResponse) { - option (google.api.http) = { - get: "/roles/get" - }; - } - - // Requests all roles with their permissions, requires login beforehand. - // Requires highest permissions. - rpc GetRoles(GetRolesRequest) returns (GetRolesResponse) { - option (google.api.http) = { - get: "/roles" - }; - } - - // Updates roles by setting the provided permissions, requires login beforehand. - // Requires highest permissions. - rpc UpdateRoles(UpdateRolesRequest) returns (UpdateRolesResponse) { - option (google.api.http) = { - post: "/roles/update" - body: "*" - }; - } - - // Deletes permissions from given role, requires login beforehand. - // Requires highest permissions. - rpc DeletePermissionsForRole(DeletePermissionsForRoleRequest) returns (DeletePermissionsForRoleResponse) { - option (google.api.http) = { - delete: "/roles/delete/permissions" - }; - } - - // Deletes roles with their permissions, requires login beforehand. - // Requires highest permissions. - rpc DeleteRoles(DeleteRolesRequest) returns (DeleteRolesResponse) { - option (google.api.http) = { - delete: "/roles/delete" - }; - } } enum Status { @@ -125,21 +32,6 @@ enum Status { STATUS_ERROR = 2; } -message User { - string id = 1; - string name = 2; - map<string, string> roles = 3; // Key = pnd uuid, value= role name - string password = 4; - string token = 5; -} - -message Role { - string id = 1; - string name = 2; - string description = 3; - repeated string permissions = 4; -} - // Login message LoginRequest { int64 timestamp = 1; @@ -163,127 +55,3 @@ message LogoutResponse { int64 timestamp = 1; Status status = 2; } - -// CreateUsers -message CreateUsersRequest { - int64 timestamp = 1; - repeated User user = 2; -} - -message CreateUsersResponse { - int64 timestamp = 1; - Status status = 2; -} - -// GetUser -message GetUserRequest { - int64 timestamp = 1; - string name = 2; -} - -message GetUserResponse { - int64 timestamp = 1; - Status status = 2; - User user = 3; -} - -// GetUsers -message GetUsersRequest { - int64 timestamp = 1; -} - -message GetUsersResponse { - int64 timestamp = 1; - Status status = 2; - repeated User user = 3; -} - -// UpdateUsers -message UpdateUsersRequest { - int64 timestamp = 1; - repeated User user = 2; -} - -message UpdateUsersResponse { - int64 timestamp = 1; - Status status = 2; -} - -// DeleteUsers -message DeleteUsersRequest { - int64 timestamp = 1; - repeated string username = 2; -} - -message DeleteUsersResponse { - int64 timestamp = 1; - Status status = 2; -} - -// CreateRoles -message CreateRolesRequest { - int64 timestamp = 1; - repeated Role roles = 2; -} - -message CreateRolesResponse { - int64 timestamp = 1; - Status status = 2; -} - -// GetRole -message GetRoleRequest { - int64 timestamp = 1; - string role_name = 2; -} - -message GetRoleResponse { - int64 timestamp = 1; - Status status = 2; - Role role = 3; -} - -// GetRoles -message GetRolesRequest { - int64 timestamp = 1; -} - -message GetRolesResponse { - int64 timestamp = 1; - Status status = 2; - repeated Role roles = 3; -} - -// UpdateRoles -message UpdateRolesRequest { - int64 timestamp = 1; - repeated Role roles = 2; -} - -message UpdateRolesResponse { - int64 timestamp = 1; - Status status = 2; -} - -// DeletePermissionsForRole -message DeletePermissionsForRoleRequest { - int64 timestamp = 1; - string role_name = 2; - repeated string permissions_to_delete = 3; -} - -message DeletePermissionsForRoleResponse { - int64 timestamp = 1; - Status status = 2; -} - -// DeleteRoles -message DeleteRolesRequest { - int64 timestamp = 1; - repeated string role_name = 2; -} - -message DeleteRolesResponse { - int64 timestamp = 1; - Status status = 2; -} diff --git a/api/proto/gosdn/rbac/role.proto b/api/proto/gosdn/rbac/role.proto new file mode 100644 index 0000000000000000000000000000000000000000..044fbef8a5f3edd2ba63023554f2d148aa3f6a87 --- /dev/null +++ b/api/proto/gosdn/rbac/role.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; + +package gosdn.rbac; + +import "google/api/annotations.proto"; +import "google/protobuf/descriptor.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "gosdn/rbac/rbac.proto"; + +option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac"; + +service RoleService { + // Creates roles, requires login beforehand. + // Requires highest permissions. + rpc CreateRoles(CreateRolesRequest) returns (CreateRolesResponse) { + option (google.api.http) = { + post: "/roles/create" + body: "*" + }; + } + + // Requests one role with its permissions, requires login beforehand. + // Requires highest permissions. + rpc GetRole(GetRoleRequest) returns (GetRoleResponse) { + option (google.api.http) = { + get: "/roles/get" + }; + } + + // Requests all roles with their permissions, requires login beforehand. + // Requires highest permissions. + rpc GetRoles(GetRolesRequest) returns (GetRolesResponse) { + option (google.api.http) = { + get: "/roles" + }; + } + + // Updates roles by setting the provided permissions, requires login beforehand. + // Requires highest permissions. + rpc UpdateRoles(UpdateRolesRequest) returns (UpdateRolesResponse) { + option (google.api.http) = { + post: "/roles/update" + body: "*" + }; + } + + // Deletes permissions from given role, requires login beforehand. + // Requires highest permissions. + rpc DeletePermissionsForRole(DeletePermissionsForRoleRequest) returns (DeletePermissionsForRoleResponse) { + option (google.api.http) = { + delete: "/roles/delete/permissions" + }; + } + + // Deletes roles with their permissions, requires login beforehand. + // Requires highest permissions. + rpc DeleteRoles(DeleteRolesRequest) returns (DeleteRolesResponse) { + option (google.api.http) = { + delete: "/roles/delete" + }; + } +} + +message Role { + string id = 1; + string name = 2; + string description = 3; + repeated string permissions = 4; +} + +// CreateRoles +message CreateRolesRequest { + int64 timestamp = 1; + repeated Role roles = 2; +} + +message CreateRolesResponse { + int64 timestamp = 1; + Status status = 2; +} + +// GetRole +message GetRoleRequest { + int64 timestamp = 1; + string role_name = 2; +} + +message GetRoleResponse { + int64 timestamp = 1; + Status status = 2; + Role role = 3; +} + +// GetRoles +message GetRolesRequest { + int64 timestamp = 1; +} + +message GetRolesResponse { + int64 timestamp = 1; + Status status = 2; + repeated Role roles = 3; +} + +// UpdateRoles +message UpdateRolesRequest { + int64 timestamp = 1; + repeated Role roles = 2; +} + +message UpdateRolesResponse { + int64 timestamp = 1; + Status status = 2; +} + +// DeletePermissionsForRole +message DeletePermissionsForRoleRequest { + int64 timestamp = 1; + string role_name = 2; + repeated string permissions_to_delete = 3; +} + +message DeletePermissionsForRoleResponse { + int64 timestamp = 1; + Status status = 2; +} + +// DeleteRoles +message DeleteRolesRequest { + int64 timestamp = 1; + repeated string role_name = 2; +} + +message DeleteRolesResponse { + int64 timestamp = 1; + Status status = 2; +} diff --git a/api/proto/gosdn/rbac/user.proto b/api/proto/gosdn/rbac/user.proto new file mode 100644 index 0000000000000000000000000000000000000000..3ad7f88de24cb5a0adbc5504c335c9d0f215f6e6 --- /dev/null +++ b/api/proto/gosdn/rbac/user.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; + +package gosdn.rbac; + +import "google/api/annotations.proto"; +import "google/protobuf/descriptor.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "gosdn/rbac/rbac.proto"; + +option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac"; + +service UserService { + // Create users with the provided parameters, creation of multiple users requires login beforehand. + // Highest possible permissions of new users is of current permission level. + // If not logged in: Created user has lowest possible permissions, only one user can be created this way. + rpc CreateUsers(CreateUsersRequest) returns (CreateUsersResponse) { + option (google.api.http) = { + post: "/users/create" + body: "*" + }; + } + + // Requests information about one user, requires login beforehand.option + rpc GetUser (GetUserRequest) returns (GetUserResponse) { + option (google.api.http) = { + get: "/users/get" + }; + } + + // Requests information about available users, requires login beforehand. + // Requires highest possible permissions. + rpc GetUsers (GetUsersRequest) returns (GetUsersResponse) { + option (google.api.http) = { + get: "/users" + }; + } + + // Updates users with the provided parameters, requires login beforehand. + // Requires highest permissions to change other users, everyone else can only update their own account. + // Requires highest permissions to change multiple users at the same time. + rpc UpdateUsers (UpdateUsersRequest) returns (UpdateUsersResponse) { + option (google.api.http) = { + post: "/users/update" + body: "*" + }; + } + + // Deletes users, requires login beforehand. + // Requires highest permissions. + rpc DeleteUsers(DeleteUsersRequest) returns (DeleteUsersResponse) { + option (google.api.http) = { + delete: "/users/delete" + }; + } +} + +message User { + string id = 1; + string name = 2; + map<string, string> roles = 3; // Key = pnd uuid, value= role name + string password = 4; + string token = 5; +} + +// CreateUsers +message CreateUsersRequest { + int64 timestamp = 1; + repeated User user = 2; +} + +message CreateUsersResponse { + int64 timestamp = 1; + Status status = 2; +} + +// GetUser +message GetUserRequest { + int64 timestamp = 1; + string name = 2; +} + +message GetUserResponse { + int64 timestamp = 1; + Status status = 2; + User user = 3; +} + +// GetUsers +message GetUsersRequest { + int64 timestamp = 1; +} + +message GetUsersResponse { + int64 timestamp = 1; + Status status = 2; + repeated User user = 3; +} + +// UpdateUsers +message UpdateUsersRequest { + int64 timestamp = 1; + repeated User user = 2; +} + +message UpdateUsersResponse { + int64 timestamp = 1; + Status status = 2; +} + +// DeleteUsers +message DeleteUsersRequest { + int64 timestamp = 1; + repeated string username = 2; +} + +message DeleteUsersResponse { + int64 timestamp = 1; + Status status = 2; +} diff --git a/controller/api/auth.go b/controller/api/auth.go new file mode 100644 index 0000000000000000000000000000000000000000..02d1331d9706ce257182946a2c5b22a1157c3627 --- /dev/null +++ b/controller/api/auth.go @@ -0,0 +1,38 @@ +package api + +import ( + "context" + "time" + + apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" +) + +// Login logs a user in +func Login(ctx context.Context, addr, username, pwd string) (*apb.LoginResponse, error) { + authClient, err := nbi.AuthClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.LoginRequest{ + Timestamp: time.Now().UnixNano(), + Username: username, + Pwd: pwd, + } + return authClient.Login(ctx, r) +} + +// Logout logs a user out +func Logout(ctx context.Context, addr, username string) (*apb.LogoutResponse, error) { + authClient, err := nbi.AuthClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.LogoutRequest{ + Timestamp: time.Now().UnixNano(), + Username: username, + } + return authClient.Logout(ctx, r) +} diff --git a/controller/api/change.go b/controller/api/change.go new file mode 100644 index 0000000000000000000000000000000000000000..e469db6c1f584bd139d9f6127b70af7aa74abd39 --- /dev/null +++ b/controller/api/change.go @@ -0,0 +1,91 @@ +package api + +import ( + "context" + "time" + + ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" +) + +// GetChanges requests all pending and unconfirmed changes from the controller +func GetChanges(ctx context.Context, addr, pnd string) (*ppb.GetChangeListResponse, error) { + client, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + req := &ppb.GetChangeListRequest{ + Timestamp: time.Now().UnixNano(), + Pid: pnd, + } + return client.GetChangeList(ctx, req) +} + +// Commit sends a Commit request for one or multiple changes to the +// controller. +func Commit(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetChangeListResponse, error) { + changes := make([]*ppb.SetChange, len(cuids)) + for i, arg := range cuids { + changes[i] = &ppb.SetChange{ + Cuid: arg, + Op: ppb.Operation_OPERATION_COMMIT, + } + } + return CommitConfirm(ctx, addr, pnd, changes) +} + +// Confirm sends a Confirm request for one or multiple changes to the +// controller +func Confirm(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetChangeListResponse, error) { + changes := make([]*ppb.SetChange, len(cuids)) + for i, arg := range cuids { + changes[i] = &ppb.SetChange{ + Cuid: arg, + Op: ppb.Operation_OPERATION_CONFIRM, + } + } + return CommitConfirm(ctx, addr, pnd, changes) +} + +// CommitConfirm confirms a commit +func CommitConfirm(ctx context.Context, addr, pnd string, changes []*ppb.SetChange) (*ppb.SetChangeListResponse, error) { + client, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + req := &ppb.SetChangeListRequest{ + Timestamp: time.Now().UnixNano(), + Change: changes, + Pid: pnd, + } + return client.SetChangeList(ctx, req) +} + +// ChangeRequest change creates a ChangeRequest for the specified OND. ApiOperations are +// used to specify the type of the change (update, replace, delete as specified +// in https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#34-modifying-state) +// For delete operations the value field needs to contain an empty string. +func ChangeRequest(ctx context.Context, addr, did, pid, path, value string, op ppb.ApiOperation) (*ppb.SetPathListResponse, error) { + req := &ppb.ChangeRequest{ + Did: did, + Path: path, + Value: value, + ApiOp: op, + } + return SendChangeRequest(ctx, addr, pid, req) +} + +// SendChangeRequest sends a change request +func SendChangeRequest(ctx context.Context, addr, pid string, req *ppb.ChangeRequest) (*ppb.SetPathListResponse, error) { + pndClient, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &ppb.SetPathListRequest{ + Timestamp: time.Now().UnixNano(), + ChangeRequest: []*ppb.ChangeRequest{req}, + Pid: pid, + } + return pndClient.SetPathList(ctx, r) +} diff --git a/controller/api/device.go b/controller/api/device.go new file mode 100644 index 0000000000000000000000000000000000000000..b8c6a00141d54df49b6db447e549f18fa782e8b2 --- /dev/null +++ b/controller/api/device.go @@ -0,0 +1,164 @@ +package api + +import ( + "context" + "io" + "time" + + ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" + spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" + tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" + + "github.com/google/uuid" + "github.com/openconfig/goyang/pkg/yang" + "github.com/openconfig/ygot/ygot" + log "github.com/sirupsen/logrus" +) + +// AddDevice adds a new device to the controller. The device name is optional. +// If no name is provided a name will be generated upon device creation. +func AddDevice(ctx context.Context, addr, deviceName string, opt *tpb.TransportOption, sid, pid uuid.UUID) (*ppb.SetOndListResponse, error) { + pndClient, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &ppb.SetOndListRequest{ + Timestamp: time.Now().UnixNano(), + Ond: []*ppb.SetOnd{ + { + Address: opt.GetAddress(), + Sbi: &spb.SouthboundInterface{ + Id: sid.String(), + }, + DeviceName: deviceName, + TransportOption: opt, + }, + }, + Pid: pid.String(), + } + switch t := opt.Type; t { + case spb.Type_TYPE_CONTAINERISED, spb.Type_TYPE_PLUGIN: + req.Ond[0].Sbi.Id = uuid.Nil.String() + req.Ond[0].Sbi.Type = t + req.Ond[0].TransportOption.Type = t + default: + } + + return pndClient.SetOndList(ctx, req) +} + +// GetDevice requests one device belonging to a given +// PrincipalNetworkDomain from the controller. If no device identifier +// is provided, an error is thrown. +func GetDevice(ctx context.Context, addr, pid string, did ...string) (*ppb.GetOndResponse, error) { + pndClient, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + if len(did) == 0 { + return nil, err + } + + req := &ppb.GetOndRequest{ + Timestamp: time.Now().UnixNano(), + Did: did, + Pid: pid, + } + + return pndClient.GetOnd(ctx, req) +} + +// GetSbiSchemaTree gets the sbi tree for a sbi +func GetSbiSchemaTree(ctx context.Context, addr string, pid, sid uuid.UUID) (map[string]*yang.Entry, error) { + sbiClient, err := nbi.SbiClient(addr, dialOptions...) + if err != nil { + return map[string]*yang.Entry{}, err + } + + req := &spb.GetSchemaRequest{ + Timestamp: time.Now().UnixNano(), + Pid: pid.String(), + Sid: sid.String(), + } + + ctx, cancel := context.WithTimeout(ctx, time.Minute*10) + defer cancel() + sClient, err := sbiClient.GetSchema(ctx, req) + if err != nil { + return map[string]*yang.Entry{}, err + } + + sTreeBytes := []byte{} + + for { + payload, err := sClient.Recv() + if err != nil { + if err == io.EOF { + break + } + log.Error(err) + sClient.CloseSend() + return map[string]*yang.Entry{}, err + } + sTreeBytes = append(sTreeBytes, payload.Chunk...) + } + + sTreeMap, err := ygot.GzipToSchema(sTreeBytes) + if err != nil { + return map[string]*yang.Entry{}, err + } + + return sTreeMap, nil +} + +// GetDevices requests all devices belonging to a given +// PrincipalNetworkDomain from the controller. +func GetDevices(ctx context.Context, addr, pid string) (*ppb.GetOndListResponse, error) { + pndClient, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &ppb.GetOndListRequest{ + Timestamp: time.Now().UnixNano(), + Pid: pid, + } + + return pndClient.GetOndList(ctx, req) +} + +// GetPath requests a specific path +func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResponse, error) { + pndClient, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &ppb.GetPathRequest{ + Timestamp: time.Now().UnixNano(), + Did: did, + Pid: pid, + Path: path, + } + + return pndClient.GetPath(ctx, req) +} + +// DeleteDevice deletes a device +func DeleteDevice(ctx context.Context, addr, pid, did string) (*ppb.DeleteOndResponse, error) { + pndClient, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &ppb.DeleteOndRequest{ + Timestamp: time.Now().UnixNano(), + Did: did, + Pid: pid, + } + + return pndClient.DeleteOnd(ctx, req) +} diff --git a/controller/api/grpc.go b/controller/api/grpc.go index dc1105b5f15d05b24d515c376f9433b9a12976d0..b4927635df7e0a7c081c7b5b0b051ee6e222fac8 100644 --- a/controller/api/grpc.go +++ b/controller/api/grpc.go @@ -2,19 +2,11 @@ package api import ( "context" - "errors" - "io" "time" pb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/core" ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" - apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" - spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" - tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" - "github.com/google/uuid" - "github.com/openconfig/goyang/pkg/yang" - "github.com/openconfig/ygot/ygot" log "github.com/sirupsen/logrus" "github.com/spf13/viper" @@ -66,526 +58,3 @@ func GetAllCore(ctx context.Context, addr string) (*pb.GetPndListResponse, error } return coreClient.GetPndList(ctx, req) } - -// AddPnd takes a name, description and SBI UUID to create a new -// PrincipalNetworkDomain on the controller -func AddPnd(ctx context.Context, addr, name, description, sbi string) (*pb.CreatePndListResponse, error) { - coreClient, err := nbi.CoreClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &pb.CreatePndListRequest{ - Timestamp: time.Now().UnixNano(), - Pnd: []*pb.PndCreateProperties{ - { - Name: name, - Description: description, - Sbi: sbi, - }, - }, - } - - return coreClient.CreatePndList(ctx, req) -} - -// GetPnd requests one PrincipalNetworkDomain from the -// controller. -func GetPnd(ctx context.Context, addr string, args ...string) (*pb.GetPndResponse, error) { - coreClient, err := nbi.CoreClient(addr, dialOptions...) - if err != nil { - return nil, err - } - if len(args) <= 0 { - return nil, errors.New("not enough arguments") - } - - req := &pb.GetPndRequest{ - Timestamp: time.Now().UnixNano(), - Pid: args, - } - return coreClient.GetPnd(ctx, req) -} - -// GetPnds requests all PrincipalNetworkDomains from the -// controller. -func GetPnds(ctx context.Context, addr string, args ...string) (*pb.GetPndListResponse, error) { - coreClient, err := nbi.CoreClient(addr, dialOptions...) - if err != nil { - return nil, err - } - if len(args) <= 0 { - return nil, errors.New("not enough arguments") - } - - req := &pb.GetPndListRequest{ - Timestamp: time.Now().UnixNano(), - } - return coreClient.GetPndList(ctx, req) -} - -// DeletePnd requests a deletion of the provided PND. -func DeletePnd(ctx context.Context, addr string, pid string) (*pb.DeletePndResponse, error) { - coreClient, err := nbi.CoreClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &pb.DeletePndRequest{ - Timestamp: time.Now().UnixNano(), - Pid: pid, - } - return coreClient.DeletePnd(ctx, req) -} - -// GetSbi requests one or more to the provided PND belonging SBIs from the -// controller. -func GetSbi(ctx context.Context, addr string, pid string, sid ...string) (*ppb.GetSbiResponse, error) { - client, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &ppb.GetSbiRequest{ - Timestamp: time.Now().UnixNano(), - Pid: pid, - Sid: sid, - } - return client.GetSbi(ctx, req) -} - -//GetSBIs requests all to the provided PND belonging SBIs from the controller. -func GetSBIs(ctx context.Context, addr string, pid string) (*ppb.GetSbiListResponse, error) { - client, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &ppb.GetSbiListRequest{ - Timestamp: time.Now().UnixNano(), - Pid: pid, - } - return client.GetSbiList(ctx, req) -} - -// GetChanges requests all pending and unconfirmed changes from the controller -func GetChanges(ctx context.Context, addr, pnd string) (*ppb.GetChangeListResponse, error) { - client, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - req := &ppb.GetChangeListRequest{ - Timestamp: time.Now().UnixNano(), - Pid: pnd, - } - return client.GetChangeList(ctx, req) -} - -// Commit sends a Commit request for one or multiple changes to the -// controller. -func Commit(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetChangeListResponse, error) { - changes := make([]*ppb.SetChange, len(cuids)) - for i, arg := range cuids { - changes[i] = &ppb.SetChange{ - Cuid: arg, - Op: ppb.Operation_OPERATION_COMMIT, - } - } - return CommitConfirm(ctx, addr, pnd, changes) -} - -// Confirm sends a Confirm request for one or multiple changes to the -// controller -func Confirm(ctx context.Context, addr, pnd string, cuids ...string) (*ppb.SetChangeListResponse, error) { - changes := make([]*ppb.SetChange, len(cuids)) - for i, arg := range cuids { - changes[i] = &ppb.SetChange{ - Cuid: arg, - Op: ppb.Operation_OPERATION_CONFIRM, - } - } - return CommitConfirm(ctx, addr, pnd, changes) -} - -// CommitConfirm confirms a commit -func CommitConfirm(ctx context.Context, addr, pnd string, changes []*ppb.SetChange) (*ppb.SetChangeListResponse, error) { - client, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - req := &ppb.SetChangeListRequest{ - Timestamp: time.Now().UnixNano(), - Change: changes, - Pid: pnd, - } - return client.SetChangeList(ctx, req) -} - -// AddDevice adds a new device to the controller. The device name is optional. -// If no name is provided a name will be generated upon device creation. -func AddDevice(ctx context.Context, addr, deviceName string, opt *tpb.TransportOption, sid, pid uuid.UUID) (*ppb.SetOndListResponse, error) { - pndClient, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &ppb.SetOndListRequest{ - Timestamp: time.Now().UnixNano(), - Ond: []*ppb.SetOnd{ - { - Address: opt.GetAddress(), - Sbi: &spb.SouthboundInterface{ - Id: sid.String(), - }, - DeviceName: deviceName, - TransportOption: opt, - }, - }, - Pid: pid.String(), - } - switch t := opt.Type; t { - case spb.Type_TYPE_CONTAINERISED, spb.Type_TYPE_PLUGIN: - req.Ond[0].Sbi.Id = uuid.Nil.String() - req.Ond[0].Sbi.Type = t - req.Ond[0].TransportOption.Type = t - default: - } - - return pndClient.SetOndList(ctx, req) -} - -// GetDevice requests one device belonging to a given -// PrincipalNetworkDomain from the controller. If no device identifier -// is provided, an error is thrown. -func GetDevice(ctx context.Context, addr, pid string, did ...string) (*ppb.GetOndResponse, error) { - pndClient, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - if len(did) == 0 { - return nil, err - } - - req := &ppb.GetOndRequest{ - Timestamp: time.Now().UnixNano(), - Did: did, - Pid: pid, - } - - return pndClient.GetOnd(ctx, req) -} - -// GetSbiSchemaTree gets the sbi tree for a sbi -func GetSbiSchemaTree(ctx context.Context, addr string, pid, sid uuid.UUID) (map[string]*yang.Entry, error) { - sbiClient, err := nbi.SbiClient(addr, dialOptions...) - if err != nil { - return map[string]*yang.Entry{}, err - } - - req := &spb.GetSchemaRequest{ - Timestamp: time.Now().UnixNano(), - Pid: pid.String(), - Sid: sid.String(), - } - - ctx, cancel := context.WithTimeout(ctx, time.Minute*10) - defer cancel() - sClient, err := sbiClient.GetSchema(ctx, req) - if err != nil { - return map[string]*yang.Entry{}, err - } - - sTreeBytes := []byte{} - - for { - payload, err := sClient.Recv() - if err != nil { - if err == io.EOF { - break - } - log.Error(err) - sClient.CloseSend() - return map[string]*yang.Entry{}, err - } - sTreeBytes = append(sTreeBytes, payload.Chunk...) - } - - sTreeMap, err := ygot.GzipToSchema(sTreeBytes) - if err != nil { - return map[string]*yang.Entry{}, err - } - - return sTreeMap, nil -} - -// GetDevices requests all devices belonging to a given -// PrincipalNetworkDomain from the controller. -func GetDevices(ctx context.Context, addr, pid string) (*ppb.GetOndListResponse, error) { - pndClient, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &ppb.GetOndListRequest{ - Timestamp: time.Now().UnixNano(), - Pid: pid, - } - - return pndClient.GetOndList(ctx, req) -} - -// GetPath requests a specific path -func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResponse, error) { - pndClient, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &ppb.GetPathRequest{ - Timestamp: time.Now().UnixNano(), - Did: did, - Pid: pid, - Path: path, - } - - return pndClient.GetPath(ctx, req) -} - -// DeleteDevice deletes a device -func DeleteDevice(ctx context.Context, addr, pid, did string) (*ppb.DeleteOndResponse, error) { - pndClient, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - req := &ppb.DeleteOndRequest{ - Timestamp: time.Now().UnixNano(), - Did: did, - Pid: pid, - } - - return pndClient.DeleteOnd(ctx, req) -} - -// ChangeRequest change creates a ChangeRequest for the specified OND. ApiOperations are -// used to specify the type of the change (update, replace, delete as specified -// in https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#34-modifying-state) -// For delete operations the value field needs to contain an empty string. -func ChangeRequest(ctx context.Context, addr, did, pid, path, value string, op ppb.ApiOperation) (*ppb.SetPathListResponse, error) { - req := &ppb.ChangeRequest{ - Did: did, - Path: path, - Value: value, - ApiOp: op, - } - return SendChangeRequest(ctx, addr, pid, req) -} - -// SendChangeRequest sends a change request -func SendChangeRequest(ctx context.Context, addr, pid string, req *ppb.ChangeRequest) (*ppb.SetPathListResponse, error) { - pndClient, err := nbi.PndClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &ppb.SetPathListRequest{ - Timestamp: time.Now().UnixNano(), - ChangeRequest: []*ppb.ChangeRequest{req}, - Pid: pid, - } - return pndClient.SetPathList(ctx, r) -} - -// Login logs a user in -func Login(ctx context.Context, addr, username, pwd string) (*apb.LoginResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.LoginRequest{ - Timestamp: time.Now().UnixNano(), - Username: username, - Pwd: pwd, - } - return authClient.Login(ctx, r) -} - -// Logout logs a user out -func Logout(ctx context.Context, addr, username string) (*apb.LogoutResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.LogoutRequest{ - Timestamp: time.Now().UnixNano(), - Username: username, - } - return authClient.Logout(ctx, r) -} - -// CreateUsers creates users with provided data -func CreateUsers(ctx context.Context, addr string, users []*apb.User) (*apb.CreateUsersResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.CreateUsersRequest{ - Timestamp: time.Now().UnixNano(), - User: users, - } - - return authClient.CreateUsers(ctx, r) -} - -//GetUser returns one requested user found by name -func GetUser(ctx context.Context, addr, name string) (*apb.GetUserResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.GetUserRequest{ - Timestamp: time.Now().UnixNano(), - Name: name, - } - - return authClient.GetUser(ctx, r) -} - -// GetAllUsers return all the available users -func GetAllUsers(ctx context.Context, addr string) (*apb.GetUsersResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.GetUsersRequest{ - Timestamp: time.Now().UnixNano(), - } - - return authClient.GetUsers(ctx, r) -} - -// UpdateUsers updates all provided users -func UpdateUsers(ctx context.Context, addr string, users []*apb.User) (*apb.UpdateUsersResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.UpdateUsersRequest{ - Timestamp: time.Now().UnixNano(), - User: users, - } - - return authClient.UpdateUsers(ctx, r) -} - -// DeleteUsers deletes all provided users -func DeleteUsers(ctx context.Context, addr string, userNames []string) (*apb.DeleteUsersResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.DeleteUsersRequest{ - Timestamp: time.Now().UnixNano(), - Username: userNames, - } - - return authClient.DeleteUsers(ctx, r) -} - -// CreateRoles creates roles with provided data -func CreateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.CreateRolesResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.CreateRolesRequest{ - Timestamp: time.Now().UnixNano(), - Roles: roles, - } - - return authClient.CreateRoles(ctx, r) -} - -// GetRole returns one requested role found by name -func GetRole(ctx context.Context, addr, name string) (*apb.GetRoleResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.GetRoleRequest{ - Timestamp: time.Now().UnixNano(), - RoleName: name, - } - - return authClient.GetRole(ctx, r) -} - -// GetRoles returns all available roles -func GetRoles(ctx context.Context, addr string) (*apb.GetRolesResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.GetRolesRequest{ - Timestamp: time.Now().UnixNano(), - } - - return authClient.GetRoles(ctx, r) -} - -// UpdateRoles updates the procided roles -func UpdateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.UpdateRolesResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.UpdateRolesRequest{ - Timestamp: time.Now().UnixNano(), - Roles: roles, - } - - return authClient.UpdateRoles(ctx, r) -} - -// DeletePermissionForRole deletes the provided permissions from one role found by name -func DeletePermissionForRole(ctx context.Context, addr, name string, permissionsToDelete []string) (*apb.DeletePermissionsForRoleResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.DeletePermissionsForRoleRequest{ - Timestamp: time.Now().UnixNano(), - RoleName: name, - PermissionsToDelete: permissionsToDelete, - } - - return authClient.DeletePermissionsForRole(ctx, r) -} - -// DeleteRoles deletes all the provided roles with their permissions -func DeleteRoles(ctx context.Context, addr string, roleName []string) (*apb.DeleteRolesResponse, error) { - authClient, err := nbi.AuthClient(addr, dialOptions...) - if err != nil { - return nil, err - } - - r := &apb.DeleteRolesRequest{ - Timestamp: time.Now().UnixNano(), - RoleName: roleName, - } - - return authClient.DeleteRoles(ctx, r) -} diff --git a/controller/api/pnd.go b/controller/api/pnd.go new file mode 100644 index 0000000000000000000000000000000000000000..791ebefc6d425580547364ff7ee28509100938d2 --- /dev/null +++ b/controller/api/pnd.go @@ -0,0 +1,81 @@ +package api + +import ( + "context" + "errors" + "time" + + pb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/core" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" +) + +// AddPnd takes a name, description and SBI UUID to create a new +// PrincipalNetworkDomain on the controller +func AddPnd(ctx context.Context, addr, name, description, sbi string) (*pb.CreatePndListResponse, error) { + coreClient, err := nbi.CoreClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &pb.CreatePndListRequest{ + Timestamp: time.Now().UnixNano(), + Pnd: []*pb.PndCreateProperties{ + { + Name: name, + Description: description, + Sbi: sbi, + }, + }, + } + + return coreClient.CreatePndList(ctx, req) +} + +// GetPnd requests one PrincipalNetworkDomain from the +// controller. +func GetPnd(ctx context.Context, addr string, args ...string) (*pb.GetPndResponse, error) { + coreClient, err := nbi.CoreClient(addr, dialOptions...) + if err != nil { + return nil, err + } + if len(args) <= 0 { + return nil, errors.New("not enough arguments") + } + + req := &pb.GetPndRequest{ + Timestamp: time.Now().UnixNano(), + Pid: args, + } + return coreClient.GetPnd(ctx, req) +} + +// GetPnds requests all PrincipalNetworkDomains from the +// controller. +func GetPnds(ctx context.Context, addr string, args ...string) (*pb.GetPndListResponse, error) { + coreClient, err := nbi.CoreClient(addr, dialOptions...) + if err != nil { + return nil, err + } + if len(args) <= 0 { + return nil, errors.New("not enough arguments") + } + + req := &pb.GetPndListRequest{ + Timestamp: time.Now().UnixNano(), + } + return coreClient.GetPndList(ctx, req) +} + +// DeletePnd requests a deletion of the provided PND. +func DeletePnd(ctx context.Context, addr string, pid string) (*pb.DeletePndResponse, error) { + coreClient, err := nbi.CoreClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &pb.DeletePndRequest{ + Timestamp: time.Now().UnixNano(), + Pid: pid, + } + return coreClient.DeletePnd(ctx, req) +} diff --git a/controller/api/roles.go b/controller/api/roles.go new file mode 100644 index 0000000000000000000000000000000000000000..b9d6bcc5c66186db408cf6c974a1bfab101d0769 --- /dev/null +++ b/controller/api/roles.go @@ -0,0 +1,99 @@ +package api + +import ( + "context" + "time" + + apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" +) + +// CreateRoles creates roles with provided data +func CreateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.CreateRolesResponse, error) { + roleClient, err := nbi.RoleClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.CreateRolesRequest{ + Timestamp: time.Now().UnixNano(), + Roles: roles, + } + + return roleClient.CreateRoles(ctx, r) +} + +// GetRole returns one requested role found by name +func GetRole(ctx context.Context, addr, name string) (*apb.GetRoleResponse, error) { + roleClient, err := nbi.RoleClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.GetRoleRequest{ + Timestamp: time.Now().UnixNano(), + RoleName: name, + } + + return roleClient.GetRole(ctx, r) +} + +// GetRoles returns all available roles +func GetRoles(ctx context.Context, addr string) (*apb.GetRolesResponse, error) { + roleClient, err := nbi.RoleClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.GetRolesRequest{ + Timestamp: time.Now().UnixNano(), + } + + return roleClient.GetRoles(ctx, r) +} + +// UpdateRoles updates the procided roles +func UpdateRoles(ctx context.Context, addr string, roles []*apb.Role) (*apb.UpdateRolesResponse, error) { + roleClient, err := nbi.RoleClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.UpdateRolesRequest{ + Timestamp: time.Now().UnixNano(), + Roles: roles, + } + + return roleClient.UpdateRoles(ctx, r) +} + +// DeletePermissionForRole deletes the provided permissions from one role found by name +func DeletePermissionForRole(ctx context.Context, addr, name string, permissionsToDelete []string) (*apb.DeletePermissionsForRoleResponse, error) { + roleClient, err := nbi.RoleClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.DeletePermissionsForRoleRequest{ + Timestamp: time.Now().UnixNano(), + RoleName: name, + PermissionsToDelete: permissionsToDelete, + } + + return roleClient.DeletePermissionsForRole(ctx, r) +} + +// DeleteRoles deletes all the provided roles with their permissions +func DeleteRoles(ctx context.Context, addr string, roleName []string) (*apb.DeleteRolesResponse, error) { + roleClient, err := nbi.RoleClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.DeleteRolesRequest{ + Timestamp: time.Now().UnixNano(), + RoleName: roleName, + } + + return roleClient.DeleteRoles(ctx, r) +} diff --git a/controller/api/sbi.go b/controller/api/sbi.go new file mode 100644 index 0000000000000000000000000000000000000000..30de02ab087ea5c0698a80d96eaeb76505d26b6f --- /dev/null +++ b/controller/api/sbi.go @@ -0,0 +1,39 @@ +package api + +import ( + "context" + "time" + + ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" +) + +// GetSbi requests one or more to the provided PND belonging SBIs from the +// controller. +func GetSbi(ctx context.Context, addr string, pid string, sid ...string) (*ppb.GetSbiResponse, error) { + client, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &ppb.GetSbiRequest{ + Timestamp: time.Now().UnixNano(), + Pid: pid, + Sid: sid, + } + return client.GetSbi(ctx, req) +} + +//GetSBIs requests all to the provided PND belonging SBIs from the controller. +func GetSBIs(ctx context.Context, addr string, pid string) (*ppb.GetSbiListResponse, error) { + client, err := nbi.PndClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &ppb.GetSbiListRequest{ + Timestamp: time.Now().UnixNano(), + Pid: pid, + } + return client.GetSbiList(ctx, req) +} diff --git a/controller/api/users.go b/controller/api/users.go new file mode 100644 index 0000000000000000000000000000000000000000..31d6828607c38c994dabde2e12fd2d4e7e9bfb54 --- /dev/null +++ b/controller/api/users.go @@ -0,0 +1,83 @@ +package api + +import ( + "context" + "time" + + apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" + nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client" +) + +// CreateUsers creates users with provided data +func CreateUsers(ctx context.Context, addr string, users []*apb.User) (*apb.CreateUsersResponse, error) { + userClient, err := nbi.UserClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.CreateUsersRequest{ + Timestamp: time.Now().UnixNano(), + User: users, + } + + return userClient.CreateUsers(ctx, r) +} + +//GetUser returns one requested user found by name +func GetUser(ctx context.Context, addr, name string) (*apb.GetUserResponse, error) { + userClient, err := nbi.UserClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.GetUserRequest{ + Timestamp: time.Now().UnixNano(), + Name: name, + } + + return userClient.GetUser(ctx, r) +} + +// GetAllUsers return all the available users +func GetAllUsers(ctx context.Context, addr string) (*apb.GetUsersResponse, error) { + userClient, err := nbi.UserClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.GetUsersRequest{ + Timestamp: time.Now().UnixNano(), + } + + return userClient.GetUsers(ctx, r) +} + +// UpdateUsers updates all provided users +func UpdateUsers(ctx context.Context, addr string, users []*apb.User) (*apb.UpdateUsersResponse, error) { + userClient, err := nbi.UserClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.UpdateUsersRequest{ + Timestamp: time.Now().UnixNano(), + User: users, + } + + return userClient.UpdateUsers(ctx, r) +} + +// DeleteUsers deletes all provided users +func DeleteUsers(ctx context.Context, addr string, userNames []string) (*apb.DeleteUsersResponse, error) { + userClient, err := nbi.UserClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + r := &apb.DeleteUsersRequest{ + Timestamp: time.Now().UnixNano(), + Username: userNames, + } + + return userClient.DeleteUsers(ctx, r) +} diff --git a/controller/controller.go b/controller/controller.go index 93cd300d09e1143a9d9acdc2f135618a142a8802..c46fa5d742267771c22850567c30db83cd711186 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -103,12 +103,12 @@ func initialize() error { } func startGrpc() error { - sock := viper.GetString("socket") - lis, err := net.Listen("tcp", sock) + socket := viper.GetString("socket") + lislisten, err := net.Listen("tcp", socket) if err != nil { return err } - log.Infof("listening to %v", lis.Addr()) + log.Infof("listening to %v", lislisten.Addr()) jwtManager := rbacImpl.NewJWTManager("", (10000 * time.Hour)) //TODO(faseid): add real secret and proper duration data here! setupGRPCServerWithCorrectSecurityLevel(jwtManager) @@ -121,8 +121,10 @@ func startGrpc() error { cpb.RegisterCsbiServiceServer(c.grpcServer, c.nbi.Csbi) spb.RegisterSbiServiceServer(c.grpcServer, c.nbi.Sbi) apb.RegisterAuthServiceServer(c.grpcServer, c.nbi.Auth) + apb.RegisterUserServiceServer(c.grpcServer, c.nbi.User) + apb.RegisterRoleServiceServer(c.grpcServer, c.nbi.Role) go func() { - if err := c.grpcServer.Serve(lis); err != nil { + if err := c.grpcServer.Serve(lislisten); err != nil { log.Fatal(err) } }() diff --git a/controller/http.go b/controller/http.go index 041163c5e98d00c4829c38466ce57c48c36744ed..58d6d47d6486cecbe55e1858951fdfc7e622a164 100644 --- a/controller/http.go +++ b/controller/http.go @@ -65,6 +65,16 @@ func run() error { return err } + err = agw.RegisterUserServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts) + if err != nil { + return err + } + + err = agw.RegisterRoleServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts) + if err != nil { + return err + } + // Set the HTTP server of core to the new server c.httpServer = &http.Server{Addr: ":8080", Handler: mux} // Start HTTP server (and proxy calls to gRPC server endpoint) diff --git a/controller/northbound/client/rbac.go b/controller/northbound/client/rbac.go index 0d0e0889916e87094c76dbc93338ddf339ac45c1..d6b6c1eaa039663c0b2497d4c9efe73b52740d7f 100644 --- a/controller/northbound/client/rbac.go +++ b/controller/northbound/client/rbac.go @@ -15,3 +15,25 @@ func AuthClient(addr string, opts ...grpc.DialOption) (apb.AuthServiceClient, er } return apb.NewAuthServiceClient(conn), nil } + +// UserClient returns a client for the gRPC User service. It takes +// the address of the gRPC endpoint and optional grpc.DialOption +// as argument +func UserClient(addr string, opts ...grpc.DialOption) (apb.UserServiceClient, error) { + conn, err := grpc.Dial(addr, opts...) + if err != nil { + return nil, err + } + return apb.NewUserServiceClient(conn), nil +} + +// RoleClient returns a client for the gRPC Role service. It takes +// the address of the gRPC endpoint and optional grpc.DialOption +// as argument +func RoleClient(addr string, opts ...grpc.DialOption) (apb.RoleServiceClient, error) { + conn, err := grpc.Dial(addr, opts...) + if err != nil { + return nil, err + } + return apb.NewRoleServiceClient(conn), nil +} diff --git a/controller/northbound/server/nbi.go b/controller/northbound/server/nbi.go index 35fa92ab2fe6824bc653ba99c1e625238cf2c36a..8df59768e116c8aab2354afee7c254d0d4bac4cc 100644 --- a/controller/northbound/server/nbi.go +++ b/controller/northbound/server/nbi.go @@ -22,6 +22,8 @@ type NorthboundInterface struct { Csbi *csbi Sbi *sbiServer Auth *Auth + User *User + Role *Role } // NewNBI receives a PndStore and returns a new gRPC *NorthboundInterface @@ -35,6 +37,8 @@ func NewNBI(pnds networkdomain.PndStore, users rbac.UserService, roles rbac.Role Csbi: &csbi{}, Sbi: &sbiServer{}, Auth: &Auth{}, + User: &User{}, + Role: &Role{}, } } diff --git a/controller/northbound/server/role.go b/controller/northbound/server/role.go new file mode 100644 index 0000000000000000000000000000000000000000..df2f3a0f8cabeff03c62ab29171963bd8f038510 --- /dev/null +++ b/controller/northbound/server/role.go @@ -0,0 +1,201 @@ +package server + +import ( + "context" + "time" + + apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" + "code.fbi.h-da.de/danet/gosdn/controller/metrics" + "code.fbi.h-da.de/danet/gosdn/controller/rbac" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Role holds a JWTManager and represents a RoleServiceServer. +type Role struct { + apb.UnimplementedRoleServiceServer + jwtManager *rbac.JWTManager +} + +// NewRoleServer receives a JWTManager and returns a new Role. +func NewRoleServer(jwtManager *rbac.JWTManager) *Role { + return &Role{ + jwtManager: jwtManager, + } +} + +// CreateRoles creates one are multiple new roles. +func (r Role) CreateRoles(ctx context.Context, request *apb.CreateRolesRequest) (*apb.CreateRolesResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "post"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + for _, r := range request.Roles { + role := rbac.NewRole(uuid.New(), r.Name, r.Description, r.Permissions) + + err := rolec.Add(role) + if err != nil { + log.Error(err) + return nil, status.Errorf(codes.Aborted, "%v", err) + } + } + + return &apb.CreateRolesResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} + +// GetRole returns one role with its permissions found by name. +func (r Role) GetRole(ctx context.Context, request *apb.GetRoleRequest) (*apb.GetRoleResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "get"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + roleData, err := rolec.Get(store.Query{Name: request.RoleName}) + if err != nil { + return nil, err + } + + role := &apb.Role{ + Id: roleData.ID().String(), + Name: roleData.Name(), + Description: roleData.GetDescription(), + Permissions: roleData.GetPermissions(), + } + + return &apb.GetRoleResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + Role: role, + }, nil +} + +// GetRoles returns all roles with their permissions. +func (r Role) GetRoles(ctx context.Context, request *apb.GetRolesRequest) (*apb.GetRolesResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "get"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + roleList, err := rolec.GetAll() + if err != nil { + return nil, err + } + + roles := []*apb.Role{} + for _, r := range roleList { + roles = append(roles, &apb.Role{ + Id: r.ID().String(), + Name: r.Name(), + Description: r.GetDescription(), + Permissions: r.GetPermissions(), + }) + } + + return &apb.GetRolesResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + Roles: roles, + }, nil +} + +// UpdateRoles updates data of the provided roles. +func (r Role) UpdateRoles(ctx context.Context, request *apb.UpdateRolesRequest) (*apb.UpdateRolesResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "post"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + // TODO: check if current user is allowed to update the role they try to update; only their own if not admin + for _, r := range request.Roles { + rid, err := uuid.Parse(r.Id) + if err != nil { + return nil, handleRPCError(labels, err) + } + + _, err = rolec.Get(store.Query{ID: rid}) + if err != nil { + return nil, status.Errorf(codes.Canceled, "role not found %v", err) + } + + roleToUpdate := rbac.NewRole(rid, r.Name, r.Description, r.Permissions) + err = rolec.Update(roleToUpdate) + if err != nil { + return nil, status.Errorf(codes.Aborted, "could not update role %v", err) + } + } + + return &apb.UpdateRolesResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} + +// DeletePermissionsForRole deletes the provided permissions from one role found by name. +func (r Role) DeletePermissionsForRole(ctx context.Context, request *apb.DeletePermissionsForRoleRequest) (*apb.DeletePermissionsForRoleResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "delete"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + roleToUpdate, err := rolec.Get(store.Query{Name: request.RoleName}) + if err != nil { + return nil, status.Errorf(codes.Canceled, "role not found %v", err) + } + + // checks if there is at least one valid permission to delete + // in the provided set of permissions to delete + nonFound := true + for _, perm := range roleToUpdate.GetPermissions() { + for _, permToDelete := range request.PermissionsToDelete { + if perm == permToDelete { + nonFound = false + break + } + } + if !nonFound { + break + } + } + if nonFound { + return nil, status.Errorf(codes.Canceled, "no fitting permissions") + } + + // updates the existing role with the trimmed set of permissions + roleToUpdate.RemovePermissionsFromRole(request.PermissionsToDelete) + err = rolec.Update(roleToUpdate) + if err != nil { + return nil, status.Errorf(codes.Aborted, "could not update role %v", err) + } + + return &apb.DeletePermissionsForRoleResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} + +// DeleteRoles deletes all the provided roles with their permissions. +func (r Role) DeleteRoles(ctx context.Context, request *apb.DeleteRolesRequest) (*apb.DeleteRolesResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "delete"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + for _, r := range request.RoleName { + roleToDelete, err := rolec.Get(store.Query{Name: r}) + if err != nil { + return nil, status.Errorf(codes.Canceled, "role not found") + } + + err = rolec.Delete(roleToDelete) + if err != nil { + return nil, status.Errorf(codes.Aborted, "error deleting role %v", err) + } + } + + return &apb.DeleteRolesResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} diff --git a/controller/northbound/server/user.go b/controller/northbound/server/user.go new file mode 100644 index 0000000000000000000000000000000000000000..e5f5e4a73ba038c7e954867186cdf73fe538fb91 --- /dev/null +++ b/controller/northbound/server/user.go @@ -0,0 +1,187 @@ +package server + +import ( + "context" + "fmt" + "time" + + apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" + "code.fbi.h-da.de/danet/gosdn/controller/metrics" + "code.fbi.h-da.de/danet/gosdn/controller/rbac" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// User holds a JWTManager and represents a UserServiceServer. +type User struct { + apb.UnimplementedUserServiceServer + jwtManager *rbac.JWTManager +} + +// NewUserServer receives a JWTManager and returns a new UserServer. +func NewUserServer(jwtManager *rbac.JWTManager) *User { + return &User{ + jwtManager: jwtManager, + } +} + +// CreateUsers creates new users, can be 1 or more +func (u User) CreateUsers(ctx context.Context, request *apb.CreateUsersRequest) (*apb.CreateUsersResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "post"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + // TODO: implement check if user is allowed to create users with this role + // e.g. non-admin shouldn't be allowed to create admin users + for _, u := range request.User { + roles := map[string]string{} + for key, elem := range u.Roles { + fmt.Printf("k: %v v: %v\n", key, elem) + _, err := uuid.Parse(key) + if err != nil { + return nil, handleRPCError(labels, err) + } + roles[key] = elem + } + + user := rbac.NewUser(uuid.New(), u.Name, roles, u.Password, u.Token) + err := userc.Add(user) + if err != nil { + log.Error(err) + return nil, status.Errorf(codes.Aborted, "%v", err) + } + } + + return &apb.CreateUsersResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} + +// GetUser returns one user by name. +func (u User) GetUser(ctx context.Context, request *apb.GetUserRequest) (*apb.GetUserResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "get"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + // TODO: implement check if user is allowed to get this user data; only their own if not admin + userData, err := userc.Get(store.Query{Name: request.Name}) + if err != nil { + return nil, err + } + + user := &apb.User{ + Id: userData.ID().String(), + Name: userData.Name(), + Roles: userData.GetRoles(), + } + + return &apb.GetUserResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + User: user, + }, nil +} + +// GetUsers returns all availbale users +func (u User) GetUsers(ctx context.Context, request *apb.GetUsersRequest) (*apb.GetUsersResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "get"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + userList, err := userc.GetAll() + if err != nil { + return nil, err + } + + users := []*apb.User{} + for _, u := range userList { + users = append(users, &apb.User{ + Id: u.ID().String(), + Name: u.Name(), + Roles: u.GetRoles(), + }) + } + + return &apb.GetUsersResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + User: users, + }, nil +} + +// UpdateUsers updates the user data of one or more users provided in the request +func (u User) UpdateUsers(ctx context.Context, request *apb.UpdateUsersRequest) (*apb.UpdateUsersResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "post"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + // TODO: check if current user is allowed to update the user they try to update; only their own if not admin + for _, u := range request.User { + uid, err := uuid.Parse(u.Id) + if err != nil { + return nil, handleRPCError(labels, err) + } + + _, err = userc.Get(store.Query{ID: uid}) + if err != nil { + return nil, status.Errorf(codes.Canceled, "user not found %v", err) + } + + userToUpdate := rbac.NewUser(uid, u.Name, u.Roles, u.Password, u.Token) + + err = userc.Update(userToUpdate) + if err != nil { + return nil, status.Errorf(codes.Aborted, "could not update user %v", err) + } + } + + return &apb.UpdateUsersResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} + +// DeleteUsers deletes one or more users provided in the request +func (u User) DeleteUsers(ctx context.Context, request *apb.DeleteUsersRequest) (*apb.DeleteUsersResponse, error) { + labels := prometheus.Labels{"service": "auth", "rpc": "delete"} + start := metrics.StartHook(labels, grpcRequestsTotal) + defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) + + for _, u := range request.Username { + userToDelete, err := userc.Get(store.Query{Name: u}) + if err != nil { + return nil, status.Errorf(codes.Canceled, "user not found %v", err) + } + + err = userc.Delete(userToDelete) + if err != nil { + return nil, status.Errorf(codes.Aborted, "error deleting user %v", err) + } + } + return &apb.DeleteUsersResponse{ + Timestamp: time.Now().UnixNano(), + Status: apb.Status_STATUS_OK, + }, nil +} + +func (u User) isValidUser(user rbac.User) (bool, error) { + storedUser, err := userc.Get(store.Query{Name: user.Name()}) + if err != nil { + return false, err + } else if storedUser == nil { + return false, status.Errorf(codes.Aborted, "no user object") + } + + if storedUser.Name() == user.Name() { + if storedUser.GetPassword() == user.GetPassword() { + return true, nil + } + } + + return false, status.Errorf(codes.Unauthenticated, "incorrect user name or password") +}