From 71282490821ad76241205ccdefd14d0c622ba319 Mon Sep 17 00:00:00 2001 From: Juan Hernandez Date: Tue, 5 May 2026 13:03:20 +0200 Subject: [PATCH] MGMT-22992: Add role and role binding reconciler skeletons Add `role` and `role_binding` payloads to both the private and public `Event` messages so the reconciler watch and list sync mechanisms work correctly. Register both types in `GenericServer.setPayload` for notify and add the corresponding `extractMetadata` cases in the public events server. Wire the reconcilers in `start_controller_cmd`. For now these are only skeletons that add the controller finalizer, set default status, and log the object being reconciled. The actual reconciliation logic will be added in later patches. Related: https://redhat.atlassian.net/browse/MGMT-22992 Signed-off-by: Juan Hernandez --- internal/api/osac/private/v1/event_type.pb.go | 316 ++++++++++++------ .../private/v1/event_type_protoopaque.pb.go | 314 +++++++++++------ internal/api/osac/public/v1/event_type.pb.go | 222 ++++++++---- .../public/v1/event_type_protoopaque.pb.go | 220 ++++++++---- .../start/controller/start_controller_cmd.go | 74 ++++ .../role/role_reconciler_function.go | 177 ++++++++++ .../role_binding_reconciler_function.go | 177 ++++++++++ internal/servers/events_server.go | 6 +- internal/servers/generic_server.go | 4 + it/it_role_binding_reconciler_test.go | 138 ++++++++ it/it_role_reconciler_test.go | 132 ++++++++ it/it_roles_test.go | 28 +- .../private/osac/private/v1/event_type.proto | 4 + proto/public/osac/public/v1/event_type.proto | 4 + 14 files changed, 1493 insertions(+), 323 deletions(-) create mode 100644 internal/controllers/role/role_reconciler_function.go create mode 100644 internal/controllers/rolebinding/role_binding_reconciler_function.go create mode 100644 it/it_role_binding_reconciler_test.go create mode 100644 it/it_role_reconciler_test.go diff --git a/internal/api/osac/private/v1/event_type.pb.go b/internal/api/osac/private/v1/event_type.pb.go index 8965f3bff..503b2c9c7 100644 --- a/internal/api/osac/private/v1/event_type.pb.go +++ b/internal/api/osac/private/v1/event_type.pb.go @@ -124,6 +124,8 @@ type Event struct { // *Event_PublicIp // *Event_Organization // *Event_User + // *Event_Role + // *Event_RoleBinding Payload isEvent_Payload `protobuf_oneof:"payload"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -310,6 +312,24 @@ func (x *Event) GetUser() *User { return nil } +func (x *Event) GetRole() *Role { + if x != nil { + if x, ok := x.Payload.(*Event_Role); ok { + return x.Role + } + } + return nil +} + +func (x *Event) GetRoleBinding() *RoleBinding { + if x != nil { + if x, ok := x.Payload.(*Event_RoleBinding); ok { + return x.RoleBinding + } + } + return nil +} + func (x *Event) SetId(v string) { x.Id = v } @@ -438,6 +458,22 @@ func (x *Event) SetUser(v *User) { x.Payload = &Event_User{v} } +func (x *Event) SetRole(v *Role) { + if v == nil { + x.Payload = nil + return + } + x.Payload = &Event_Role{v} +} + +func (x *Event) SetRoleBinding(v *RoleBinding) { + if v == nil { + x.Payload = nil + return + } + x.Payload = &Event_RoleBinding{v} +} + func (x *Event) HasPayload() bool { if x == nil { return false @@ -565,6 +601,22 @@ func (x *Event) HasUser() bool { return ok } +func (x *Event) HasRole() bool { + if x == nil { + return false + } + _, ok := x.Payload.(*Event_Role) + return ok +} + +func (x *Event) HasRoleBinding() bool { + if x == nil { + return false + } + _, ok := x.Payload.(*Event_RoleBinding) + return ok +} + func (x *Event) ClearPayload() { x.Payload = nil } @@ -659,6 +711,18 @@ func (x *Event) ClearUser() { } } +func (x *Event) ClearRole() { + if _, ok := x.Payload.(*Event_Role); ok { + x.Payload = nil + } +} + +func (x *Event) ClearRoleBinding() { + if _, ok := x.Payload.(*Event_RoleBinding); ok { + x.Payload = nil + } +} + const Event_Payload_not_set_case case_Event_Payload = 0 const Event_Cluster_case case_Event_Payload = 3 const Event_ClusterTemplate_case case_Event_Payload = 4 @@ -675,6 +739,8 @@ const Event_PublicIpPool_case case_Event_Payload = 16 const Event_PublicIp_case case_Event_Payload = 17 const Event_Organization_case case_Event_Payload = 18 const Event_User_case case_Event_Payload = 19 +const Event_Role_case case_Event_Payload = 20 +const Event_RoleBinding_case case_Event_Payload = 21 func (x *Event) WhichPayload() case_Event_Payload { if x == nil { @@ -711,6 +777,10 @@ func (x *Event) WhichPayload() case_Event_Payload { return Event_Organization_case case *Event_User: return Event_User_case + case *Event_Role: + return Event_Role_case + case *Event_RoleBinding: + return Event_RoleBinding_case default: return Event_Payload_not_set_case } @@ -741,6 +811,8 @@ type Event_builder struct { PublicIp *PublicIP Organization *Organization User *User + Role *Role + RoleBinding *RoleBinding // -- end of Payload } @@ -795,6 +867,12 @@ func (b0 Event_builder) Build() *Event { if b.User != nil { x.Payload = &Event_User{b.User} } + if b.Role != nil { + x.Payload = &Event_Role{b.Role} + } + if b.RoleBinding != nil { + x.Payload = &Event_RoleBinding{b.RoleBinding} + } return m0 } @@ -872,6 +950,14 @@ type Event_User struct { User *User `protobuf:"bytes,19,opt,name=user,proto3,oneof"` } +type Event_Role struct { + Role *Role `protobuf:"bytes,20,opt,name=role,proto3,oneof"` +} + +type Event_RoleBinding struct { + RoleBinding *RoleBinding `protobuf:"bytes,21,opt,name=role_binding,json=roleBinding,proto3,oneof"` +} + func (*Event_Cluster) isEvent_Payload() {} func (*Event_ClusterTemplate) isEvent_Payload() {} @@ -902,6 +988,10 @@ func (*Event_Organization) isEvent_Payload() {} func (*Event_User) isEvent_Payload() {} +func (*Event_Role) isEvent_Payload() {} + +func (*Event_RoleBinding) isEvent_Payload() {} + var File_osac_private_v1_event_type_proto protoreflect.FileDescriptor var file_osac_private_v1_event_type_proto_rawDesc = string([]byte{ @@ -936,107 +1026,119 @@ var file_osac_private_v1_event_type_proto_rawDesc = string([]byte{ 0x6f, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, - 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2a, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, - 0x08, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x61, 0x63, - 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4d, - 0x0a, 0x10, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, - 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x68, - 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x03, 0x68, 0x75, 0x62, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x75, 0x62, 0x48, 0x00, 0x52, 0x03, 0x68, 0x75, - 0x62, 0x12, 0x66, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, - 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, - 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x31, - 0x0a, 0x06, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, + 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, + 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x6f, + 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x61, + 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x6f, 0x73, + 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x69, + 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1a, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, + 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x28, 0x0a, 0x03, 0x68, 0x75, 0x62, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x62, 0x6e, 0x65, - 0x74, 0x12, 0x4a, 0x0a, 0x0f, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, - 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x72, - 0x74, 0x75, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x76, - 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x47, 0x0a, - 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x48, 0x00, 0x52, - 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x48, 0x75, 0x62, 0x48, 0x00, 0x52, 0x03, 0x68, 0x75, 0x62, 0x12, 0x66, 0x0a, 0x19, 0x63, + 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x50, 0x50, 0x6f, 0x6f, 0x6c, 0x48, 0x00, 0x52, - 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x70, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x38, 0x0a, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x50, 0x48, 0x00, 0x52, 0x08, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, + 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x61, - 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x48, 0x00, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xa4, 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, - 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, - 0x45, 0x43, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, - 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, - 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, - 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, - 0x54, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x42, 0xd9, 0x01, 0x0a, 0x13, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, - 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, - 0x02, 0x0f, 0x4f, 0x73, 0x61, 0x63, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x10, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x5f, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4f, 0x73, 0x61, 0x63, 0x3a, 0x3a, 0x50, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, + 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, + 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, + 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0x4a, 0x0a, 0x0f, 0x76, + 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x47, 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, + 0x00, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x2e, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x5f, 0x70, 0x6f, + 0x6f, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x50, 0x50, 0x6f, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x70, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x69, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, + 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x49, 0x50, 0x48, 0x00, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, + 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x48, 0x00, 0x52, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x41, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xa4, + 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, + 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, + 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x43, 0x52, + 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x45, 0x4c, 0x45, + 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, + 0x4c, 0x45, 0x44, 0x10, 0x04, 0x42, 0xd9, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, + 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, 0x61, 0x63, + 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, + 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x0f, 0x4f, 0x73, 0x61, 0x63, + 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4f, 0x73, + 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1c, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x4f, 0x73, 0x61, 0x63, 0x3a, 0x3a, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var file_osac_private_v1_event_type_proto_enumTypes = make([]protoimpl.EnumInfo, 1) @@ -1059,6 +1161,8 @@ var file_osac_private_v1_event_type_proto_goTypes = []any{ (*PublicIP)(nil), // 14: osac.private.v1.PublicIP (*Organization)(nil), // 15: osac.private.v1.Organization (*User)(nil), // 16: osac.private.v1.User + (*Role)(nil), // 17: osac.private.v1.Role + (*RoleBinding)(nil), // 18: osac.private.v1.RoleBinding } var file_osac_private_v1_event_type_proto_depIdxs = []int32{ 0, // 0: osac.private.v1.Event.type:type_name -> osac.private.v1.EventType @@ -1077,11 +1181,13 @@ var file_osac_private_v1_event_type_proto_depIdxs = []int32{ 14, // 13: osac.private.v1.Event.public_ip:type_name -> osac.private.v1.PublicIP 15, // 14: osac.private.v1.Event.organization:type_name -> osac.private.v1.Organization 16, // 15: osac.private.v1.Event.user:type_name -> osac.private.v1.User - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 17, // 16: osac.private.v1.Event.role:type_name -> osac.private.v1.Role + 18, // 17: osac.private.v1.Event.role_binding:type_name -> osac.private.v1.RoleBinding + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_osac_private_v1_event_type_proto_init() } @@ -1100,6 +1206,8 @@ func file_osac_private_v1_event_type_proto_init() { file_osac_private_v1_organization_type_proto_init() file_osac_private_v1_public_ip_pool_type_proto_init() file_osac_private_v1_public_ip_type_proto_init() + file_osac_private_v1_role_binding_type_proto_init() + file_osac_private_v1_role_type_proto_init() file_osac_private_v1_security_group_type_proto_init() file_osac_private_v1_subnet_type_proto_init() file_osac_private_v1_user_type_proto_init() @@ -1120,6 +1228,8 @@ func file_osac_private_v1_event_type_proto_init() { (*Event_PublicIp)(nil), (*Event_Organization)(nil), (*Event_User)(nil), + (*Event_Role)(nil), + (*Event_RoleBinding)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/internal/api/osac/private/v1/event_type_protoopaque.pb.go b/internal/api/osac/private/v1/event_type_protoopaque.pb.go index 5a1893a30..e7fcbe512 100644 --- a/internal/api/osac/private/v1/event_type_protoopaque.pb.go +++ b/internal/api/osac/private/v1/event_type_protoopaque.pb.go @@ -282,6 +282,24 @@ func (x *Event) GetUser() *User { return nil } +func (x *Event) GetRole() *Role { + if x != nil { + if x, ok := x.xxx_hidden_Payload.(*event_Role); ok { + return x.Role + } + } + return nil +} + +func (x *Event) GetRoleBinding() *RoleBinding { + if x != nil { + if x, ok := x.xxx_hidden_Payload.(*event_RoleBinding); ok { + return x.RoleBinding + } + } + return nil +} + func (x *Event) SetId(v string) { x.xxx_hidden_Id = v } @@ -410,6 +428,22 @@ func (x *Event) SetUser(v *User) { x.xxx_hidden_Payload = &event_User{v} } +func (x *Event) SetRole(v *Role) { + if v == nil { + x.xxx_hidden_Payload = nil + return + } + x.xxx_hidden_Payload = &event_Role{v} +} + +func (x *Event) SetRoleBinding(v *RoleBinding) { + if v == nil { + x.xxx_hidden_Payload = nil + return + } + x.xxx_hidden_Payload = &event_RoleBinding{v} +} + func (x *Event) HasPayload() bool { if x == nil { return false @@ -537,6 +571,22 @@ func (x *Event) HasUser() bool { return ok } +func (x *Event) HasRole() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Payload.(*event_Role) + return ok +} + +func (x *Event) HasRoleBinding() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Payload.(*event_RoleBinding) + return ok +} + func (x *Event) ClearPayload() { x.xxx_hidden_Payload = nil } @@ -631,6 +681,18 @@ func (x *Event) ClearUser() { } } +func (x *Event) ClearRole() { + if _, ok := x.xxx_hidden_Payload.(*event_Role); ok { + x.xxx_hidden_Payload = nil + } +} + +func (x *Event) ClearRoleBinding() { + if _, ok := x.xxx_hidden_Payload.(*event_RoleBinding); ok { + x.xxx_hidden_Payload = nil + } +} + const Event_Payload_not_set_case case_Event_Payload = 0 const Event_Cluster_case case_Event_Payload = 3 const Event_ClusterTemplate_case case_Event_Payload = 4 @@ -647,6 +709,8 @@ const Event_PublicIpPool_case case_Event_Payload = 16 const Event_PublicIp_case case_Event_Payload = 17 const Event_Organization_case case_Event_Payload = 18 const Event_User_case case_Event_Payload = 19 +const Event_Role_case case_Event_Payload = 20 +const Event_RoleBinding_case case_Event_Payload = 21 func (x *Event) WhichPayload() case_Event_Payload { if x == nil { @@ -683,6 +747,10 @@ func (x *Event) WhichPayload() case_Event_Payload { return Event_Organization_case case *event_User: return Event_User_case + case *event_Role: + return Event_Role_case + case *event_RoleBinding: + return Event_RoleBinding_case default: return Event_Payload_not_set_case } @@ -713,6 +781,8 @@ type Event_builder struct { PublicIp *PublicIP Organization *Organization User *User + Role *Role + RoleBinding *RoleBinding // -- end of xxx_hidden_Payload } @@ -767,6 +837,12 @@ func (b0 Event_builder) Build() *Event { if b.User != nil { x.xxx_hidden_Payload = &event_User{b.User} } + if b.Role != nil { + x.xxx_hidden_Payload = &event_Role{b.Role} + } + if b.RoleBinding != nil { + x.xxx_hidden_Payload = &event_RoleBinding{b.RoleBinding} + } return m0 } @@ -844,6 +920,14 @@ type event_User struct { User *User `protobuf:"bytes,19,opt,name=user,proto3,oneof"` } +type event_Role struct { + Role *Role `protobuf:"bytes,20,opt,name=role,proto3,oneof"` +} + +type event_RoleBinding struct { + RoleBinding *RoleBinding `protobuf:"bytes,21,opt,name=role_binding,json=roleBinding,proto3,oneof"` +} + func (*event_Cluster) isEvent_Payload() {} func (*event_ClusterTemplate) isEvent_Payload() {} @@ -874,6 +958,10 @@ func (*event_Organization) isEvent_Payload() {} func (*event_User) isEvent_Payload() {} +func (*event_Role) isEvent_Payload() {} + +func (*event_RoleBinding) isEvent_Payload() {} + var File_osac_private_v1_event_type_proto protoreflect.FileDescriptor var file_osac_private_v1_event_type_proto_rawDesc = string([]byte{ @@ -908,107 +996,119 @@ var file_osac_private_v1_event_type_proto_rawDesc = string([]byte{ 0x6f, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, - 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2a, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, - 0x08, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x61, 0x63, - 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4d, - 0x0a, 0x10, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, - 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x68, - 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x03, 0x68, 0x75, 0x62, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x75, 0x62, 0x48, 0x00, 0x52, 0x03, 0x68, 0x75, - 0x62, 0x12, 0x66, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, - 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, - 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x31, - 0x0a, 0x06, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, + 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, + 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x6f, + 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6f, 0x73, 0x61, + 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x6f, 0x73, + 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x69, + 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1a, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, + 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x28, 0x0a, 0x03, 0x68, 0x75, 0x62, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x62, 0x6e, 0x65, - 0x74, 0x12, 0x4a, 0x0a, 0x0f, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, - 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x72, - 0x74, 0x75, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x76, - 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x47, 0x0a, - 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2e, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x48, 0x00, 0x52, - 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x48, 0x75, 0x62, 0x48, 0x00, 0x52, 0x03, 0x68, 0x75, 0x62, 0x12, 0x66, 0x0a, 0x19, 0x63, + 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x50, 0x50, 0x6f, 0x6f, 0x6c, 0x48, 0x00, 0x52, - 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x70, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x38, 0x0a, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x50, 0x48, 0x00, 0x52, 0x08, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, + 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x61, - 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x48, 0x00, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xa4, 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, - 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, - 0x45, 0x43, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, - 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, - 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, - 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, - 0x54, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x42, 0xd9, 0x01, 0x0a, 0x13, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, - 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, - 0x02, 0x0f, 0x4f, 0x73, 0x61, 0x63, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x10, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x5f, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4f, 0x73, 0x61, 0x63, 0x3a, 0x3a, 0x50, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, + 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, + 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x06, 0x73, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, + 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x12, 0x4a, 0x0a, 0x0f, 0x76, + 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x47, 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, + 0x00, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x2e, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, 0x70, 0x5f, 0x70, 0x6f, + 0x6f, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x50, 0x50, 0x6f, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x49, 0x70, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x69, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, + 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x49, 0x50, 0x48, 0x00, 0x52, 0x08, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, + 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x48, 0x00, 0x52, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x41, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xa4, + 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, + 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, + 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x43, 0x52, + 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x45, 0x4c, 0x45, + 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, + 0x4c, 0x45, 0x44, 0x10, 0x04, 0x42, 0xd9, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, + 0x61, 0x63, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, 0x61, 0x63, + 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, + 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x0f, 0x4f, 0x73, 0x61, 0x63, + 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4f, 0x73, + 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1c, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x4f, 0x73, 0x61, 0x63, 0x3a, 0x3a, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var file_osac_private_v1_event_type_proto_enumTypes = make([]protoimpl.EnumInfo, 1) @@ -1031,6 +1131,8 @@ var file_osac_private_v1_event_type_proto_goTypes = []any{ (*PublicIP)(nil), // 14: osac.private.v1.PublicIP (*Organization)(nil), // 15: osac.private.v1.Organization (*User)(nil), // 16: osac.private.v1.User + (*Role)(nil), // 17: osac.private.v1.Role + (*RoleBinding)(nil), // 18: osac.private.v1.RoleBinding } var file_osac_private_v1_event_type_proto_depIdxs = []int32{ 0, // 0: osac.private.v1.Event.type:type_name -> osac.private.v1.EventType @@ -1049,11 +1151,13 @@ var file_osac_private_v1_event_type_proto_depIdxs = []int32{ 14, // 13: osac.private.v1.Event.public_ip:type_name -> osac.private.v1.PublicIP 15, // 14: osac.private.v1.Event.organization:type_name -> osac.private.v1.Organization 16, // 15: osac.private.v1.Event.user:type_name -> osac.private.v1.User - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 17, // 16: osac.private.v1.Event.role:type_name -> osac.private.v1.Role + 18, // 17: osac.private.v1.Event.role_binding:type_name -> osac.private.v1.RoleBinding + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_osac_private_v1_event_type_proto_init() } @@ -1072,6 +1176,8 @@ func file_osac_private_v1_event_type_proto_init() { file_osac_private_v1_organization_type_proto_init() file_osac_private_v1_public_ip_pool_type_proto_init() file_osac_private_v1_public_ip_type_proto_init() + file_osac_private_v1_role_binding_type_proto_init() + file_osac_private_v1_role_type_proto_init() file_osac_private_v1_security_group_type_proto_init() file_osac_private_v1_subnet_type_proto_init() file_osac_private_v1_user_type_proto_init() @@ -1092,6 +1198,8 @@ func file_osac_private_v1_event_type_proto_init() { (*event_PublicIp)(nil), (*event_Organization)(nil), (*event_User)(nil), + (*event_Role)(nil), + (*event_RoleBinding)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/internal/api/osac/public/v1/event_type.pb.go b/internal/api/osac/public/v1/event_type.pb.go index 8fd72c5c9..967b05923 100644 --- a/internal/api/osac/public/v1/event_type.pb.go +++ b/internal/api/osac/public/v1/event_type.pb.go @@ -108,6 +108,8 @@ type Event struct { // *Event_HostType // *Event_ComputeInstanceTemplate // *Event_ComputeInstance + // *Event_Role + // *Event_RoleBinding Payload isEvent_Payload `protobuf_oneof:"payload"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -204,6 +206,24 @@ func (x *Event) GetComputeInstance() *ComputeInstance { return nil } +func (x *Event) GetRole() *Role { + if x != nil { + if x, ok := x.Payload.(*Event_Role); ok { + return x.Role + } + } + return nil +} + +func (x *Event) GetRoleBinding() *RoleBinding { + if x != nil { + if x, ok := x.Payload.(*Event_RoleBinding); ok { + return x.RoleBinding + } + } + return nil +} + func (x *Event) SetId(v string) { x.Id = v } @@ -252,6 +272,22 @@ func (x *Event) SetComputeInstance(v *ComputeInstance) { x.Payload = &Event_ComputeInstance{v} } +func (x *Event) SetRole(v *Role) { + if v == nil { + x.Payload = nil + return + } + x.Payload = &Event_Role{v} +} + +func (x *Event) SetRoleBinding(v *RoleBinding) { + if v == nil { + x.Payload = nil + return + } + x.Payload = &Event_RoleBinding{v} +} + func (x *Event) HasPayload() bool { if x == nil { return false @@ -299,6 +335,22 @@ func (x *Event) HasComputeInstance() bool { return ok } +func (x *Event) HasRole() bool { + if x == nil { + return false + } + _, ok := x.Payload.(*Event_Role) + return ok +} + +func (x *Event) HasRoleBinding() bool { + if x == nil { + return false + } + _, ok := x.Payload.(*Event_RoleBinding) + return ok +} + func (x *Event) ClearPayload() { x.Payload = nil } @@ -333,12 +385,26 @@ func (x *Event) ClearComputeInstance() { } } +func (x *Event) ClearRole() { + if _, ok := x.Payload.(*Event_Role); ok { + x.Payload = nil + } +} + +func (x *Event) ClearRoleBinding() { + if _, ok := x.Payload.(*Event_RoleBinding); ok { + x.Payload = nil + } +} + const Event_Payload_not_set_case case_Event_Payload = 0 const Event_Cluster_case case_Event_Payload = 3 const Event_ClusterTemplate_case case_Event_Payload = 4 const Event_HostType_case case_Event_Payload = 5 const Event_ComputeInstanceTemplate_case case_Event_Payload = 7 const Event_ComputeInstance_case case_Event_Payload = 8 +const Event_Role_case case_Event_Payload = 9 +const Event_RoleBinding_case case_Event_Payload = 10 func (x *Event) WhichPayload() case_Event_Payload { if x == nil { @@ -355,6 +421,10 @@ func (x *Event) WhichPayload() case_Event_Payload { return Event_ComputeInstanceTemplate_case case *Event_ComputeInstance: return Event_ComputeInstance_case + case *Event_Role: + return Event_Role_case + case *Event_RoleBinding: + return Event_RoleBinding_case default: return Event_Payload_not_set_case } @@ -375,6 +445,8 @@ type Event_builder struct { HostType *HostType ComputeInstanceTemplate *ComputeInstanceTemplate ComputeInstance *ComputeInstance + Role *Role + RoleBinding *RoleBinding // -- end of Payload } @@ -399,6 +471,12 @@ func (b0 Event_builder) Build() *Event { if b.ComputeInstance != nil { x.Payload = &Event_ComputeInstance{b.ComputeInstance} } + if b.Role != nil { + x.Payload = &Event_Role{b.Role} + } + if b.RoleBinding != nil { + x.Payload = &Event_RoleBinding{b.RoleBinding} + } return m0 } @@ -436,6 +514,14 @@ type Event_ComputeInstance struct { ComputeInstance *ComputeInstance `protobuf:"bytes,8,opt,name=compute_instance,json=computeInstance,proto3,oneof"` } +type Event_Role struct { + Role *Role `protobuf:"bytes,9,opt,name=role,proto3,oneof"` +} + +type Event_RoleBinding struct { + RoleBinding *RoleBinding `protobuf:"bytes,10,opt,name=role_binding,json=roleBinding,proto3,oneof"` +} + func (*Event_Cluster) isEvent_Payload() {} func (*Event_ClusterTemplate) isEvent_Payload() {} @@ -446,6 +532,10 @@ func (*Event_ComputeInstanceTemplate) isEvent_Payload() {} func (*Event_ComputeInstance) isEvent_Payload() {} +func (*Event_Role) isEvent_Payload() {} + +func (*Event_RoleBinding) isEvent_Payload() {} + var File_osac_public_v1_event_type_proto protoreflect.FileDescriptor var file_osac_public_v1_event_type_proto_rawDesc = string([]byte{ @@ -465,57 +555,69 @@ var file_osac_public_v1_event_type_proto_rawDesc = string([]byte{ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x03, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, - 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x33, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, - 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, - 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x65, 0x0a, 0x19, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, - 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, - 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, - 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x84, 0x01, 0x0a, 0x09, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, - 0x10, 0x03, 0x42, 0xd2, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2d, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, - 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x73, 0x61, 0x63, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x4f, 0x73, 0x61, 0x63, 0x3a, 0x3a, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, + 0x6f, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, + 0x04, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x10, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x68, 0x6f, + 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, + 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x65, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, + 0x00, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x73, 0x61, + 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, + 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x6f, 0x6c, 0x65, 0x42, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2a, 0x84, 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x45, + 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, + 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, + 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, + 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, + 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x42, 0xd2, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, + 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, + 0x61, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, 0x75, 0x6c, 0x66, 0x69, + 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x61, 0x63, + 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x73, 0x61, 0x63, + 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x61, + 0x63, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, + 0x73, 0x61, 0x63, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x4f, 0x73, 0x61, + 0x63, 0x3a, 0x3a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var file_osac_public_v1_event_type_proto_enumTypes = make([]protoimpl.EnumInfo, 1) @@ -528,6 +630,8 @@ var file_osac_public_v1_event_type_proto_goTypes = []any{ (*HostType)(nil), // 4: osac.public.v1.HostType (*ComputeInstanceTemplate)(nil), // 5: osac.public.v1.ComputeInstanceTemplate (*ComputeInstance)(nil), // 6: osac.public.v1.ComputeInstance + (*Role)(nil), // 7: osac.public.v1.Role + (*RoleBinding)(nil), // 8: osac.public.v1.RoleBinding } var file_osac_public_v1_event_type_proto_depIdxs = []int32{ 0, // 0: osac.public.v1.Event.type:type_name -> osac.public.v1.EventType @@ -536,11 +640,13 @@ var file_osac_public_v1_event_type_proto_depIdxs = []int32{ 4, // 3: osac.public.v1.Event.host_type:type_name -> osac.public.v1.HostType 5, // 4: osac.public.v1.Event.compute_instance_template:type_name -> osac.public.v1.ComputeInstanceTemplate 6, // 5: osac.public.v1.Event.compute_instance:type_name -> osac.public.v1.ComputeInstance - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 7, // 6: osac.public.v1.Event.role:type_name -> osac.public.v1.Role + 8, // 7: osac.public.v1.Event.role_binding:type_name -> osac.public.v1.RoleBinding + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_osac_public_v1_event_type_proto_init() } @@ -553,12 +659,16 @@ func file_osac_public_v1_event_type_proto_init() { file_osac_public_v1_compute_instance_template_type_proto_init() file_osac_public_v1_compute_instance_type_proto_init() file_osac_public_v1_host_type_type_proto_init() + file_osac_public_v1_role_binding_type_proto_init() + file_osac_public_v1_role_type_proto_init() file_osac_public_v1_event_type_proto_msgTypes[0].OneofWrappers = []any{ (*Event_Cluster)(nil), (*Event_ClusterTemplate)(nil), (*Event_HostType)(nil), (*Event_ComputeInstanceTemplate)(nil), (*Event_ComputeInstance)(nil), + (*Event_Role)(nil), + (*Event_RoleBinding)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/internal/api/osac/public/v1/event_type_protoopaque.pb.go b/internal/api/osac/public/v1/event_type_protoopaque.pb.go index 63fa21350..e1833c3cb 100644 --- a/internal/api/osac/public/v1/event_type_protoopaque.pb.go +++ b/internal/api/osac/public/v1/event_type_protoopaque.pb.go @@ -186,6 +186,24 @@ func (x *Event) GetComputeInstance() *ComputeInstance { return nil } +func (x *Event) GetRole() *Role { + if x != nil { + if x, ok := x.xxx_hidden_Payload.(*event_Role); ok { + return x.Role + } + } + return nil +} + +func (x *Event) GetRoleBinding() *RoleBinding { + if x != nil { + if x, ok := x.xxx_hidden_Payload.(*event_RoleBinding); ok { + return x.RoleBinding + } + } + return nil +} + func (x *Event) SetId(v string) { x.xxx_hidden_Id = v } @@ -234,6 +252,22 @@ func (x *Event) SetComputeInstance(v *ComputeInstance) { x.xxx_hidden_Payload = &event_ComputeInstance{v} } +func (x *Event) SetRole(v *Role) { + if v == nil { + x.xxx_hidden_Payload = nil + return + } + x.xxx_hidden_Payload = &event_Role{v} +} + +func (x *Event) SetRoleBinding(v *RoleBinding) { + if v == nil { + x.xxx_hidden_Payload = nil + return + } + x.xxx_hidden_Payload = &event_RoleBinding{v} +} + func (x *Event) HasPayload() bool { if x == nil { return false @@ -281,6 +315,22 @@ func (x *Event) HasComputeInstance() bool { return ok } +func (x *Event) HasRole() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Payload.(*event_Role) + return ok +} + +func (x *Event) HasRoleBinding() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Payload.(*event_RoleBinding) + return ok +} + func (x *Event) ClearPayload() { x.xxx_hidden_Payload = nil } @@ -315,12 +365,26 @@ func (x *Event) ClearComputeInstance() { } } +func (x *Event) ClearRole() { + if _, ok := x.xxx_hidden_Payload.(*event_Role); ok { + x.xxx_hidden_Payload = nil + } +} + +func (x *Event) ClearRoleBinding() { + if _, ok := x.xxx_hidden_Payload.(*event_RoleBinding); ok { + x.xxx_hidden_Payload = nil + } +} + const Event_Payload_not_set_case case_Event_Payload = 0 const Event_Cluster_case case_Event_Payload = 3 const Event_ClusterTemplate_case case_Event_Payload = 4 const Event_HostType_case case_Event_Payload = 5 const Event_ComputeInstanceTemplate_case case_Event_Payload = 7 const Event_ComputeInstance_case case_Event_Payload = 8 +const Event_Role_case case_Event_Payload = 9 +const Event_RoleBinding_case case_Event_Payload = 10 func (x *Event) WhichPayload() case_Event_Payload { if x == nil { @@ -337,6 +401,10 @@ func (x *Event) WhichPayload() case_Event_Payload { return Event_ComputeInstanceTemplate_case case *event_ComputeInstance: return Event_ComputeInstance_case + case *event_Role: + return Event_Role_case + case *event_RoleBinding: + return Event_RoleBinding_case default: return Event_Payload_not_set_case } @@ -357,6 +425,8 @@ type Event_builder struct { HostType *HostType ComputeInstanceTemplate *ComputeInstanceTemplate ComputeInstance *ComputeInstance + Role *Role + RoleBinding *RoleBinding // -- end of xxx_hidden_Payload } @@ -381,6 +451,12 @@ func (b0 Event_builder) Build() *Event { if b.ComputeInstance != nil { x.xxx_hidden_Payload = &event_ComputeInstance{b.ComputeInstance} } + if b.Role != nil { + x.xxx_hidden_Payload = &event_Role{b.Role} + } + if b.RoleBinding != nil { + x.xxx_hidden_Payload = &event_RoleBinding{b.RoleBinding} + } return m0 } @@ -418,6 +494,14 @@ type event_ComputeInstance struct { ComputeInstance *ComputeInstance `protobuf:"bytes,8,opt,name=compute_instance,json=computeInstance,proto3,oneof"` } +type event_Role struct { + Role *Role `protobuf:"bytes,9,opt,name=role,proto3,oneof"` +} + +type event_RoleBinding struct { + RoleBinding *RoleBinding `protobuf:"bytes,10,opt,name=role_binding,json=roleBinding,proto3,oneof"` +} + func (*event_Cluster) isEvent_Payload() {} func (*event_ClusterTemplate) isEvent_Payload() {} @@ -428,6 +512,10 @@ func (*event_ComputeInstanceTemplate) isEvent_Payload() {} func (*event_ComputeInstance) isEvent_Payload() {} +func (*event_Role) isEvent_Payload() {} + +func (*event_RoleBinding) isEvent_Payload() {} + var File_osac_public_v1_event_type_proto protoreflect.FileDescriptor var file_osac_public_v1_event_type_proto_rawDesc = string([]byte{ @@ -447,57 +535,69 @@ var file_osac_public_v1_event_type_proto_rawDesc = string([]byte{ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x03, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, - 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x33, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, - 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, - 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x65, 0x0a, 0x19, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, - 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, - 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, - 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x84, 0x01, 0x0a, 0x09, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, - 0x10, 0x03, 0x42, 0xd2, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2d, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, - 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x73, 0x61, 0x63, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, 0x73, 0x61, 0x63, 0x5c, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x4f, 0x73, 0x61, 0x63, 0x3a, 0x3a, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x6f, 0x73, 0x61, 0x63, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, + 0x6f, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, + 0x04, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x10, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x68, 0x6f, + 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, + 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x65, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x48, + 0x00, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x73, 0x61, + 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, + 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x6f, 0x6c, 0x65, 0x42, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x2a, 0x84, 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x45, + 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, + 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, + 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, + 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x44, + 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x42, 0xd2, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x2e, 0x6f, 0x73, 0x61, 0x63, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, + 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, + 0x61, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x66, 0x75, 0x6c, 0x66, 0x69, + 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x73, 0x61, 0x63, + 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x4f, 0x73, 0x61, 0x63, + 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x4f, 0x73, 0x61, + 0x63, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x4f, + 0x73, 0x61, 0x63, 0x5c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x4f, 0x73, 0x61, + 0x63, 0x3a, 0x3a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var file_osac_public_v1_event_type_proto_enumTypes = make([]protoimpl.EnumInfo, 1) @@ -510,6 +610,8 @@ var file_osac_public_v1_event_type_proto_goTypes = []any{ (*HostType)(nil), // 4: osac.public.v1.HostType (*ComputeInstanceTemplate)(nil), // 5: osac.public.v1.ComputeInstanceTemplate (*ComputeInstance)(nil), // 6: osac.public.v1.ComputeInstance + (*Role)(nil), // 7: osac.public.v1.Role + (*RoleBinding)(nil), // 8: osac.public.v1.RoleBinding } var file_osac_public_v1_event_type_proto_depIdxs = []int32{ 0, // 0: osac.public.v1.Event.type:type_name -> osac.public.v1.EventType @@ -518,11 +620,13 @@ var file_osac_public_v1_event_type_proto_depIdxs = []int32{ 4, // 3: osac.public.v1.Event.host_type:type_name -> osac.public.v1.HostType 5, // 4: osac.public.v1.Event.compute_instance_template:type_name -> osac.public.v1.ComputeInstanceTemplate 6, // 5: osac.public.v1.Event.compute_instance:type_name -> osac.public.v1.ComputeInstance - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 7, // 6: osac.public.v1.Event.role:type_name -> osac.public.v1.Role + 8, // 7: osac.public.v1.Event.role_binding:type_name -> osac.public.v1.RoleBinding + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_osac_public_v1_event_type_proto_init() } @@ -535,12 +639,16 @@ func file_osac_public_v1_event_type_proto_init() { file_osac_public_v1_compute_instance_template_type_proto_init() file_osac_public_v1_compute_instance_type_proto_init() file_osac_public_v1_host_type_type_proto_init() + file_osac_public_v1_role_binding_type_proto_init() + file_osac_public_v1_role_type_proto_init() file_osac_public_v1_event_type_proto_msgTypes[0].OneofWrappers = []any{ (*event_Cluster)(nil), (*event_ClusterTemplate)(nil), (*event_HostType)(nil), (*event_ComputeInstanceTemplate)(nil), (*event_ComputeInstance)(nil), + (*event_Role)(nil), + (*event_RoleBinding)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/internal/cmd/service/start/controller/start_controller_cmd.go b/internal/cmd/service/start/controller/start_controller_cmd.go index 62be71b30..1dfd92cea 100644 --- a/internal/cmd/service/start/controller/start_controller_cmd.go +++ b/internal/cmd/service/start/controller/start_controller_cmd.go @@ -45,6 +45,8 @@ import ( "github.com/osac-project/fulfillment-service/internal/controllers/organization" "github.com/osac-project/fulfillment-service/internal/controllers/publicip" "github.com/osac-project/fulfillment-service/internal/controllers/publicippool" + "github.com/osac-project/fulfillment-service/internal/controllers/role" + "github.com/osac-project/fulfillment-service/internal/controllers/rolebinding" "github.com/osac-project/fulfillment-service/internal/controllers/securitygroup" "github.com/osac-project/fulfillment-service/internal/controllers/subnet" "github.com/osac-project/fulfillment-service/internal/controllers/virtualnetwork" @@ -617,6 +619,78 @@ func (r *runnerContext) run(cmd *cobra.Command, argv []string) error { } }() + // Create the role reconciler: + r.logger.InfoContext(ctx, "Creating role reconciler") + roleReconcilerFunction, err := role.NewFunction(). + SetLogger(r.logger). + SetConnection(r.client). + Build() + if err != nil { + return fmt.Errorf("failed to create role reconciler function: %w", err) + } + roleReconciler, err := controllers.NewReconciler[*privatev1.Role](). + SetLogger(r.logger). + SetName("role"). + SetClient(r.client). + SetFunction(roleReconcilerFunction.Run). + SetEventFilter("has(event.role)"). + SetHealthReporter(healthAggregator). + Build() + if err != nil { + return fmt.Errorf("failed to create role reconciler: %w", err) + } + + // Start the role reconciler: + r.logger.InfoContext(ctx, "Starting role reconciler") + go func() { + err := roleReconciler.Start(ctx) + if err == nil || errors.Is(err, context.Canceled) { + r.logger.InfoContext(ctx, "Role reconciler finished") + } else { + r.logger.InfoContext( + ctx, + "Role reconciler failed", + slog.Any("error", err), + ) + } + }() + + // Create the role binding reconciler: + r.logger.InfoContext(ctx, "Creating role binding reconciler") + roleBindingReconcilerFunction, err := rolebinding.NewFunction(). + SetLogger(r.logger). + SetConnection(r.client). + Build() + if err != nil { + return fmt.Errorf("failed to create role binding reconciler function: %w", err) + } + roleBindingReconciler, err := controllers.NewReconciler[*privatev1.RoleBinding](). + SetLogger(r.logger). + SetName("role_binding"). + SetClient(r.client). + SetFunction(roleBindingReconcilerFunction.Run). + SetEventFilter("has(event.role_binding)"). + SetHealthReporter(healthAggregator). + Build() + if err != nil { + return fmt.Errorf("failed to create role binding reconciler: %w", err) + } + + // Start the role binding reconciler: + r.logger.InfoContext(ctx, "Starting role binding reconciler") + go func() { + err := roleBindingReconciler.Start(ctx) + if err == nil || errors.Is(err, context.Canceled) { + r.logger.InfoContext(ctx, "Role binding reconciler finished") + } else { + r.logger.InfoContext( + ctx, + "Role binding reconciler failed", + slog.Any("error", err), + ) + } + }() + // Create the organization reconciler if IDP is configured: if idpManager != nil { r.logger.InfoContext(ctx, "Creating organization reconciler") diff --git a/internal/controllers/role/role_reconciler_function.go b/internal/controllers/role/role_reconciler_function.go new file mode 100644 index 000000000..e11be5b18 --- /dev/null +++ b/internal/controllers/role/role_reconciler_function.go @@ -0,0 +1,177 @@ +/* +Copyright (c) 2026 Red Hat Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. +*/ + +package role + +import ( + "context" + "errors" + "log/slog" + "slices" + + "google.golang.org/grpc" + "google.golang.org/protobuf/proto" + + privatev1 "github.com/osac-project/fulfillment-service/internal/api/osac/private/v1" + "github.com/osac-project/fulfillment-service/internal/controllers/finalizers" + "github.com/osac-project/fulfillment-service/internal/masks" +) + +// FunctionBuilder contains the data needed to build instances of the reconciler function. +type FunctionBuilder struct { + logger *slog.Logger + connection *grpc.ClientConn +} + +// NewFunction creates a builder that can be used to configure and create reconciler functions. +func NewFunction() *FunctionBuilder { + return &FunctionBuilder{} +} + +// SetLogger sets the logger that the reconciler will use to write log messages. +func (b *FunctionBuilder) SetLogger(value *slog.Logger) *FunctionBuilder { + b.logger = value + return b +} + +// SetConnection sets the gRPC connection that the reconciler will use to communicate with the API server. +func (b *FunctionBuilder) SetConnection(value *grpc.ClientConn) *FunctionBuilder { + b.connection = value + return b +} + +// Build uses the data stored in the builder to create and configure a new reconciler function. +func (b *FunctionBuilder) Build() (result *function, err error) { + if b.logger == nil { + err = errors.New("logger is mandatory") + return + } + if b.connection == nil { + err = errors.New("connection is mandatory") + return + } + + result = &function{ + logger: b.logger, + rolesClient: privatev1.NewRolesClient(b.connection), + maskCalculator: masks.NewCalculator(). + Build(), + } + return +} + +// function is the implementation of the reconciler function. +type function struct { + logger *slog.Logger + rolesClient privatev1.RolesClient + maskCalculator *masks.Calculator +} + +// Run executes the reconciliation logic for the given role. +func (r *function) Run(ctx context.Context, role *privatev1.Role) error { + oldRole := proto.Clone(role).(*privatev1.Role) + + task := &task{ + r: r, + role: role, + } + + var err error + if role.HasMetadata() && role.GetMetadata().HasDeletionTimestamp() { + err = task.delete(ctx) + } else { + err = task.update(ctx) + } + if err != nil { + return err + } + + updateMask := r.maskCalculator.Calculate(oldRole, role) + + if len(updateMask.GetPaths()) > 0 { + _, err = r.rolesClient.Update(ctx, privatev1.RolesUpdateRequest_builder{ + Object: role, + UpdateMask: updateMask, + }.Build()) + } + + return err +} + +// task contains the data needed to reconcile a single role. +type task struct { + r *function + role *privatev1.Role +} + +func (t *task) update(ctx context.Context) error { + if t.addFinalizer() { + return nil + } + + t.setDefaults() + + t.r.logger.InfoContext( + ctx, + "Reconciling role", + slog.Any("role", t.role), + ) + + return nil +} + +func (t *task) delete(ctx context.Context) error { + t.r.logger.InfoContext( + ctx, + "Reconciling deleted role", + slog.Any("role", t.role), + ) + + t.removeFinalizer() + return nil +} + +func (t *task) setDefaults() { + if !t.role.HasStatus() { + t.role.SetStatus(&privatev1.RoleStatus{}) + } + if t.role.GetStatus().GetState() == privatev1.RoleState_ROLE_STATE_UNSPECIFIED { + t.role.GetStatus().SetState(privatev1.RoleState_ROLE_STATE_PENDING) + } +} + +func (t *task) addFinalizer() bool { + if !t.role.HasMetadata() { + t.role.SetMetadata(&privatev1.Metadata{}) + } + list := t.role.GetMetadata().GetFinalizers() + if !slices.Contains(list, finalizers.Controller) { + list = append(list, finalizers.Controller) + t.role.GetMetadata().SetFinalizers(list) + return true + } + return false +} + +func (t *task) removeFinalizer() { + if !t.role.HasMetadata() { + return + } + list := t.role.GetMetadata().GetFinalizers() + if slices.Contains(list, finalizers.Controller) { + list = slices.DeleteFunc(list, func(item string) bool { + return item == finalizers.Controller + }) + t.role.GetMetadata().SetFinalizers(list) + } +} diff --git a/internal/controllers/rolebinding/role_binding_reconciler_function.go b/internal/controllers/rolebinding/role_binding_reconciler_function.go new file mode 100644 index 000000000..24ccfca2e --- /dev/null +++ b/internal/controllers/rolebinding/role_binding_reconciler_function.go @@ -0,0 +1,177 @@ +/* +Copyright (c) 2026 Red Hat Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. +*/ + +package rolebinding + +import ( + "context" + "errors" + "log/slog" + "slices" + + "google.golang.org/grpc" + "google.golang.org/protobuf/proto" + + privatev1 "github.com/osac-project/fulfillment-service/internal/api/osac/private/v1" + "github.com/osac-project/fulfillment-service/internal/controllers/finalizers" + "github.com/osac-project/fulfillment-service/internal/masks" +) + +// FunctionBuilder contains the data needed to build instances of the reconciler function. +type FunctionBuilder struct { + logger *slog.Logger + connection *grpc.ClientConn +} + +// NewFunction creates a builder that can be used to configure and create reconciler functions. +func NewFunction() *FunctionBuilder { + return &FunctionBuilder{} +} + +// SetLogger sets the logger that the reconciler will use to write log messages. +func (b *FunctionBuilder) SetLogger(value *slog.Logger) *FunctionBuilder { + b.logger = value + return b +} + +// SetConnection sets the gRPC connection that the reconciler will use to communicate with the API server. +func (b *FunctionBuilder) SetConnection(value *grpc.ClientConn) *FunctionBuilder { + b.connection = value + return b +} + +// Build uses the data stored in the builder to create and configure a new reconciler function. +func (b *FunctionBuilder) Build() (result *function, err error) { + if b.logger == nil { + err = errors.New("logger is mandatory") + return + } + if b.connection == nil { + err = errors.New("connection is mandatory") + return + } + + result = &function{ + logger: b.logger, + roleBindingsClient: privatev1.NewRoleBindingsClient(b.connection), + maskCalculator: masks.NewCalculator(). + Build(), + } + return +} + +// function is the implementation of the reconciler function. +type function struct { + logger *slog.Logger + roleBindingsClient privatev1.RoleBindingsClient + maskCalculator *masks.Calculator +} + +// Run executes the reconciliation logic for the given role binding. +func (r *function) Run(ctx context.Context, binding *privatev1.RoleBinding) error { + oldBinding := proto.Clone(binding).(*privatev1.RoleBinding) + + task := &task{ + r: r, + binding: binding, + } + + var err error + if binding.HasMetadata() && binding.GetMetadata().HasDeletionTimestamp() { + err = task.delete(ctx) + } else { + err = task.update(ctx) + } + if err != nil { + return err + } + + updateMask := r.maskCalculator.Calculate(oldBinding, binding) + + if len(updateMask.GetPaths()) > 0 { + _, err = r.roleBindingsClient.Update(ctx, privatev1.RoleBindingsUpdateRequest_builder{ + Object: binding, + UpdateMask: updateMask, + }.Build()) + } + + return err +} + +// task contains the data needed to reconcile a single role binding. +type task struct { + r *function + binding *privatev1.RoleBinding +} + +func (t *task) update(ctx context.Context) error { + if t.addFinalizer() { + return nil + } + + t.setDefaults() + + t.r.logger.InfoContext( + ctx, + "Reconciling role binding", + slog.Any("role_binding", t.binding), + ) + + return nil +} + +func (t *task) delete(ctx context.Context) error { + t.r.logger.InfoContext( + ctx, + "Reconciling deleted role binding", + slog.Any("role_binding", t.binding), + ) + + t.removeFinalizer() + return nil +} + +func (t *task) setDefaults() { + if !t.binding.HasStatus() { + t.binding.SetStatus(&privatev1.RoleBindingStatus{}) + } + if t.binding.GetStatus().GetState() == privatev1.RoleBindingState_ROLE_BINDING_STATE_UNSPECIFIED { + t.binding.GetStatus().SetState(privatev1.RoleBindingState_ROLE_BINDING_STATE_PENDING) + } +} + +func (t *task) addFinalizer() bool { + if !t.binding.HasMetadata() { + t.binding.SetMetadata(&privatev1.Metadata{}) + } + list := t.binding.GetMetadata().GetFinalizers() + if !slices.Contains(list, finalizers.Controller) { + list = append(list, finalizers.Controller) + t.binding.GetMetadata().SetFinalizers(list) + return true + } + return false +} + +func (t *task) removeFinalizer() { + if !t.binding.HasMetadata() { + return + } + list := t.binding.GetMetadata().GetFinalizers() + if slices.Contains(list, finalizers.Controller) { + list = slices.DeleteFunc(list, func(item string) bool { + return item == finalizers.Controller + }) + t.binding.GetMetadata().SetFinalizers(list) + } +} diff --git a/internal/servers/events_server.go b/internal/servers/events_server.go index a399e22f6..88a8798a6 100644 --- a/internal/servers/events_server.go +++ b/internal/servers/events_server.go @@ -330,7 +330,7 @@ func (s *EventsServer) processPayload(ctx context.Context, payload proto.Message return nil } - // Skip object that don't have a public representtion: + // Skip objects that don't have a public representation: if private.HasHub() { return nil } @@ -407,6 +407,10 @@ func (s *EventsServer) extractMetadata(ctx context.Context, event *privatev1.Eve return event.GetOrganization().GetMetadata() case event.HasUser(): return event.GetUser().GetMetadata() + case event.HasRole(): + return event.GetRole().GetMetadata() + case event.HasRoleBinding(): + return event.GetRoleBinding().GetMetadata() default: s.logger.ErrorContext( ctx, diff --git a/internal/servers/generic_server.go b/internal/servers/generic_server.go index f4a45533f..602a18d0a 100644 --- a/internal/servers/generic_server.go +++ b/internal/servers/generic_server.go @@ -850,6 +850,10 @@ func (s *GenericServer[O]) setPayload(event *privatev1.Event, object proto.Messa event.SetOrganization(object) case *privatev1.User: event.SetUser(object) + case *privatev1.Role: + event.SetRole(object) + case *privatev1.RoleBinding: + event.SetRoleBinding(object) default: return fmt.Errorf("unknown object type '%T'", object) } diff --git a/it/it_role_binding_reconciler_test.go b/it/it_role_binding_reconciler_test.go new file mode 100644 index 000000000..7128acf47 --- /dev/null +++ b/it/it_role_binding_reconciler_test.go @@ -0,0 +1,138 @@ +/* +Copyright (c) 2026 Red Hat Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. +*/ + +package it + +import ( + "context" + "fmt" + "time" + + . "github.com/onsi/ginkgo/v2/dsl/core" + . "github.com/onsi/gomega" + grpccodes "google.golang.org/grpc/codes" + grpcstatus "google.golang.org/grpc/status" + + privatev1 "github.com/osac-project/fulfillment-service/internal/api/osac/private/v1" + "github.com/osac-project/fulfillment-service/internal/controllers/finalizers" + "github.com/osac-project/fulfillment-service/internal/uuid" +) + +var _ = Describe("Role binding reconciler", func() { + var ( + ctx context.Context + client privatev1.RoleBindingsClient + ) + + BeforeEach(func() { + ctx = context.Background() + client = privatev1.NewRoleBindingsClient(tool.InternalView().AdminConn()) + }) + + It("Adds the finalizer and sets the default state when a role binding is created", func() { + // Create the role binding and remember to delete it after the test: + createResponse, err := client.Create(ctx, privatev1.RoleBindingsCreateRequest_builder{ + Object: privatev1.RoleBinding_builder{ + Metadata: privatev1.Metadata_builder{ + Name: fmt.Sprintf("my-%s", uuid.New()), + }.Build(), + Spec: privatev1.RoleBindingSpec_builder{ + Role: "my-role", + Groups: []string{ + "my-group", + }, + }.Build(), + }.Build(), + }.Build()) + Expect(err).ToNot(HaveOccurred()) + id := createResponse.GetObject().GetId() + DeferCleanup(func() { + _, _ = client.Delete(ctx, privatev1.RoleBindingsDeleteRequest_builder{ + Id: id, + }.Build()) + }) + + // Verify that reconciler eventually adds the finalizer and sets the default state: + Eventually( + func(g Gomega) { + getResponse, err := client.Get(ctx, privatev1.RoleBindingsGetRequest_builder{ + Id: id, + }.Build()) + g.Expect(err).ToNot(HaveOccurred()) + object := getResponse.GetObject() + g.Expect(object.GetMetadata().GetFinalizers()).To(ContainElement(finalizers.Controller)) + g.Expect(object.GetStatus().GetState()).To( + Equal(privatev1.RoleBindingState_ROLE_BINDING_STATE_PENDING), + ) + }, + time.Minute, + time.Second, + ).Should(Succeed()) + }) + + It("Removes the finalizer and deletes the role binding when it is deleted", func() { + // Create the role binding: + createResponse, err := client.Create(ctx, privatev1.RoleBindingsCreateRequest_builder{ + Object: privatev1.RoleBinding_builder{ + Metadata: privatev1.Metadata_builder{ + Name: fmt.Sprintf("my-%s", uuid.New()), + }.Build(), + Spec: privatev1.RoleBindingSpec_builder{ + Role: "my-role", + Groups: []string{ + "my-group", + }, + }.Build(), + }.Build(), + }.Build()) + Expect(err).ToNot(HaveOccurred()) + id := createResponse.GetObject().GetId() + + // Wait for the reconciler to add the finalizer before deleting, as otherwise it would be deleted + // immediately by the server without going through the reconciler. + Eventually( + func(g Gomega) { + getResponse, err := client.Get(ctx, privatev1.RoleBindingsGetRequest_builder{ + Id: id, + }.Build()) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(getResponse.GetObject().GetMetadata().GetFinalizers()).To( + ContainElement(finalizers.Controller), + ) + }, + time.Minute, + time.Second, + ).Should(Succeed()) + + // Delete the role binding: + _, err = client.Delete(ctx, privatev1.RoleBindingsDeleteRequest_builder{ + Id: id, + }.Build()) + Expect(err).ToNot(HaveOccurred()) + + // Verify the role binding eventually disappears: + Eventually( + func(g Gomega) { + _, err := client.Get(ctx, privatev1.RoleBindingsGetRequest_builder{ + Id: id, + }.Build()) + g.Expect(err).To(HaveOccurred()) + status, ok := grpcstatus.FromError(err) + g.Expect(ok).To(BeTrue()) + g.Expect(status.Code()).To(Equal(grpccodes.NotFound)) + }, + time.Minute, + time.Second, + ).Should(Succeed()) + }) +}) diff --git a/it/it_role_reconciler_test.go b/it/it_role_reconciler_test.go new file mode 100644 index 000000000..3ffe80802 --- /dev/null +++ b/it/it_role_reconciler_test.go @@ -0,0 +1,132 @@ +/* +Copyright (c) 2026 Red Hat Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. +*/ + +package it + +import ( + "context" + "fmt" + "time" + + . "github.com/onsi/ginkgo/v2/dsl/core" + . "github.com/onsi/gomega" + grpccodes "google.golang.org/grpc/codes" + grpcstatus "google.golang.org/grpc/status" + + privatev1 "github.com/osac-project/fulfillment-service/internal/api/osac/private/v1" + "github.com/osac-project/fulfillment-service/internal/controllers/finalizers" + "github.com/osac-project/fulfillment-service/internal/uuid" +) + +var _ = Describe("Role reconciler", func() { + var ( + ctx context.Context + client privatev1.RolesClient + ) + + BeforeEach(func() { + ctx = context.Background() + client = privatev1.NewRolesClient(tool.InternalView().AdminConn()) + }) + + It("Adds the finalizer and sets the default state when a role is created", func() { + // Create the role and remember to delete it after the test: + createResponse, err := client.Create(ctx, privatev1.RolesCreateRequest_builder{ + Object: privatev1.Role_builder{ + Metadata: privatev1.Metadata_builder{ + Name: fmt.Sprintf("my-%s", uuid.New()), + }.Build(), + Spec: privatev1.RoleSpec_builder{ + Title: "My role", + Description: "My role.", + }.Build(), + }.Build(), + }.Build()) + Expect(err).ToNot(HaveOccurred()) + id := createResponse.GetObject().GetId() + DeferCleanup(func() { + _, _ = client.Delete(ctx, privatev1.RolesDeleteRequest_builder{ + Id: id, + }.Build()) + }) + + // Verify that reconciler eventually adds the finalizer and sets the default state: + Eventually( + func(g Gomega) { + getResponse, err := client.Get(ctx, privatev1.RolesGetRequest_builder{ + Id: id, + }.Build()) + g.Expect(err).ToNot(HaveOccurred()) + object := getResponse.GetObject() + g.Expect(object.GetMetadata().GetFinalizers()).To(ContainElement(finalizers.Controller)) + g.Expect(object.GetStatus().GetState()).To(Equal(privatev1.RoleState_ROLE_STATE_PENDING)) + }, + time.Minute, + time.Second, + ).Should(Succeed()) + }) + + It("Removes the finalizer and deletes the role when it is deleted", func() { + // Create the role: + createResponse, err := client.Create(ctx, privatev1.RolesCreateRequest_builder{ + Object: privatev1.Role_builder{ + Metadata: privatev1.Metadata_builder{ + Name: fmt.Sprintf("my-%s", uuid.New()), + }.Build(), + Spec: privatev1.RoleSpec_builder{ + Title: "My role", + Description: "My role.", + }.Build(), + }.Build(), + }.Build()) + Expect(err).ToNot(HaveOccurred()) + id := createResponse.GetObject().GetId() + + // Wait for the reconciler to add the finalizer before deleting, as otherwise it would be deleted + // immediately by the server without going through the reconciler. + Eventually( + func(g Gomega) { + getResponse, err := client.Get(ctx, privatev1.RolesGetRequest_builder{ + Id: id, + }.Build()) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(getResponse.GetObject().GetMetadata().GetFinalizers()).To( + ContainElement(finalizers.Controller), + ) + }, + time.Minute, + time.Second, + ).Should(Succeed()) + + // Delete the role: + _, err = client.Delete(ctx, privatev1.RolesDeleteRequest_builder{ + Id: id, + }.Build()) + Expect(err).ToNot(HaveOccurred()) + + // Verify that the role eventually disappears from the API: + Eventually( + func(g Gomega) { + _, err := client.Get(ctx, privatev1.RolesGetRequest_builder{ + Id: id, + }.Build()) + g.Expect(err).To(HaveOccurred()) + status, ok := grpcstatus.FromError(err) + g.Expect(ok).To(BeTrue()) + g.Expect(status.Code()).To(Equal(grpccodes.NotFound)) + }, + time.Minute, + time.Second, + ).Should(Succeed()) + }) +}) diff --git a/it/it_roles_test.go b/it/it_roles_test.go index acb6d0322..7aff464ad 100644 --- a/it/it_roles_test.go +++ b/it/it_roles_test.go @@ -37,9 +37,19 @@ var _ = Describe("Roles", func() { publicClient = publicv1.NewRolesClient(tool.ExternalView().UserConn()) }) - Describe("Private API (admin)", func() { + Describe("Private API", func() { It("Can list built-in roles", func() { - listResponse, err := privateClient.List(ctx, privatev1.RolesListRequest_builder{}.Build()) + listResponse, err := privateClient.List(ctx, privatev1.RolesListRequest_builder{ + Filter: proto.String(` + this.metadata.name in [ + 'cloud-provider-admin', + 'cloud-provider-reader', + 'tenant-admin', + 'tenant-reader', + 'tenant-user', + ] + `), + }.Build()) Expect(err).ToNot(HaveOccurred()) Expect(listResponse).ToNot(BeNil()) items := listResponse.GetItems() @@ -83,9 +93,19 @@ var _ = Describe("Roles", func() { }) }) - Describe("Public API (regular user)", func() { + Describe("Public API", func() { It("Can list built-in roles", func() { - listResponse, err := publicClient.List(ctx, publicv1.RolesListRequest_builder{}.Build()) + listResponse, err := publicClient.List(ctx, publicv1.RolesListRequest_builder{ + Filter: proto.String(` + this.metadata.name in [ + 'cloud-provider-admin', + 'cloud-provider-reader', + 'tenant-admin', + 'tenant-reader', + 'tenant-user', + ] + `), + }.Build()) Expect(err).ToNot(HaveOccurred()) Expect(listResponse).ToNot(BeNil()) items := listResponse.GetItems() diff --git a/proto/private/osac/private/v1/event_type.proto b/proto/private/osac/private/v1/event_type.proto index 32ff1a014..a293aa4e7 100644 --- a/proto/private/osac/private/v1/event_type.proto +++ b/proto/private/osac/private/v1/event_type.proto @@ -26,6 +26,8 @@ import "osac/private/v1/network_class_type.proto"; import "osac/private/v1/organization_type.proto"; import "osac/private/v1/public_ip_pool_type.proto"; import "osac/private/v1/public_ip_type.proto"; +import "osac/private/v1/role_binding_type.proto"; +import "osac/private/v1/role_type.proto"; import "osac/private/v1/security_group_type.proto"; import "osac/private/v1/subnet_type.proto"; import "osac/private/v1/user_type.proto"; @@ -56,6 +58,8 @@ message Event { PublicIP public_ip = 17; Organization organization = 18; User user = 19; + Role role = 20; + RoleBinding role_binding = 21; } } diff --git a/proto/public/osac/public/v1/event_type.proto b/proto/public/osac/public/v1/event_type.proto index c17f868b5..8c78ed875 100644 --- a/proto/public/osac/public/v1/event_type.proto +++ b/proto/public/osac/public/v1/event_type.proto @@ -20,6 +20,8 @@ import "osac/public/v1/cluster_type.proto"; import "osac/public/v1/compute_instance_template_type.proto"; import "osac/public/v1/compute_instance_type.proto"; import "osac/public/v1/host_type_type.proto"; +import "osac/public/v1/role_binding_type.proto"; +import "osac/public/v1/role_type.proto"; // Represents events delivered by the server. message Event { @@ -36,6 +38,8 @@ message Event { HostType host_type = 5; ComputeInstanceTemplate compute_instance_template = 7; ComputeInstance compute_instance = 8; + Role role = 9; + RoleBinding role_binding = 10; } }