Add granular role grant/revoke endpoints to REST and gRPC APIs
- Add POST /v1/accounts/{id}/roles and DELETE /v1/accounts/{id}/roles/{role} REST endpoints
- Add GrantRole and RevokeRole RPCs to AccountService in gRPC API
- Update OpenAPI specification with new endpoints
- Add grant and revoke subcommands to mciasctl
- Add grant and revoke subcommands to mciasgrpcctl
- Regenerate proto files with new message types and RPCs
- Implement gRPC server methods for granular role management
- All existing tests pass; build verified with goimports
Security: Role changes are audited via EventRoleGranted and EventRoleRevoked events,
consistent with existing SetRoles implementation.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v3.20.3
|
||||
// protoc v6.33.4
|
||||
// source: mcias/v1/account.proto
|
||||
|
||||
package mciasv1
|
||||
@@ -654,6 +654,186 @@ func (*SetRolesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
// GrantRoleRequest adds a single role to an account.
|
||||
type GrantRoleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // UUID
|
||||
Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` // role name
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GrantRoleRequest) Reset() {
|
||||
*x = GrantRoleRequest{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GrantRoleRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GrantRoleRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GrantRoleRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[14]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GrantRoleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GrantRoleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
func (x *GrantRoleRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GrantRoleRequest) GetRole() string {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GrantRoleResponse confirms the grant.
|
||||
type GrantRoleResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GrantRoleResponse) Reset() {
|
||||
*x = GrantRoleResponse{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[15]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GrantRoleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GrantRoleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GrantRoleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[15]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GrantRoleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GrantRoleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{15}
|
||||
}
|
||||
|
||||
// RevokeRoleRequest removes a single role from an account.
|
||||
type RevokeRoleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // UUID
|
||||
Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` // role name
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RevokeRoleRequest) Reset() {
|
||||
*x = RevokeRoleRequest{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[16]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RevokeRoleRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RevokeRoleRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RevokeRoleRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[16]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RevokeRoleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RevokeRoleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{16}
|
||||
}
|
||||
|
||||
func (x *RevokeRoleRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RevokeRoleRequest) GetRole() string {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// RevokeRoleResponse confirms the revocation.
|
||||
type RevokeRoleResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RevokeRoleResponse) Reset() {
|
||||
*x = RevokeRoleResponse{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[17]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RevokeRoleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RevokeRoleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RevokeRoleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[17]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RevokeRoleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RevokeRoleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{17}
|
||||
}
|
||||
|
||||
// GetPGCredsRequest identifies an account by UUID.
|
||||
type GetPGCredsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -664,7 +844,7 @@ type GetPGCredsRequest struct {
|
||||
|
||||
func (x *GetPGCredsRequest) Reset() {
|
||||
*x = GetPGCredsRequest{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[14]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[18]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -676,7 +856,7 @@ func (x *GetPGCredsRequest) String() string {
|
||||
func (*GetPGCredsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetPGCredsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[14]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[18]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -689,7 +869,7 @@ func (x *GetPGCredsRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetPGCredsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetPGCredsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{14}
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{18}
|
||||
}
|
||||
|
||||
func (x *GetPGCredsRequest) GetId() string {
|
||||
@@ -710,7 +890,7 @@ type GetPGCredsResponse struct {
|
||||
|
||||
func (x *GetPGCredsResponse) Reset() {
|
||||
*x = GetPGCredsResponse{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[15]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[19]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -722,7 +902,7 @@ func (x *GetPGCredsResponse) String() string {
|
||||
func (*GetPGCredsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetPGCredsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[15]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[19]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -735,7 +915,7 @@ func (x *GetPGCredsResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetPGCredsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetPGCredsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{15}
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{19}
|
||||
}
|
||||
|
||||
func (x *GetPGCredsResponse) GetCreds() *PGCreds {
|
||||
@@ -756,7 +936,7 @@ type SetPGCredsRequest struct {
|
||||
|
||||
func (x *SetPGCredsRequest) Reset() {
|
||||
*x = SetPGCredsRequest{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[16]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[20]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -768,7 +948,7 @@ func (x *SetPGCredsRequest) String() string {
|
||||
func (*SetPGCredsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetPGCredsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[16]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[20]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -781,7 +961,7 @@ func (x *SetPGCredsRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use SetPGCredsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetPGCredsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{16}
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{20}
|
||||
}
|
||||
|
||||
func (x *SetPGCredsRequest) GetId() string {
|
||||
@@ -807,7 +987,7 @@ type SetPGCredsResponse struct {
|
||||
|
||||
func (x *SetPGCredsResponse) Reset() {
|
||||
*x = SetPGCredsResponse{}
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[17]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[21]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -819,7 +999,7 @@ func (x *SetPGCredsResponse) String() string {
|
||||
func (*SetPGCredsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetPGCredsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[17]
|
||||
mi := &file_mcias_v1_account_proto_msgTypes[21]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -832,7 +1012,7 @@ func (x *SetPGCredsResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use SetPGCredsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetPGCredsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{17}
|
||||
return file_mcias_v1_account_proto_rawDescGZIP(), []int{21}
|
||||
}
|
||||
|
||||
var File_mcias_v1_account_proto protoreflect.FileDescriptor
|
||||
@@ -867,7 +1047,15 @@ const file_mcias_v1_account_proto_rawDesc = "" +
|
||||
"\x0fSetRolesRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" +
|
||||
"\x05roles\x18\x02 \x03(\tR\x05roles\"\x12\n" +
|
||||
"\x10SetRolesResponse\"#\n" +
|
||||
"\x10SetRolesResponse\"6\n" +
|
||||
"\x10GrantRoleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04role\x18\x02 \x01(\tR\x04role\"\x13\n" +
|
||||
"\x11GrantRoleResponse\"7\n" +
|
||||
"\x11RevokeRoleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04role\x18\x02 \x01(\tR\x04role\"\x14\n" +
|
||||
"\x12RevokeRoleResponse\"#\n" +
|
||||
"\x11GetPGCredsRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"=\n" +
|
||||
"\x12GetPGCredsResponse\x12'\n" +
|
||||
@@ -875,7 +1063,7 @@ const file_mcias_v1_account_proto_rawDesc = "" +
|
||||
"\x11SetPGCredsRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12'\n" +
|
||||
"\x05creds\x18\x02 \x01(\v2\x11.mcias.v1.PGCredsR\x05creds\"\x14\n" +
|
||||
"\x12SetPGCredsResponse2\xa4\x04\n" +
|
||||
"\x12SetPGCredsResponse2\xb3\x05\n" +
|
||||
"\x0eAccountService\x12M\n" +
|
||||
"\fListAccounts\x12\x1d.mcias.v1.ListAccountsRequest\x1a\x1e.mcias.v1.ListAccountsResponse\x12P\n" +
|
||||
"\rCreateAccount\x12\x1e.mcias.v1.CreateAccountRequest\x1a\x1f.mcias.v1.CreateAccountResponse\x12G\n" +
|
||||
@@ -884,7 +1072,10 @@ const file_mcias_v1_account_proto_rawDesc = "" +
|
||||
"\rUpdateAccount\x12\x1e.mcias.v1.UpdateAccountRequest\x1a\x1f.mcias.v1.UpdateAccountResponse\x12P\n" +
|
||||
"\rDeleteAccount\x12\x1e.mcias.v1.DeleteAccountRequest\x1a\x1f.mcias.v1.DeleteAccountResponse\x12A\n" +
|
||||
"\bGetRoles\x12\x19.mcias.v1.GetRolesRequest\x1a\x1a.mcias.v1.GetRolesResponse\x12A\n" +
|
||||
"\bSetRoles\x12\x19.mcias.v1.SetRolesRequest\x1a\x1a.mcias.v1.SetRolesResponse2\xa5\x01\n" +
|
||||
"\bSetRoles\x12\x19.mcias.v1.SetRolesRequest\x1a\x1a.mcias.v1.SetRolesResponse\x12D\n" +
|
||||
"\tGrantRole\x12\x1a.mcias.v1.GrantRoleRequest\x1a\x1b.mcias.v1.GrantRoleResponse\x12G\n" +
|
||||
"\n" +
|
||||
"RevokeRole\x12\x1b.mcias.v1.RevokeRoleRequest\x1a\x1c.mcias.v1.RevokeRoleResponse2\xa5\x01\n" +
|
||||
"\x11CredentialService\x12G\n" +
|
||||
"\n" +
|
||||
"GetPGCreds\x12\x1b.mcias.v1.GetPGCredsRequest\x1a\x1c.mcias.v1.GetPGCredsResponse\x12G\n" +
|
||||
@@ -903,7 +1094,7 @@ func file_mcias_v1_account_proto_rawDescGZIP() []byte {
|
||||
return file_mcias_v1_account_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mcias_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
|
||||
var file_mcias_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
|
||||
var file_mcias_v1_account_proto_goTypes = []any{
|
||||
(*ListAccountsRequest)(nil), // 0: mcias.v1.ListAccountsRequest
|
||||
(*ListAccountsResponse)(nil), // 1: mcias.v1.ListAccountsResponse
|
||||
@@ -919,19 +1110,23 @@ var file_mcias_v1_account_proto_goTypes = []any{
|
||||
(*GetRolesResponse)(nil), // 11: mcias.v1.GetRolesResponse
|
||||
(*SetRolesRequest)(nil), // 12: mcias.v1.SetRolesRequest
|
||||
(*SetRolesResponse)(nil), // 13: mcias.v1.SetRolesResponse
|
||||
(*GetPGCredsRequest)(nil), // 14: mcias.v1.GetPGCredsRequest
|
||||
(*GetPGCredsResponse)(nil), // 15: mcias.v1.GetPGCredsResponse
|
||||
(*SetPGCredsRequest)(nil), // 16: mcias.v1.SetPGCredsRequest
|
||||
(*SetPGCredsResponse)(nil), // 17: mcias.v1.SetPGCredsResponse
|
||||
(*Account)(nil), // 18: mcias.v1.Account
|
||||
(*PGCreds)(nil), // 19: mcias.v1.PGCreds
|
||||
(*GrantRoleRequest)(nil), // 14: mcias.v1.GrantRoleRequest
|
||||
(*GrantRoleResponse)(nil), // 15: mcias.v1.GrantRoleResponse
|
||||
(*RevokeRoleRequest)(nil), // 16: mcias.v1.RevokeRoleRequest
|
||||
(*RevokeRoleResponse)(nil), // 17: mcias.v1.RevokeRoleResponse
|
||||
(*GetPGCredsRequest)(nil), // 18: mcias.v1.GetPGCredsRequest
|
||||
(*GetPGCredsResponse)(nil), // 19: mcias.v1.GetPGCredsResponse
|
||||
(*SetPGCredsRequest)(nil), // 20: mcias.v1.SetPGCredsRequest
|
||||
(*SetPGCredsResponse)(nil), // 21: mcias.v1.SetPGCredsResponse
|
||||
(*Account)(nil), // 22: mcias.v1.Account
|
||||
(*PGCreds)(nil), // 23: mcias.v1.PGCreds
|
||||
}
|
||||
var file_mcias_v1_account_proto_depIdxs = []int32{
|
||||
18, // 0: mcias.v1.ListAccountsResponse.accounts:type_name -> mcias.v1.Account
|
||||
18, // 1: mcias.v1.CreateAccountResponse.account:type_name -> mcias.v1.Account
|
||||
18, // 2: mcias.v1.GetAccountResponse.account:type_name -> mcias.v1.Account
|
||||
19, // 3: mcias.v1.GetPGCredsResponse.creds:type_name -> mcias.v1.PGCreds
|
||||
19, // 4: mcias.v1.SetPGCredsRequest.creds:type_name -> mcias.v1.PGCreds
|
||||
22, // 0: mcias.v1.ListAccountsResponse.accounts:type_name -> mcias.v1.Account
|
||||
22, // 1: mcias.v1.CreateAccountResponse.account:type_name -> mcias.v1.Account
|
||||
22, // 2: mcias.v1.GetAccountResponse.account:type_name -> mcias.v1.Account
|
||||
23, // 3: mcias.v1.GetPGCredsResponse.creds:type_name -> mcias.v1.PGCreds
|
||||
23, // 4: mcias.v1.SetPGCredsRequest.creds:type_name -> mcias.v1.PGCreds
|
||||
0, // 5: mcias.v1.AccountService.ListAccounts:input_type -> mcias.v1.ListAccountsRequest
|
||||
2, // 6: mcias.v1.AccountService.CreateAccount:input_type -> mcias.v1.CreateAccountRequest
|
||||
4, // 7: mcias.v1.AccountService.GetAccount:input_type -> mcias.v1.GetAccountRequest
|
||||
@@ -939,19 +1134,23 @@ var file_mcias_v1_account_proto_depIdxs = []int32{
|
||||
8, // 9: mcias.v1.AccountService.DeleteAccount:input_type -> mcias.v1.DeleteAccountRequest
|
||||
10, // 10: mcias.v1.AccountService.GetRoles:input_type -> mcias.v1.GetRolesRequest
|
||||
12, // 11: mcias.v1.AccountService.SetRoles:input_type -> mcias.v1.SetRolesRequest
|
||||
14, // 12: mcias.v1.CredentialService.GetPGCreds:input_type -> mcias.v1.GetPGCredsRequest
|
||||
16, // 13: mcias.v1.CredentialService.SetPGCreds:input_type -> mcias.v1.SetPGCredsRequest
|
||||
1, // 14: mcias.v1.AccountService.ListAccounts:output_type -> mcias.v1.ListAccountsResponse
|
||||
3, // 15: mcias.v1.AccountService.CreateAccount:output_type -> mcias.v1.CreateAccountResponse
|
||||
5, // 16: mcias.v1.AccountService.GetAccount:output_type -> mcias.v1.GetAccountResponse
|
||||
7, // 17: mcias.v1.AccountService.UpdateAccount:output_type -> mcias.v1.UpdateAccountResponse
|
||||
9, // 18: mcias.v1.AccountService.DeleteAccount:output_type -> mcias.v1.DeleteAccountResponse
|
||||
11, // 19: mcias.v1.AccountService.GetRoles:output_type -> mcias.v1.GetRolesResponse
|
||||
13, // 20: mcias.v1.AccountService.SetRoles:output_type -> mcias.v1.SetRolesResponse
|
||||
15, // 21: mcias.v1.CredentialService.GetPGCreds:output_type -> mcias.v1.GetPGCredsResponse
|
||||
17, // 22: mcias.v1.CredentialService.SetPGCreds:output_type -> mcias.v1.SetPGCredsResponse
|
||||
14, // [14:23] is the sub-list for method output_type
|
||||
5, // [5:14] is the sub-list for method input_type
|
||||
14, // 12: mcias.v1.AccountService.GrantRole:input_type -> mcias.v1.GrantRoleRequest
|
||||
16, // 13: mcias.v1.AccountService.RevokeRole:input_type -> mcias.v1.RevokeRoleRequest
|
||||
18, // 14: mcias.v1.CredentialService.GetPGCreds:input_type -> mcias.v1.GetPGCredsRequest
|
||||
20, // 15: mcias.v1.CredentialService.SetPGCreds:input_type -> mcias.v1.SetPGCredsRequest
|
||||
1, // 16: mcias.v1.AccountService.ListAccounts:output_type -> mcias.v1.ListAccountsResponse
|
||||
3, // 17: mcias.v1.AccountService.CreateAccount:output_type -> mcias.v1.CreateAccountResponse
|
||||
5, // 18: mcias.v1.AccountService.GetAccount:output_type -> mcias.v1.GetAccountResponse
|
||||
7, // 19: mcias.v1.AccountService.UpdateAccount:output_type -> mcias.v1.UpdateAccountResponse
|
||||
9, // 20: mcias.v1.AccountService.DeleteAccount:output_type -> mcias.v1.DeleteAccountResponse
|
||||
11, // 21: mcias.v1.AccountService.GetRoles:output_type -> mcias.v1.GetRolesResponse
|
||||
13, // 22: mcias.v1.AccountService.SetRoles:output_type -> mcias.v1.SetRolesResponse
|
||||
15, // 23: mcias.v1.AccountService.GrantRole:output_type -> mcias.v1.GrantRoleResponse
|
||||
17, // 24: mcias.v1.AccountService.RevokeRole:output_type -> mcias.v1.RevokeRoleResponse
|
||||
19, // 25: mcias.v1.CredentialService.GetPGCreds:output_type -> mcias.v1.GetPGCredsResponse
|
||||
21, // 26: mcias.v1.CredentialService.SetPGCreds:output_type -> mcias.v1.SetPGCredsResponse
|
||||
16, // [16:27] is the sub-list for method output_type
|
||||
5, // [5:16] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
@@ -969,7 +1168,7 @@ func file_mcias_v1_account_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mcias_v1_account_proto_rawDesc), len(file_mcias_v1_account_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 18,
|
||||
NumMessages: 22,
|
||||
NumExtensions: 0,
|
||||
NumServices: 2,
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v3.20.3
|
||||
// - protoc v6.33.4
|
||||
// source: mcias/v1/account.proto
|
||||
|
||||
package mciasv1
|
||||
@@ -29,6 +29,8 @@ const (
|
||||
AccountService_DeleteAccount_FullMethodName = "/mcias.v1.AccountService/DeleteAccount"
|
||||
AccountService_GetRoles_FullMethodName = "/mcias.v1.AccountService/GetRoles"
|
||||
AccountService_SetRoles_FullMethodName = "/mcias.v1.AccountService/SetRoles"
|
||||
AccountService_GrantRole_FullMethodName = "/mcias.v1.AccountService/GrantRole"
|
||||
AccountService_RevokeRole_FullMethodName = "/mcias.v1.AccountService/RevokeRole"
|
||||
)
|
||||
|
||||
// AccountServiceClient is the client API for AccountService service.
|
||||
@@ -44,6 +46,8 @@ type AccountServiceClient interface {
|
||||
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error)
|
||||
GetRoles(ctx context.Context, in *GetRolesRequest, opts ...grpc.CallOption) (*GetRolesResponse, error)
|
||||
SetRoles(ctx context.Context, in *SetRolesRequest, opts ...grpc.CallOption) (*SetRolesResponse, error)
|
||||
GrantRole(ctx context.Context, in *GrantRoleRequest, opts ...grpc.CallOption) (*GrantRoleResponse, error)
|
||||
RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error)
|
||||
}
|
||||
|
||||
type accountServiceClient struct {
|
||||
@@ -124,6 +128,26 @@ func (c *accountServiceClient) SetRoles(ctx context.Context, in *SetRolesRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GrantRole(ctx context.Context, in *GrantRoleRequest, opts ...grpc.CallOption) (*GrantRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GrantRoleResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_GrantRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RevokeRoleResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_RevokeRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AccountServiceServer is the server API for AccountService service.
|
||||
// All implementations must embed UnimplementedAccountServiceServer
|
||||
// for forward compatibility.
|
||||
@@ -137,6 +161,8 @@ type AccountServiceServer interface {
|
||||
DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error)
|
||||
GetRoles(context.Context, *GetRolesRequest) (*GetRolesResponse, error)
|
||||
SetRoles(context.Context, *SetRolesRequest) (*SetRolesResponse, error)
|
||||
GrantRole(context.Context, *GrantRoleRequest) (*GrantRoleResponse, error)
|
||||
RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error)
|
||||
mustEmbedUnimplementedAccountServiceServer()
|
||||
}
|
||||
|
||||
@@ -168,6 +194,12 @@ func (UnimplementedAccountServiceServer) GetRoles(context.Context, *GetRolesRequ
|
||||
func (UnimplementedAccountServiceServer) SetRoles(context.Context, *SetRolesRequest) (*SetRolesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetRoles not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) GrantRole(context.Context, *GrantRoleRequest) (*GrantRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GrantRole not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RevokeRole not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {}
|
||||
func (UnimplementedAccountServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -315,6 +347,42 @@ func _AccountService_SetRoles_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_GrantRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GrantRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GrantRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GrantRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GrantRole(ctx, req.(*GrantRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_RevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevokeRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).RevokeRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_RevokeRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).RevokeRole(ctx, req.(*RevokeRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -350,6 +418,14 @@ var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "SetRoles",
|
||||
Handler: _AccountService_SetRoles_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GrantRole",
|
||||
Handler: _AccountService_GrantRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevokeRole",
|
||||
Handler: _AccountService_RevokeRole_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "mcias/v1/account.proto",
|
||||
|
||||
Reference in New Issue
Block a user