From f900be450903e1c5bf87e558aec39c9a9d7316ba Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Fri, 10 Oct 2025 12:45:52 +0200 Subject: [PATCH 1/5] add updated at Signed-off-by: Miguel Martinez --- .../controlplane/v1/response_messages.pb.go | 241 +++++++++--------- .../controlplane/v1/response_messages.proto | 3 +- .../controlplane/v1/response_messages.ts | 15 ++ .../frontend/google/protobuf/descriptor.ts | 16 +- ...rolplane.v1.CASBackendItem.jsonschema.json | 6 + ...controlplane.v1.CASBackendItem.schema.json | 6 + .../internal/service/casbackend.go | 3 +- app/controlplane/pkg/biz/casbackend.go | 4 +- app/controlplane/pkg/data/casbackend.go | 6 +- app/controlplane/pkg/data/ent/casbackend.go | 13 +- .../pkg/data/ent/casbackend/casbackend.go | 10 + .../pkg/data/ent/casbackend/where.go | 45 ++++ .../pkg/data/ent/casbackend_create.go | 65 +++++ .../pkg/data/ent/casbackend_update.go | 34 +++ .../ent/migrate/migrations/20251009210727.sql | 7 + .../pkg/data/ent/migrate/migrations/atlas.sum | 3 +- .../pkg/data/ent/migrate/schema.go | 5 +- app/controlplane/pkg/data/ent/mutation.go | 56 +++- app/controlplane/pkg/data/ent/runtime.go | 10 +- .../pkg/data/ent/schema/casbackend.go | 5 +- 20 files changed, 418 insertions(+), 135 deletions(-) create mode 100644 app/controlplane/pkg/data/ent/migrate/migrations/20251009210727.sql diff --git a/app/controlplane/api/controlplane/v1/response_messages.pb.go b/app/controlplane/api/controlplane/v1/response_messages.pb.go index d29b0202a..19ca21d33 100644 --- a/app/controlplane/api/controlplane/v1/response_messages.pb.go +++ b/app/controlplane/api/controlplane/v1/response_messages.pb.go @@ -1,5 +1,5 @@ // -// Copyright 2024 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1954,7 +1954,8 @@ type CASBackendItem struct { // inline means that the content is stored in the attestation itself IsInline bool `protobuf:"varint,10,opt,name=is_inline,json=isInline,proto3" json:"is_inline,omitempty"` // Error message if validation failed - ValidationError *string `protobuf:"bytes,12,opt,name=validation_error,json=validationError,proto3,oneof" json:"validation_error,omitempty"` + ValidationError *string `protobuf:"bytes,12,opt,name=validation_error,json=validationError,proto3,oneof" json:"validation_error,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` } func (x *CASBackendItem) Reset() { @@ -2073,6 +2074,13 @@ func (x *CASBackendItem) GetValidationError() string { return "" } +func (x *CASBackendItem) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + type APITokenItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2947,7 +2955,7 @@ var file_controlplane_v1_response_messages_proto_rawDesc = []byte{ 0x12, 0x2f, 0x0a, 0x2b, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x56, 0x49, 0x4f, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x41, 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x59, 0x10, - 0x02, 0x22, 0xba, 0x05, 0x0a, 0x0e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x02, 0x22, 0xf5, 0x05, 0x0a, 0x0e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, @@ -2980,106 +2988,110 @@ var file_controlplane_v1_response_messages_proto_rawDesc = []byte{ 0x6e, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x88, - 0x01, 0x01, 0x1a, 0x25, 0x0a, 0x06, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x08, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, - 0x1d, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x18, 0x0a, 0x14, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xdd, - 0x03, 0x0a, 0x0c, 0x41, 0x50, 0x49, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2b, - 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x52, 0x0c, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x72, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x01, 0x01, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x25, 0x0a, + 0x06, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x1d, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x10, 0x02, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xdd, 0x03, 0x0a, 0x0c, 0x41, 0x50, + 0x49, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x64, + 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x63, 0x6f, 0x70, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x72, 0x65, 0x76, 0x6f, - 0x6b, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, - 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, - 0x12, 0x3c, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x73, 0x65, 0x64, 0x41, 0x74, 0x2a, 0xa6, - 0x01, 0x0a, 0x09, 0x52, 0x75, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x16, - 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x55, 0x4e, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, 0x5a, - 0x45, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x02, 0x12, 0x15, - 0x0a, 0x11, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, - 0x4c, 0x45, 0x44, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x04, 0x12, 0x18, 0x0a, - 0x14, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, - 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x2a, 0xd4, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x45, - 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, - 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, - 0x52, 0x47, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x4d, - 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, - 0x52, 0x47, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x45, - 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, - 0x47, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x45, 0x4d, - 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, - 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x04, 0x12, 0x23, 0x0a, 0x1f, 0x4d, 0x45, 0x4d, - 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, - 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x10, 0x05, 0x2a, 0x60, - 0x0a, 0x0e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x26, 0x0a, 0x1c, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4c, 0x49, 0x53, 0x54, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x5f, 0x4c, 0x49, - 0x53, 0x54, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, - 0x2a, 0x6d, 0x0a, 0x12, 0x46, 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x75, 0x74, - 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x20, 0x46, 0x45, 0x44, 0x45, 0x52, 0x41, - 0x54, 0x45, 0x44, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2b, 0x0a, 0x21, - 0x46, 0x45, 0x44, 0x45, 0x52, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x49, 0x5a, 0x45, - 0x44, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x2a, - 0x84, 0x01, 0x0a, 0x19, 0x55, 0x73, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2d, 0x0a, - 0x29, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x4e, 0x4f, 0x5f, 0x4d, 0x45, - 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x32, 0x0a, 0x28, - 0x55, 0x53, 0x45, 0x52, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x4e, 0x4f, 0x5f, 0x4d, 0x45, 0x4d, - 0x42, 0x45, 0x52, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, - 0x54, 0x5f, 0x49, 0x4e, 0x5f, 0x4f, 0x52, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, - 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x2a, 0x80, 0x01, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x4e, - 0x6f, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4f, 0x72, 0x67, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x28, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, - 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x31, 0x0a, 0x27, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, 0x45, 0x4d, - 0x42, 0x45, 0x52, 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x5f, 0x4f, 0x52, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, - 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, + 0x61, 0x73, 0x74, 0x55, 0x73, 0x65, 0x64, 0x41, 0x74, 0x2a, 0xa6, 0x01, 0x0a, 0x09, 0x52, 0x75, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x55, 0x4e, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x49, 0x5a, 0x45, 0x44, 0x10, 0x01, 0x12, + 0x18, 0x0a, 0x14, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, + 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x55, 0x4e, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, + 0x12, 0x16, 0x0a, 0x12, 0x52, 0x55, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, + 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x55, 0x4e, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, + 0x10, 0x05, 0x2a, 0xd4, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, + 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, + 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x56, 0x49, + 0x45, 0x57, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, + 0x53, 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x41, 0x44, + 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, + 0x48, 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x4f, 0x57, 0x4e, + 0x45, 0x52, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, + 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x4d, 0x45, 0x4d, 0x42, + 0x45, 0x52, 0x10, 0x04, 0x12, 0x23, 0x0a, 0x1f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, + 0x49, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x54, + 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x10, 0x05, 0x2a, 0x60, 0x0a, 0x0e, 0x41, 0x6c, 0x6c, + 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x1c, 0x41, + 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x26, 0x0a, + 0x1c, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x01, 0x1a, + 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x2a, 0x6d, 0x0a, 0x12, 0x46, + 0x65, 0x64, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x24, 0x0a, 0x20, 0x46, 0x45, 0x44, 0x45, 0x52, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, + 0x55, 0x54, 0x48, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2b, 0x0a, 0x21, 0x46, 0x45, 0x44, 0x45, 0x52, + 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x55, 0x4e, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x49, 0x5a, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x04, + 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x2a, 0x84, 0x01, 0x0a, 0x19, 0x55, + 0x73, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2d, 0x0a, 0x29, 0x55, 0x53, 0x45, 0x52, + 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x4e, 0x4f, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, + 0x48, 0x49, 0x50, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x32, 0x0a, 0x28, 0x55, 0x53, 0x45, 0x52, 0x5f, + 0x57, 0x49, 0x54, 0x48, 0x5f, 0x4e, 0x4f, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53, 0x48, + 0x49, 0x50, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x5f, + 0x4f, 0x52, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, + 0x03, 0x2a, 0x80, 0x01, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x4f, 0x66, 0x4f, 0x72, 0x67, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2c, 0x0a, + 0x28, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, + 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x31, 0x0a, 0x27, 0x55, + 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x4f, + 0x46, 0x5f, 0x4f, 0x52, 0x47, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x49, 0x4e, 0x5f, 0x4f, 0x52, 0x47, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, + 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, + 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3184,19 +3196,20 @@ var file_controlplane_v1_response_messages_proto_depIdxs = []int32{ 37, // 42: controlplane.v1.CASBackendItem.validated_at:type_name -> google.protobuf.Timestamp 8, // 43: controlplane.v1.CASBackendItem.validation_status:type_name -> controlplane.v1.CASBackendItem.ValidationStatus 36, // 44: controlplane.v1.CASBackendItem.limits:type_name -> controlplane.v1.CASBackendItem.Limits - 18, // 45: controlplane.v1.APITokenItem.scoped_entity:type_name -> controlplane.v1.ScopedEntity - 37, // 46: controlplane.v1.APITokenItem.created_at:type_name -> google.protobuf.Timestamp - 37, // 47: controlplane.v1.APITokenItem.revoked_at:type_name -> google.protobuf.Timestamp - 37, // 48: controlplane.v1.APITokenItem.expires_at:type_name -> google.protobuf.Timestamp - 37, // 49: controlplane.v1.APITokenItem.last_used_at:type_name -> google.protobuf.Timestamp - 13, // 50: controlplane.v1.AttestationItem.PolicyEvaluationsEntry.value:type_name -> controlplane.v1.PolicyEvaluations - 31, // 51: controlplane.v1.AttestationItem.Material.annotations:type_name -> controlplane.v1.AttestationItem.Material.AnnotationsEntry - 6, // 52: controlplane.v1.WorkflowContractVersionItem.RawBody.format:type_name -> controlplane.v1.WorkflowContractVersionItem.RawBody.Format - 53, // [53:53] is the sub-list for method output_type - 53, // [53:53] is the sub-list for method input_type - 53, // [53:53] is the sub-list for extension type_name - 53, // [53:53] is the sub-list for extension extendee - 0, // [0:53] is the sub-list for field type_name + 37, // 45: controlplane.v1.CASBackendItem.updated_at:type_name -> google.protobuf.Timestamp + 18, // 46: controlplane.v1.APITokenItem.scoped_entity:type_name -> controlplane.v1.ScopedEntity + 37, // 47: controlplane.v1.APITokenItem.created_at:type_name -> google.protobuf.Timestamp + 37, // 48: controlplane.v1.APITokenItem.revoked_at:type_name -> google.protobuf.Timestamp + 37, // 49: controlplane.v1.APITokenItem.expires_at:type_name -> google.protobuf.Timestamp + 37, // 50: controlplane.v1.APITokenItem.last_used_at:type_name -> google.protobuf.Timestamp + 13, // 51: controlplane.v1.AttestationItem.PolicyEvaluationsEntry.value:type_name -> controlplane.v1.PolicyEvaluations + 31, // 52: controlplane.v1.AttestationItem.Material.annotations:type_name -> controlplane.v1.AttestationItem.Material.AnnotationsEntry + 6, // 53: controlplane.v1.WorkflowContractVersionItem.RawBody.format:type_name -> controlplane.v1.WorkflowContractVersionItem.RawBody.Format + 54, // [54:54] is the sub-list for method output_type + 54, // [54:54] is the sub-list for method input_type + 54, // [54:54] is the sub-list for extension type_name + 54, // [54:54] is the sub-list for extension extendee + 0, // [0:54] is the sub-list for field type_name } func init() { file_controlplane_v1_response_messages_proto_init() } diff --git a/app/controlplane/api/controlplane/v1/response_messages.proto b/app/controlplane/api/controlplane/v1/response_messages.proto index 29de94e80..56e0f90c9 100644 --- a/app/controlplane/api/controlplane/v1/response_messages.proto +++ b/app/controlplane/api/controlplane/v1/response_messages.proto @@ -1,5 +1,5 @@ // -// Copyright 2024 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -294,6 +294,7 @@ message CASBackendItem { bool is_inline = 10; // Error message if validation failed optional string validation_error = 12; + google.protobuf.Timestamp updated_at = 13; message Limits { // Max number of bytes allowed to be stored in this backend diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts b/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts index e006fa365..473318dad 100644 --- a/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts +++ b/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts @@ -621,6 +621,7 @@ export interface CASBackendItem { isInline: boolean; /** Error message if validation failed */ validationError?: string | undefined; + updatedAt?: Date; } export enum CASBackendItem_ValidationStatus { @@ -3816,6 +3817,7 @@ function createBaseCASBackendItem(): CASBackendItem { limits: undefined, isInline: false, validationError: undefined, + updatedAt: undefined, }; } @@ -3857,6 +3859,9 @@ export const CASBackendItem = { if (message.validationError !== undefined) { writer.uint32(98).string(message.validationError); } + if (message.updatedAt !== undefined) { + Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(106).fork()).ldelim(); + } return writer; }, @@ -3951,6 +3956,13 @@ export const CASBackendItem = { message.validationError = reader.string(); continue; + case 13: + if (tag !== 106) { + break; + } + + message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -3976,6 +3988,7 @@ export const CASBackendItem = { limits: isSet(object.limits) ? CASBackendItem_Limits.fromJSON(object.limits) : undefined, isInline: isSet(object.isInline) ? Boolean(object.isInline) : false, validationError: isSet(object.validationError) ? String(object.validationError) : undefined, + updatedAt: isSet(object.updatedAt) ? fromJsonTimestamp(object.updatedAt) : undefined, }; }, @@ -3995,6 +4008,7 @@ export const CASBackendItem = { (obj.limits = message.limits ? CASBackendItem_Limits.toJSON(message.limits) : undefined); message.isInline !== undefined && (obj.isInline = message.isInline); message.validationError !== undefined && (obj.validationError = message.validationError); + message.updatedAt !== undefined && (obj.updatedAt = message.updatedAt.toISOString()); return obj; }, @@ -4018,6 +4032,7 @@ export const CASBackendItem = { : undefined; message.isInline = object.isInline ?? false; message.validationError = object.validationError ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; return message; }, }; diff --git a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts index d59b21da4..0d2d2fb32 100644 --- a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts +++ b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts @@ -30,7 +30,7 @@ export enum Edition { EDITION_2024 = 1001, /** * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be - * used or relied on outside of tests. + * used or relyed on outside of tests. */ EDITION_1_TEST_ONLY = 1, EDITION_2_TEST_ONLY = 2, @@ -875,13 +875,12 @@ export interface MessageOptions { export interface FieldOptions { /** - * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific * options below. This option is only implemented to support use of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - * type "bytes" in the open source release. - * TODO: make ctype actually deprecated. + * type "bytes" in the open source release -- sorry, we'll try to include + * other types in a future version! */ ctype: FieldOptions_CType; /** @@ -1053,7 +1052,11 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { } } -/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + */ export enum FieldOptions_OptionRetention { RETENTION_UNKNOWN = 0, RETENTION_RUNTIME = 1, @@ -1096,7 +1099,8 @@ export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRe /** * This indicates the types of entities that the field may apply to when used * as an option. If it is unset, then the field may be freely used as an - * option on any kind of entity. + * option on any kind of entity. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). */ export enum FieldOptions_OptionTargetType { TARGET_TYPE_UNKNOWN = 0, diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.jsonschema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.jsonschema.json index 505cfb819..48ed1c727 100644 --- a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.jsonschema.json +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.jsonschema.json @@ -10,6 +10,9 @@ "description": "Is it an inline backend?\n inline means that the content is stored in the attestation itself", "type": "boolean" }, + "^(updated_at)$": { + "$ref": "google.protobuf.Timestamp.jsonschema.json" + }, "^(validated_at)$": { "$ref": "google.protobuf.Timestamp.jsonschema.json" }, @@ -69,6 +72,9 @@ "description": "OCI, S3, ...", "type": "string" }, + "updatedAt": { + "$ref": "google.protobuf.Timestamp.jsonschema.json" + }, "validatedAt": { "$ref": "google.protobuf.Timestamp.jsonschema.json" }, diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.schema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.schema.json index a14a5600b..159678404 100644 --- a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.schema.json +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendItem.schema.json @@ -10,6 +10,9 @@ "description": "Is it an inline backend?\n inline means that the content is stored in the attestation itself", "type": "boolean" }, + "^(updatedAt)$": { + "$ref": "google.protobuf.Timestamp.schema.json" + }, "^(validatedAt)$": { "$ref": "google.protobuf.Timestamp.schema.json" }, @@ -69,6 +72,9 @@ "description": "OCI, S3, ...", "type": "string" }, + "updated_at": { + "$ref": "google.protobuf.Timestamp.schema.json" + }, "validated_at": { "$ref": "google.protobuf.Timestamp.schema.json" }, diff --git a/app/controlplane/internal/service/casbackend.go b/app/controlplane/internal/service/casbackend.go index 44b97fe79..642292866 100644 --- a/app/controlplane/internal/service/casbackend.go +++ b/app/controlplane/internal/service/casbackend.go @@ -1,5 +1,5 @@ // -// Copyright 2023 The Chainloop Authors. +// Copyright 2023-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -169,6 +169,7 @@ func bizCASBackendToPb(in *biz.CASBackend) *pb.CASBackendItem { Id: in.ID.String(), Location: in.Location, Description: in.Description, Name: in.Name, CreatedAt: timestamppb.New(*in.CreatedAt), + UpdatedAt: timestamppb.New(*in.UpdatedAt), ValidatedAt: timestamppb.New(*in.ValidatedAt), Provider: string(in.Provider), Default: in.Default, diff --git a/app/controlplane/pkg/biz/casbackend.go b/app/controlplane/pkg/biz/casbackend.go index a07fcff5b..5b242b8ec 100644 --- a/app/controlplane/pkg/biz/casbackend.go +++ b/app/controlplane/pkg/biz/casbackend.go @@ -1,5 +1,5 @@ // -// Copyright 2024 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ type CASBackend struct { ID uuid.UUID Name string Location, Description, SecretName string - CreatedAt, ValidatedAt *time.Time + CreatedAt, UpdatedAt, ValidatedAt *time.Time OrganizationID uuid.UUID ValidationStatus CASBackendValidationStatus ValidationError *string diff --git a/app/controlplane/pkg/data/casbackend.go b/app/controlplane/pkg/data/casbackend.go index 99695f694..73fccaf1c 100644 --- a/app/controlplane/pkg/data/casbackend.go +++ b/app/controlplane/pkg/data/casbackend.go @@ -1,5 +1,5 @@ // -// Copyright 2024 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -150,7 +150,8 @@ func (r *CASBackendRepo) Update(ctx context.Context, opts *biz.CASBackendUpdateO // We do it in other models by providing pointers to string + setNillableX methods updateChain := tx.CASBackend.UpdateOneID(opts.ID). SetNillableDefault(opts.Default). - SetNillableDescription(opts.Description) + SetNillableDescription(opts.Description). + SetUpdatedAt(time.Now()) // If secretName is provided we set it if opts.SecretName != "" { @@ -296,6 +297,7 @@ func entCASBackendToBiz(backend *ent.CASBackend) *biz.CASBackend { Description: backend.Description, SecretName: backend.SecretName, CreatedAt: toTimePtr(backend.CreatedAt), + UpdatedAt: toTimePtr(backend.UpdatedAt), ValidatedAt: toTimePtr(backend.ValidatedAt), ValidationStatus: backend.ValidationStatus, ValidationError: toStringPtr(backend.ValidationError), diff --git a/app/controlplane/pkg/data/ent/casbackend.go b/app/controlplane/pkg/data/ent/casbackend.go index cc27b1c56..bc1225166 100644 --- a/app/controlplane/pkg/data/ent/casbackend.go +++ b/app/controlplane/pkg/data/ent/casbackend.go @@ -32,6 +32,8 @@ type CASBackend struct { SecretName string `json:"secret_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` // ValidationStatus holds the value of the "validation_status" field. ValidationStatus biz.CASBackendValidationStatus `json:"validation_status,omitempty"` // ValidationError holds the value of the "validation_error" field. @@ -95,7 +97,7 @@ func (*CASBackend) scanValues(columns []string) ([]any, error) { values[i] = new(sql.NullInt64) case casbackend.FieldLocation, casbackend.FieldName, casbackend.FieldProvider, casbackend.FieldDescription, casbackend.FieldSecretName, casbackend.FieldValidationStatus, casbackend.FieldValidationError: values[i] = new(sql.NullString) - case casbackend.FieldCreatedAt, casbackend.FieldValidatedAt, casbackend.FieldDeletedAt: + case casbackend.FieldCreatedAt, casbackend.FieldUpdatedAt, casbackend.FieldValidatedAt, casbackend.FieldDeletedAt: values[i] = new(sql.NullTime) case casbackend.FieldID: values[i] = new(uuid.UUID) @@ -158,6 +160,12 @@ func (cb *CASBackend) assignValues(columns []string, values []any) error { } else if value.Valid { cb.CreatedAt = value.Time } + case casbackend.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + cb.UpdatedAt = value.Time + } case casbackend.FieldValidationStatus: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field validation_status", values[i]) @@ -271,6 +279,9 @@ func (cb *CASBackend) String() string { builder.WriteString("created_at=") builder.WriteString(cb.CreatedAt.Format(time.ANSIC)) builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(cb.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") builder.WriteString("validation_status=") builder.WriteString(fmt.Sprintf("%v", cb.ValidationStatus)) builder.WriteString(", ") diff --git a/app/controlplane/pkg/data/ent/casbackend/casbackend.go b/app/controlplane/pkg/data/ent/casbackend/casbackend.go index 34c6b0615..5face6d31 100644 --- a/app/controlplane/pkg/data/ent/casbackend/casbackend.go +++ b/app/controlplane/pkg/data/ent/casbackend/casbackend.go @@ -29,6 +29,8 @@ const ( FieldSecretName = "secret_name" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" // FieldValidationStatus holds the string denoting the validation_status field in the database. FieldValidationStatus = "validation_status" // FieldValidationError holds the string denoting the validation_error field in the database. @@ -72,6 +74,7 @@ var Columns = []string{ FieldDescription, FieldSecretName, FieldCreatedAt, + FieldUpdatedAt, FieldValidationStatus, FieldValidationError, FieldValidatedAt, @@ -111,6 +114,8 @@ func ValidColumn(column string) bool { var ( // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time // DefaultValidatedAt holds the default value on creation for the "validated_at" field. DefaultValidatedAt func() time.Time // DefaultDefault holds the default value on creation for the "default" field. @@ -181,6 +186,11 @@ func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() } +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + // ByValidationStatus orders the results by the validation_status field. func ByValidationStatus(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldValidationStatus, opts...).ToFunc() diff --git a/app/controlplane/pkg/data/ent/casbackend/where.go b/app/controlplane/pkg/data/ent/casbackend/where.go index ced44f0d3..47e3f3a38 100644 --- a/app/controlplane/pkg/data/ent/casbackend/where.go +++ b/app/controlplane/pkg/data/ent/casbackend/where.go @@ -82,6 +82,11 @@ func CreatedAt(v time.Time) predicate.CASBackend { return predicate.CASBackend(sql.FieldEQ(FieldCreatedAt, v)) } +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldEQ(FieldUpdatedAt, v)) +} + // ValidationError applies equality check predicate on the "validation_error" field. It's identical to ValidationErrorEQ. func ValidationError(v string) predicate.CASBackend { return predicate.CASBackend(sql.FieldEQ(FieldValidationError, v)) @@ -452,6 +457,46 @@ func CreatedAtLTE(v time.Time) predicate.CASBackend { return predicate.CASBackend(sql.FieldLTE(FieldCreatedAt, v)) } +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.CASBackend { + return predicate.CASBackend(sql.FieldLTE(FieldUpdatedAt, v)) +} + // ValidationStatusEQ applies the EQ predicate on the "validation_status" field. func ValidationStatusEQ(v biz.CASBackendValidationStatus) predicate.CASBackend { vc := v diff --git a/app/controlplane/pkg/data/ent/casbackend_create.go b/app/controlplane/pkg/data/ent/casbackend_create.go index bede863a2..2cda3258d 100644 --- a/app/controlplane/pkg/data/ent/casbackend_create.go +++ b/app/controlplane/pkg/data/ent/casbackend_create.go @@ -79,6 +79,20 @@ func (cbc *CASBackendCreate) SetNillableCreatedAt(t *time.Time) *CASBackendCreat return cbc } +// SetUpdatedAt sets the "updated_at" field. +func (cbc *CASBackendCreate) SetUpdatedAt(t time.Time) *CASBackendCreate { + cbc.mutation.SetUpdatedAt(t) + return cbc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (cbc *CASBackendCreate) SetNillableUpdatedAt(t *time.Time) *CASBackendCreate { + if t != nil { + cbc.SetUpdatedAt(*t) + } + return cbc +} + // SetValidationStatus sets the "validation_status" field. func (cbc *CASBackendCreate) SetValidationStatus(bbvs biz.CASBackendValidationStatus) *CASBackendCreate { cbc.mutation.SetValidationStatus(bbvs) @@ -248,6 +262,10 @@ func (cbc *CASBackendCreate) defaults() { v := casbackend.DefaultCreatedAt() cbc.mutation.SetCreatedAt(v) } + if _, ok := cbc.mutation.UpdatedAt(); !ok { + v := casbackend.DefaultUpdatedAt() + cbc.mutation.SetUpdatedAt(v) + } if _, ok := cbc.mutation.ValidationStatus(); !ok { v := casbackend.DefaultValidationStatus cbc.mutation.SetValidationStatus(v) @@ -292,6 +310,9 @@ func (cbc *CASBackendCreate) check() error { if _, ok := cbc.mutation.CreatedAt(); !ok { return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "CASBackend.created_at"`)} } + if _, ok := cbc.mutation.UpdatedAt(); !ok { + return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "CASBackend.updated_at"`)} + } if _, ok := cbc.mutation.ValidationStatus(); !ok { return &ValidationError{Name: "validation_status", err: errors.New(`ent: missing required field "CASBackend.validation_status"`)} } @@ -375,6 +396,10 @@ func (cbc *CASBackendCreate) createSpec() (*CASBackend, *sqlgraph.CreateSpec) { _spec.SetField(casbackend.FieldCreatedAt, field.TypeTime, value) _node.CreatedAt = value } + if value, ok := cbc.mutation.UpdatedAt(); ok { + _spec.SetField(casbackend.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } if value, ok := cbc.mutation.ValidationStatus(); ok { _spec.SetField(casbackend.FieldValidationStatus, field.TypeEnum, value) _node.ValidationStatus = value @@ -518,6 +543,18 @@ func (u *CASBackendUpsert) UpdateSecretName() *CASBackendUpsert { return u } +// SetUpdatedAt sets the "updated_at" field. +func (u *CASBackendUpsert) SetUpdatedAt(v time.Time) *CASBackendUpsert { + u.Set(casbackend.FieldUpdatedAt, v) + return u +} + +// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create. +func (u *CASBackendUpsert) UpdateUpdatedAt() *CASBackendUpsert { + u.SetExcluded(casbackend.FieldUpdatedAt) + return u +} + // SetValidationStatus sets the "validation_status" field. func (u *CASBackendUpsert) SetValidationStatus(v biz.CASBackendValidationStatus) *CASBackendUpsert { u.Set(casbackend.FieldValidationStatus, v) @@ -706,6 +743,20 @@ func (u *CASBackendUpsertOne) UpdateSecretName() *CASBackendUpsertOne { }) } +// SetUpdatedAt sets the "updated_at" field. +func (u *CASBackendUpsertOne) SetUpdatedAt(v time.Time) *CASBackendUpsertOne { + return u.Update(func(s *CASBackendUpsert) { + s.SetUpdatedAt(v) + }) +} + +// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create. +func (u *CASBackendUpsertOne) UpdateUpdatedAt() *CASBackendUpsertOne { + return u.Update(func(s *CASBackendUpsert) { + s.UpdateUpdatedAt() + }) +} + // SetValidationStatus sets the "validation_status" field. func (u *CASBackendUpsertOne) SetValidationStatus(v biz.CASBackendValidationStatus) *CASBackendUpsertOne { return u.Update(func(s *CASBackendUpsert) { @@ -1076,6 +1127,20 @@ func (u *CASBackendUpsertBulk) UpdateSecretName() *CASBackendUpsertBulk { }) } +// SetUpdatedAt sets the "updated_at" field. +func (u *CASBackendUpsertBulk) SetUpdatedAt(v time.Time) *CASBackendUpsertBulk { + return u.Update(func(s *CASBackendUpsert) { + s.SetUpdatedAt(v) + }) +} + +// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create. +func (u *CASBackendUpsertBulk) UpdateUpdatedAt() *CASBackendUpsertBulk { + return u.Update(func(s *CASBackendUpsert) { + s.UpdateUpdatedAt() + }) +} + // SetValidationStatus sets the "validation_status" field. func (u *CASBackendUpsertBulk) SetValidationStatus(v biz.CASBackendValidationStatus) *CASBackendUpsertBulk { return u.Update(func(s *CASBackendUpsert) { diff --git a/app/controlplane/pkg/data/ent/casbackend_update.go b/app/controlplane/pkg/data/ent/casbackend_update.go index ee8d1c37b..300632cd1 100644 --- a/app/controlplane/pkg/data/ent/casbackend_update.go +++ b/app/controlplane/pkg/data/ent/casbackend_update.go @@ -67,6 +67,20 @@ func (cbu *CASBackendUpdate) SetNillableSecretName(s *string) *CASBackendUpdate return cbu } +// SetUpdatedAt sets the "updated_at" field. +func (cbu *CASBackendUpdate) SetUpdatedAt(t time.Time) *CASBackendUpdate { + cbu.mutation.SetUpdatedAt(t) + return cbu +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (cbu *CASBackendUpdate) SetNillableUpdatedAt(t *time.Time) *CASBackendUpdate { + if t != nil { + cbu.SetUpdatedAt(*t) + } + return cbu +} + // SetValidationStatus sets the "validation_status" field. func (cbu *CASBackendUpdate) SetValidationStatus(bbvs biz.CASBackendValidationStatus) *CASBackendUpdate { cbu.mutation.SetValidationStatus(bbvs) @@ -295,6 +309,9 @@ func (cbu *CASBackendUpdate) sqlSave(ctx context.Context) (n int, err error) { if value, ok := cbu.mutation.SecretName(); ok { _spec.SetField(casbackend.FieldSecretName, field.TypeString, value) } + if value, ok := cbu.mutation.UpdatedAt(); ok { + _spec.SetField(casbackend.FieldUpdatedAt, field.TypeTime, value) + } if value, ok := cbu.mutation.ValidationStatus(); ok { _spec.SetField(casbackend.FieldValidationStatus, field.TypeEnum, value) } @@ -452,6 +469,20 @@ func (cbuo *CASBackendUpdateOne) SetNillableSecretName(s *string) *CASBackendUpd return cbuo } +// SetUpdatedAt sets the "updated_at" field. +func (cbuo *CASBackendUpdateOne) SetUpdatedAt(t time.Time) *CASBackendUpdateOne { + cbuo.mutation.SetUpdatedAt(t) + return cbuo +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (cbuo *CASBackendUpdateOne) SetNillableUpdatedAt(t *time.Time) *CASBackendUpdateOne { + if t != nil { + cbuo.SetUpdatedAt(*t) + } + return cbuo +} + // SetValidationStatus sets the "validation_status" field. func (cbuo *CASBackendUpdateOne) SetValidationStatus(bbvs biz.CASBackendValidationStatus) *CASBackendUpdateOne { cbuo.mutation.SetValidationStatus(bbvs) @@ -710,6 +741,9 @@ func (cbuo *CASBackendUpdateOne) sqlSave(ctx context.Context) (_node *CASBackend if value, ok := cbuo.mutation.SecretName(); ok { _spec.SetField(casbackend.FieldSecretName, field.TypeString, value) } + if value, ok := cbuo.mutation.UpdatedAt(); ok { + _spec.SetField(casbackend.FieldUpdatedAt, field.TypeTime, value) + } if value, ok := cbuo.mutation.ValidationStatus(); ok { _spec.SetField(casbackend.FieldValidationStatus, field.TypeEnum, value) } diff --git a/app/controlplane/pkg/data/ent/migrate/migrations/20251009210727.sql b/app/controlplane/pkg/data/ent/migrate/migrations/20251009210727.sql new file mode 100644 index 000000000..9f33fcee6 --- /dev/null +++ b/app/controlplane/pkg/data/ent/migrate/migrations/20251009210727.sql @@ -0,0 +1,7 @@ +-- Modify "cas_backends" table +ALTER TABLE "cas_backends" ADD COLUMN "updated_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP; + +-- Backfill updated_at for existing records +-- Use validated_at if not null, otherwise use created_at +UPDATE "cas_backends" +SET "updated_at" = COALESCE("validated_at", "created_at"); diff --git a/app/controlplane/pkg/data/ent/migrate/migrations/atlas.sum b/app/controlplane/pkg/data/ent/migrate/migrations/atlas.sum index e0f184c23..d64f02009 100644 --- a/app/controlplane/pkg/data/ent/migrate/migrations/atlas.sum +++ b/app/controlplane/pkg/data/ent/migrate/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:SbJMyd1Na23ALCFwTq0rcVW1zSPsD4bVBvBuO1xOfuA= +h1:vgPVCZCn7DpCxS0XxUE5uFlFBsBHCtsp3iPZwZLULrQ= 20230706165452_init-schema.sql h1:VvqbNFEQnCvUVyj2iDYVQQxDM0+sSXqocpt/5H64k8M= 20230710111950-cas-backend.sql h1:A8iBuSzZIEbdsv9ipBtscZQuaBp3V5/VMw7eZH6GX+g= 20230712094107-cas-backends-workflow-runs.sql h1:a5rzxpVGyd56nLRSsKrmCFc9sebg65RWzLghKHh5xvI= @@ -115,3 +115,4 @@ h1:SbJMyd1Na23ALCFwTq0rcVW1zSPsD4bVBvBuO1xOfuA= 20250908160222.sql h1:bNjptbt2xPpSXqa4eVuWkMnovHt9LMkiakoGrFGZJ0g= 20251001215533.sql h1:+IdTm9OSW1r5nDH1fX2hpia/q0UzklPrDy3SDN3S0dg= 20251001215625.sql h1:adcp5r8CoL/JCfNgNZxBvY5pczlEHFH/IX64g/ji/4s= +20251009210727.sql h1:DvQIl29i9oE2WN61LFfeOX74kV9I7MS8h7juiXCiXkE= diff --git a/app/controlplane/pkg/data/ent/migrate/schema.go b/app/controlplane/pkg/data/ent/migrate/schema.go index 9a10e0191..088e89aec 100644 --- a/app/controlplane/pkg/data/ent/migrate/schema.go +++ b/app/controlplane/pkg/data/ent/migrate/schema.go @@ -89,6 +89,7 @@ var ( {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "secret_name", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"}, + {Name: "updated_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"}, {Name: "validation_status", Type: field.TypeEnum, Enums: []string{"OK", "Invalid"}, Default: "OK"}, {Name: "validation_error", Type: field.TypeString, Nullable: true}, {Name: "validated_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP"}, @@ -106,7 +107,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "cas_backends_organizations_cas_backends", - Columns: []*schema.Column{CasBackendsColumns[14]}, + Columns: []*schema.Column{CasBackendsColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, @@ -115,7 +116,7 @@ var ( { Name: "casbackend_name_organization_cas_backends", Unique: true, - Columns: []*schema.Column{CasBackendsColumns[2], CasBackendsColumns[14]}, + Columns: []*schema.Column{CasBackendsColumns[2], CasBackendsColumns[15]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, diff --git a/app/controlplane/pkg/data/ent/mutation.go b/app/controlplane/pkg/data/ent/mutation.go index bbbec66da..48d47b5d5 100644 --- a/app/controlplane/pkg/data/ent/mutation.go +++ b/app/controlplane/pkg/data/ent/mutation.go @@ -1484,6 +1484,7 @@ type CASBackendMutation struct { description *string secret_name *string created_at *time.Time + updated_at *time.Time validation_status *biz.CASBackendValidationStatus validation_error *string validated_at *time.Time @@ -1836,6 +1837,42 @@ func (m *CASBackendMutation) ResetCreatedAt() { m.created_at = nil } +// SetUpdatedAt sets the "updated_at" field. +func (m *CASBackendMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *CASBackendMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the CASBackend entity. +// If the CASBackend object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *CASBackendMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *CASBackendMutation) ResetUpdatedAt() { + m.updated_at = nil +} + // SetValidationStatus sets the "validation_status" field. func (m *CASBackendMutation) SetValidationStatus(bbvs biz.CASBackendValidationStatus) { m.validation_status = &bbvs @@ -2261,7 +2298,7 @@ func (m *CASBackendMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *CASBackendMutation) Fields() []string { - fields := make([]string, 0, 13) + fields := make([]string, 0, 14) if m.location != nil { fields = append(fields, casbackend.FieldLocation) } @@ -2280,6 +2317,9 @@ func (m *CASBackendMutation) Fields() []string { if m.created_at != nil { fields = append(fields, casbackend.FieldCreatedAt) } + if m.updated_at != nil { + fields = append(fields, casbackend.FieldUpdatedAt) + } if m.validation_status != nil { fields = append(fields, casbackend.FieldValidationStatus) } @@ -2321,6 +2361,8 @@ func (m *CASBackendMutation) Field(name string) (ent.Value, bool) { return m.SecretName() case casbackend.FieldCreatedAt: return m.CreatedAt() + case casbackend.FieldUpdatedAt: + return m.UpdatedAt() case casbackend.FieldValidationStatus: return m.ValidationStatus() case casbackend.FieldValidationError: @@ -2356,6 +2398,8 @@ func (m *CASBackendMutation) OldField(ctx context.Context, name string) (ent.Val return m.OldSecretName(ctx) case casbackend.FieldCreatedAt: return m.OldCreatedAt(ctx) + case casbackend.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) case casbackend.FieldValidationStatus: return m.OldValidationStatus(ctx) case casbackend.FieldValidationError: @@ -2421,6 +2465,13 @@ func (m *CASBackendMutation) SetField(name string, value ent.Value) error { } m.SetCreatedAt(v) return nil + case casbackend.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil case casbackend.FieldValidationStatus: v, ok := value.(biz.CASBackendValidationStatus) if !ok { @@ -2573,6 +2624,9 @@ func (m *CASBackendMutation) ResetField(name string) error { case casbackend.FieldCreatedAt: m.ResetCreatedAt() return nil + case casbackend.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil case casbackend.FieldValidationStatus: m.ResetValidationStatus() return nil diff --git a/app/controlplane/pkg/data/ent/runtime.go b/app/controlplane/pkg/data/ent/runtime.go index 3e92f970c..35c124c63 100644 --- a/app/controlplane/pkg/data/ent/runtime.go +++ b/app/controlplane/pkg/data/ent/runtime.go @@ -63,16 +63,20 @@ func init() { casbackendDescCreatedAt := casbackendFields[6].Descriptor() // casbackend.DefaultCreatedAt holds the default value on creation for the created_at field. casbackend.DefaultCreatedAt = casbackendDescCreatedAt.Default.(func() time.Time) + // casbackendDescUpdatedAt is the schema descriptor for updated_at field. + casbackendDescUpdatedAt := casbackendFields[7].Descriptor() + // casbackend.DefaultUpdatedAt holds the default value on creation for the updated_at field. + casbackend.DefaultUpdatedAt = casbackendDescUpdatedAt.Default.(func() time.Time) // casbackendDescValidatedAt is the schema descriptor for validated_at field. - casbackendDescValidatedAt := casbackendFields[9].Descriptor() + casbackendDescValidatedAt := casbackendFields[10].Descriptor() // casbackend.DefaultValidatedAt holds the default value on creation for the validated_at field. casbackend.DefaultValidatedAt = casbackendDescValidatedAt.Default.(func() time.Time) // casbackendDescDefault is the schema descriptor for default field. - casbackendDescDefault := casbackendFields[10].Descriptor() + casbackendDescDefault := casbackendFields[11].Descriptor() // casbackend.DefaultDefault holds the default value on creation for the default field. casbackend.DefaultDefault = casbackendDescDefault.Default.(bool) // casbackendDescFallback is the schema descriptor for fallback field. - casbackendDescFallback := casbackendFields[12].Descriptor() + casbackendDescFallback := casbackendFields[13].Descriptor() // casbackend.DefaultFallback holds the default value on creation for the fallback field. casbackend.DefaultFallback = casbackendDescFallback.Default.(bool) // casbackendDescID is the schema descriptor for id field. diff --git a/app/controlplane/pkg/data/ent/schema/casbackend.go b/app/controlplane/pkg/data/ent/schema/casbackend.go index 78b84e81e..a19ad8f0d 100644 --- a/app/controlplane/pkg/data/ent/schema/casbackend.go +++ b/app/controlplane/pkg/data/ent/schema/casbackend.go @@ -1,5 +1,5 @@ // -// Copyright 2024 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -46,6 +46,9 @@ func (CASBackend) Fields() []ent.Field { Default(time.Now). Immutable(). Annotations(&entsql.Annotation{Default: "CURRENT_TIMESTAMP"}), + field.Time("updated_at"). + Default(time.Now). + Annotations(&entsql.Annotation{Default: "CURRENT_TIMESTAMP"}), field.Enum("validation_status"). GoType(biz.CASBackendValidationStatus("")). Default(string(biz.CASBackendValidationOK)), From f2a9c5e4b2a2af9dd3b687850d0a7a9a3adfef33 Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Fri, 10 Oct 2025 13:08:20 +0200 Subject: [PATCH 2/5] backend Signed-off-by: Miguel Martinez --- .../pkg/data/ent/casbackend/casbackend.go | 2 ++ .../pkg/data/ent/casbackend_update.go | 34 ++++++++++--------- app/controlplane/pkg/data/ent/runtime.go | 2 ++ .../pkg/data/ent/schema/casbackend.go | 1 + 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/controlplane/pkg/data/ent/casbackend/casbackend.go b/app/controlplane/pkg/data/ent/casbackend/casbackend.go index 5face6d31..f07e8e9f0 100644 --- a/app/controlplane/pkg/data/ent/casbackend/casbackend.go +++ b/app/controlplane/pkg/data/ent/casbackend/casbackend.go @@ -116,6 +116,8 @@ var ( DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time // DefaultValidatedAt holds the default value on creation for the "validated_at" field. DefaultValidatedAt func() time.Time // DefaultDefault holds the default value on creation for the "default" field. diff --git a/app/controlplane/pkg/data/ent/casbackend_update.go b/app/controlplane/pkg/data/ent/casbackend_update.go index 300632cd1..c39097819 100644 --- a/app/controlplane/pkg/data/ent/casbackend_update.go +++ b/app/controlplane/pkg/data/ent/casbackend_update.go @@ -73,14 +73,6 @@ func (cbu *CASBackendUpdate) SetUpdatedAt(t time.Time) *CASBackendUpdate { return cbu } -// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. -func (cbu *CASBackendUpdate) SetNillableUpdatedAt(t *time.Time) *CASBackendUpdate { - if t != nil { - cbu.SetUpdatedAt(*t) - } - return cbu -} - // SetValidationStatus sets the "validation_status" field. func (cbu *CASBackendUpdate) SetValidationStatus(bbvs biz.CASBackendValidationStatus) *CASBackendUpdate { cbu.mutation.SetValidationStatus(bbvs) @@ -244,6 +236,7 @@ func (cbu *CASBackendUpdate) RemoveWorkflowRun(w ...*WorkflowRun) *CASBackendUpd // Save executes the query and returns the number of nodes affected by the update operation. func (cbu *CASBackendUpdate) Save(ctx context.Context) (int, error) { + cbu.defaults() return withHooks(ctx, cbu.sqlSave, cbu.mutation, cbu.hooks) } @@ -269,6 +262,14 @@ func (cbu *CASBackendUpdate) ExecX(ctx context.Context) { } } +// defaults sets the default values of the builder before save. +func (cbu *CASBackendUpdate) defaults() { + if _, ok := cbu.mutation.UpdatedAt(); !ok { + v := casbackend.UpdateDefaultUpdatedAt() + cbu.mutation.SetUpdatedAt(v) + } +} + // check runs all checks and user-defined validators on the builder. func (cbu *CASBackendUpdate) check() error { if v, ok := cbu.mutation.ValidationStatus(); ok { @@ -475,14 +476,6 @@ func (cbuo *CASBackendUpdateOne) SetUpdatedAt(t time.Time) *CASBackendUpdateOne return cbuo } -// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. -func (cbuo *CASBackendUpdateOne) SetNillableUpdatedAt(t *time.Time) *CASBackendUpdateOne { - if t != nil { - cbuo.SetUpdatedAt(*t) - } - return cbuo -} - // SetValidationStatus sets the "validation_status" field. func (cbuo *CASBackendUpdateOne) SetValidationStatus(bbvs biz.CASBackendValidationStatus) *CASBackendUpdateOne { cbuo.mutation.SetValidationStatus(bbvs) @@ -659,6 +652,7 @@ func (cbuo *CASBackendUpdateOne) Select(field string, fields ...string) *CASBack // Save executes the query and returns the updated CASBackend entity. func (cbuo *CASBackendUpdateOne) Save(ctx context.Context) (*CASBackend, error) { + cbuo.defaults() return withHooks(ctx, cbuo.sqlSave, cbuo.mutation, cbuo.hooks) } @@ -684,6 +678,14 @@ func (cbuo *CASBackendUpdateOne) ExecX(ctx context.Context) { } } +// defaults sets the default values of the builder before save. +func (cbuo *CASBackendUpdateOne) defaults() { + if _, ok := cbuo.mutation.UpdatedAt(); !ok { + v := casbackend.UpdateDefaultUpdatedAt() + cbuo.mutation.SetUpdatedAt(v) + } +} + // check runs all checks and user-defined validators on the builder. func (cbuo *CASBackendUpdateOne) check() error { if v, ok := cbuo.mutation.ValidationStatus(); ok { diff --git a/app/controlplane/pkg/data/ent/runtime.go b/app/controlplane/pkg/data/ent/runtime.go index 35c124c63..42baf38cc 100644 --- a/app/controlplane/pkg/data/ent/runtime.go +++ b/app/controlplane/pkg/data/ent/runtime.go @@ -67,6 +67,8 @@ func init() { casbackendDescUpdatedAt := casbackendFields[7].Descriptor() // casbackend.DefaultUpdatedAt holds the default value on creation for the updated_at field. casbackend.DefaultUpdatedAt = casbackendDescUpdatedAt.Default.(func() time.Time) + // casbackend.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + casbackend.UpdateDefaultUpdatedAt = casbackendDescUpdatedAt.UpdateDefault.(func() time.Time) // casbackendDescValidatedAt is the schema descriptor for validated_at field. casbackendDescValidatedAt := casbackendFields[10].Descriptor() // casbackend.DefaultValidatedAt holds the default value on creation for the validated_at field. diff --git a/app/controlplane/pkg/data/ent/schema/casbackend.go b/app/controlplane/pkg/data/ent/schema/casbackend.go index a19ad8f0d..c81840fe0 100644 --- a/app/controlplane/pkg/data/ent/schema/casbackend.go +++ b/app/controlplane/pkg/data/ent/schema/casbackend.go @@ -48,6 +48,7 @@ func (CASBackend) Fields() []ent.Field { Annotations(&entsql.Annotation{Default: "CURRENT_TIMESTAMP"}), field.Time("updated_at"). Default(time.Now). + UpdateDefault(time.Now). Annotations(&entsql.Annotation{Default: "CURRENT_TIMESTAMP"}), field.Enum("validation_status"). GoType(biz.CASBackendValidationStatus("")). From 1ead897f99aedf70134c7731812bc964843436e3 Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Fri, 10 Oct 2025 13:11:38 +0200 Subject: [PATCH 3/5] backend Signed-off-by: Miguel Martinez --- .../gen/frontend/google/protobuf/descriptor.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts index 0d2d2fb32..d59b21da4 100644 --- a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts +++ b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts @@ -30,7 +30,7 @@ export enum Edition { EDITION_2024 = 1001, /** * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be - * used or relyed on outside of tests. + * used or relied on outside of tests. */ EDITION_1_TEST_ONLY = 1, EDITION_2_TEST_ONLY = 2, @@ -875,12 +875,13 @@ export interface MessageOptions { export interface FieldOptions { /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. * The ctype option instructs the C++ code generator to use a different * representation of the field than it normally would. See the specific * options below. This option is only implemented to support use of * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - * type "bytes" in the open source release -- sorry, we'll try to include - * other types in a future version! + * type "bytes" in the open source release. + * TODO: make ctype actually deprecated. */ ctype: FieldOptions_CType; /** @@ -1052,11 +1053,7 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { } } -/** - * If set to RETENTION_SOURCE, the option will be omitted from the binary. - * Note: as of January 2023, support for this is in progress and does not yet - * have an effect (b/264593489). - */ +/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ export enum FieldOptions_OptionRetention { RETENTION_UNKNOWN = 0, RETENTION_RUNTIME = 1, @@ -1099,8 +1096,7 @@ export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRe /** * This indicates the types of entities that the field may apply to when used * as an option. If it is unset, then the field may be freely used as an - * option on any kind of entity. Note: as of January 2023, support for this is - * in progress and does not yet have an effect (b/264593489). + * option on any kind of entity. */ export enum FieldOptions_OptionTargetType { TARGET_TYPE_UNKNOWN = 0, From 1e39be071fa51db1a9f69dcd88e61099cd45d6ee Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Fri, 10 Oct 2025 21:52:11 +0200 Subject: [PATCH 4/5] merge Signed-off-by: Miguel Martinez --- app/controlplane/pkg/biz/casbackend_integration_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controlplane/pkg/biz/casbackend_integration_test.go b/app/controlplane/pkg/biz/casbackend_integration_test.go index 07cdc8746..d178f91c0 100644 --- a/app/controlplane/pkg/biz/casbackend_integration_test.go +++ b/app/controlplane/pkg/biz/casbackend_integration_test.go @@ -1,5 +1,5 @@ // -// Copyright 2024 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -122,7 +122,7 @@ func (s *CASBackendIntegrationTestSuite) TestCreate() { MaxBytes: 104857600, }, }, b, - cmpopts.IgnoreFields(biz.CASBackend{}, "CreatedAt", "ID", "ValidatedAt", "OrganizationID"), + cmpopts.IgnoreFields(biz.CASBackend{}, "CreatedAt", "ID", "ValidatedAt", "UpdatedAt", "OrganizationID"), ); diff != "" { assert.Failf("mismatch (-want +got):\n%s", diff) } @@ -144,7 +144,7 @@ func (s *CASBackendIntegrationTestSuite) TestCreate() { MaxBytes: 512000, }, }, b, - cmpopts.IgnoreFields(biz.CASBackend{}, "CreatedAt", "ID", "ValidatedAt", "OrganizationID"), + cmpopts.IgnoreFields(biz.CASBackend{}, "CreatedAt", "ID", "ValidatedAt", "UpdatedAt", "OrganizationID"), ); diff != "" { assert.Failf("mismatch (-want +got):\n%s", diff) } From ca0a78535554e58da8d339bf02e650f2cba7d3e4 Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Fri, 10 Oct 2025 22:03:35 +0200 Subject: [PATCH 5/5] revalidate cas backend Signed-off-by: Miguel Martinez --- .../api/controlplane/v1/cas_backends.pb.go | 270 +++++++++++++----- .../api/controlplane/v1/cas_backends.proto | 13 + .../controlplane/v1/cas_backends_grpc.pb.go | 45 ++- .../frontend/controlplane/v1/cas_backends.ts | 154 ++++++++++ ...ndServiceRevalidateRequest.jsonschema.json | 12 + ...ackendServiceRevalidateRequest.schema.json | 12 + ...dServiceRevalidateResponse.jsonschema.json | 8 + ...ckendServiceRevalidateResponse.schema.json | 8 + .../internal/service/casbackend.go | 30 +- app/controlplane/pkg/authz/authz.go | 6 +- 10 files changed, 484 insertions(+), 74 deletions(-) create mode 100644 app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.jsonschema.json create mode 100644 app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.schema.json create mode 100644 app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.jsonschema.json create mode 100644 app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.schema.json diff --git a/app/controlplane/api/controlplane/v1/cas_backends.pb.go b/app/controlplane/api/controlplane/v1/cas_backends.pb.go index 52d418e26..0b755074d 100644 --- a/app/controlplane/api/controlplane/v1/cas_backends.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_backends.pb.go @@ -543,6 +543,91 @@ func (*CASBackendServiceDeleteResponse) Descriptor() ([]byte, []int) { return file_controlplane_v1_cas_backends_proto_rawDescGZIP(), []int{7} } +type CASBackendServiceRevalidateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CASBackendServiceRevalidateRequest) Reset() { + *x = CASBackendServiceRevalidateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_controlplane_v1_cas_backends_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CASBackendServiceRevalidateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CASBackendServiceRevalidateRequest) ProtoMessage() {} + +func (x *CASBackendServiceRevalidateRequest) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_cas_backends_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CASBackendServiceRevalidateRequest.ProtoReflect.Descriptor instead. +func (*CASBackendServiceRevalidateRequest) Descriptor() ([]byte, []int) { + return file_controlplane_v1_cas_backends_proto_rawDescGZIP(), []int{8} +} + +func (x *CASBackendServiceRevalidateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CASBackendServiceRevalidateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CASBackendServiceRevalidateResponse) Reset() { + *x = CASBackendServiceRevalidateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_controlplane_v1_cas_backends_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CASBackendServiceRevalidateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CASBackendServiceRevalidateResponse) ProtoMessage() {} + +func (x *CASBackendServiceRevalidateResponse) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_cas_backends_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CASBackendServiceRevalidateResponse.ProtoReflect.Descriptor instead. +func (*CASBackendServiceRevalidateResponse) Descriptor() ([]byte, []int) { + return file_controlplane_v1_cas_backends_proto_rawDescGZIP(), []int{9} +} + var File_controlplane_v1_cas_backends_proto protoreflect.FileDescriptor var file_controlplane_v1_cas_backends_proto_rawDesc = []byte{ @@ -634,50 +719,73 @@ var file_controlplane_v1_cas_backends_proto_rawDesc = []byte{ 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x24, 0x27, 0x29, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, 0x1f, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2a, 0xa0, 0x01, 0x0a, 0x15, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x28, 0x0a, - 0x24, 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2b, 0x0a, 0x21, 0x43, 0x41, 0x53, 0x5f, 0x42, - 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, - 0x53, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x04, - 0xa8, 0x45, 0x93, 0x03, 0x12, 0x2a, 0x0a, 0x20, 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, 0x4b, - 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, - 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, - 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x32, 0xc1, 0x03, 0x0a, 0x11, 0x43, 0x41, 0x53, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x04, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, - 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x6b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x22, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x97, 0x01, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x82, 0x01, 0xba, 0x48, 0x7f, 0xba, + 0x01, 0x7c, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x64, 0x6e, 0x73, 0x2d, 0x31, 0x31, 0x32, + 0x33, 0x12, 0x3a, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, + 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x63, 0x61, 0x73, 0x65, 0x20, 0x6c, + 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x2c, + 0x20, 0x61, 0x6e, 0x64, 0x20, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x2e, 0x1a, 0x2f, 0x74, + 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x28, 0x27, 0x5e, 0x5b, 0x61, + 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x28, 0x5b, 0x2d, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, + 0x2a, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x24, 0x27, 0x29, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x23, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xa0, 0x01, 0x0a, 0x15, + 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, + 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, + 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x2b, 0x0a, 0x21, 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, + 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x12, 0x2a, 0x0a, 0x20, + 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x10, 0x02, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x32, 0xba, + 0x04, 0x0a, 0x11, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, - 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, - 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, - 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, - 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, + 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x77, 0x0a, 0x0a, 0x52, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, + 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, + 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -693,36 +801,40 @@ func file_controlplane_v1_cas_backends_proto_rawDescGZIP() []byte { } var file_controlplane_v1_cas_backends_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_controlplane_v1_cas_backends_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_controlplane_v1_cas_backends_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_controlplane_v1_cas_backends_proto_goTypes = []interface{}{ - (CASBackendErrorReason)(0), // 0: controlplane.v1.CASBackendErrorReason - (*CASBackendServiceListRequest)(nil), // 1: controlplane.v1.CASBackendServiceListRequest - (*CASBackendServiceListResponse)(nil), // 2: controlplane.v1.CASBackendServiceListResponse - (*CASBackendServiceCreateRequest)(nil), // 3: controlplane.v1.CASBackendServiceCreateRequest - (*CASBackendServiceCreateResponse)(nil), // 4: controlplane.v1.CASBackendServiceCreateResponse - (*CASBackendServiceUpdateRequest)(nil), // 5: controlplane.v1.CASBackendServiceUpdateRequest - (*CASBackendServiceUpdateResponse)(nil), // 6: controlplane.v1.CASBackendServiceUpdateResponse - (*CASBackendServiceDeleteRequest)(nil), // 7: controlplane.v1.CASBackendServiceDeleteRequest - (*CASBackendServiceDeleteResponse)(nil), // 8: controlplane.v1.CASBackendServiceDeleteResponse - (*CASBackendItem)(nil), // 9: controlplane.v1.CASBackendItem - (*structpb.Struct)(nil), // 10: google.protobuf.Struct + (CASBackendErrorReason)(0), // 0: controlplane.v1.CASBackendErrorReason + (*CASBackendServiceListRequest)(nil), // 1: controlplane.v1.CASBackendServiceListRequest + (*CASBackendServiceListResponse)(nil), // 2: controlplane.v1.CASBackendServiceListResponse + (*CASBackendServiceCreateRequest)(nil), // 3: controlplane.v1.CASBackendServiceCreateRequest + (*CASBackendServiceCreateResponse)(nil), // 4: controlplane.v1.CASBackendServiceCreateResponse + (*CASBackendServiceUpdateRequest)(nil), // 5: controlplane.v1.CASBackendServiceUpdateRequest + (*CASBackendServiceUpdateResponse)(nil), // 6: controlplane.v1.CASBackendServiceUpdateResponse + (*CASBackendServiceDeleteRequest)(nil), // 7: controlplane.v1.CASBackendServiceDeleteRequest + (*CASBackendServiceDeleteResponse)(nil), // 8: controlplane.v1.CASBackendServiceDeleteResponse + (*CASBackendServiceRevalidateRequest)(nil), // 9: controlplane.v1.CASBackendServiceRevalidateRequest + (*CASBackendServiceRevalidateResponse)(nil), // 10: controlplane.v1.CASBackendServiceRevalidateResponse + (*CASBackendItem)(nil), // 11: controlplane.v1.CASBackendItem + (*structpb.Struct)(nil), // 12: google.protobuf.Struct } var file_controlplane_v1_cas_backends_proto_depIdxs = []int32{ - 9, // 0: controlplane.v1.CASBackendServiceListResponse.result:type_name -> controlplane.v1.CASBackendItem - 10, // 1: controlplane.v1.CASBackendServiceCreateRequest.credentials:type_name -> google.protobuf.Struct - 9, // 2: controlplane.v1.CASBackendServiceCreateResponse.result:type_name -> controlplane.v1.CASBackendItem - 10, // 3: controlplane.v1.CASBackendServiceUpdateRequest.credentials:type_name -> google.protobuf.Struct - 9, // 4: controlplane.v1.CASBackendServiceUpdateResponse.result:type_name -> controlplane.v1.CASBackendItem + 11, // 0: controlplane.v1.CASBackendServiceListResponse.result:type_name -> controlplane.v1.CASBackendItem + 12, // 1: controlplane.v1.CASBackendServiceCreateRequest.credentials:type_name -> google.protobuf.Struct + 11, // 2: controlplane.v1.CASBackendServiceCreateResponse.result:type_name -> controlplane.v1.CASBackendItem + 12, // 3: controlplane.v1.CASBackendServiceUpdateRequest.credentials:type_name -> google.protobuf.Struct + 11, // 4: controlplane.v1.CASBackendServiceUpdateResponse.result:type_name -> controlplane.v1.CASBackendItem 1, // 5: controlplane.v1.CASBackendService.List:input_type -> controlplane.v1.CASBackendServiceListRequest 3, // 6: controlplane.v1.CASBackendService.Create:input_type -> controlplane.v1.CASBackendServiceCreateRequest 5, // 7: controlplane.v1.CASBackendService.Update:input_type -> controlplane.v1.CASBackendServiceUpdateRequest 7, // 8: controlplane.v1.CASBackendService.Delete:input_type -> controlplane.v1.CASBackendServiceDeleteRequest - 2, // 9: controlplane.v1.CASBackendService.List:output_type -> controlplane.v1.CASBackendServiceListResponse - 4, // 10: controlplane.v1.CASBackendService.Create:output_type -> controlplane.v1.CASBackendServiceCreateResponse - 6, // 11: controlplane.v1.CASBackendService.Update:output_type -> controlplane.v1.CASBackendServiceUpdateResponse - 8, // 12: controlplane.v1.CASBackendService.Delete:output_type -> controlplane.v1.CASBackendServiceDeleteResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type + 9, // 9: controlplane.v1.CASBackendService.Revalidate:input_type -> controlplane.v1.CASBackendServiceRevalidateRequest + 2, // 10: controlplane.v1.CASBackendService.List:output_type -> controlplane.v1.CASBackendServiceListResponse + 4, // 11: controlplane.v1.CASBackendService.Create:output_type -> controlplane.v1.CASBackendServiceCreateResponse + 6, // 12: controlplane.v1.CASBackendService.Update:output_type -> controlplane.v1.CASBackendServiceUpdateResponse + 8, // 13: controlplane.v1.CASBackendService.Delete:output_type -> controlplane.v1.CASBackendServiceDeleteResponse + 10, // 14: controlplane.v1.CASBackendService.Revalidate:output_type -> controlplane.v1.CASBackendServiceRevalidateResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name @@ -831,6 +943,30 @@ func file_controlplane_v1_cas_backends_proto_init() { return nil } } + file_controlplane_v1_cas_backends_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CASBackendServiceRevalidateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_controlplane_v1_cas_backends_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CASBackendServiceRevalidateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_controlplane_v1_cas_backends_proto_msgTypes[2].OneofWrappers = []interface{}{} file_controlplane_v1_cas_backends_proto_msgTypes[4].OneofWrappers = []interface{}{} @@ -840,7 +976,7 @@ func file_controlplane_v1_cas_backends_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_controlplane_v1_cas_backends_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/app/controlplane/api/controlplane/v1/cas_backends.proto b/app/controlplane/api/controlplane/v1/cas_backends.proto index b9c455cb6..df6b7d05c 100644 --- a/app/controlplane/api/controlplane/v1/cas_backends.proto +++ b/app/controlplane/api/controlplane/v1/cas_backends.proto @@ -29,6 +29,7 @@ service CASBackendService { rpc Create(CASBackendServiceCreateRequest) returns (CASBackendServiceCreateResponse); rpc Update(CASBackendServiceUpdateRequest) returns (CASBackendServiceUpdateResponse); rpc Delete(CASBackendServiceDeleteRequest) returns (CASBackendServiceDeleteResponse); + rpc Revalidate(CASBackendServiceRevalidateRequest) returns (CASBackendServiceRevalidateResponse); } message CASBackendServiceListRequest {} @@ -99,6 +100,18 @@ message CASBackendServiceDeleteRequest { message CASBackendServiceDeleteResponse {} +message CASBackendServiceRevalidateRequest { + string name = 1 [(buf.validate.field) = { + cel: { + message: "must contain only lowercase letters, numbers, and hyphens." + expression: "this.matches('^[a-z0-9]([-a-z0-9]*[a-z0-9])?$')" + id: "name.dns-1123" + } + }]; +} + +message CASBackendServiceRevalidateResponse {} + enum CASBackendErrorReason { option (errors.default_code) = 500; CAS_BACKEND_ERROR_REASON_UNSPECIFIED = 0; diff --git a/app/controlplane/api/controlplane/v1/cas_backends_grpc.pb.go b/app/controlplane/api/controlplane/v1/cas_backends_grpc.pb.go index 1a784f691..72daa1759 100644 --- a/app/controlplane/api/controlplane/v1/cas_backends_grpc.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_backends_grpc.pb.go @@ -34,10 +34,11 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - CASBackendService_List_FullMethodName = "/controlplane.v1.CASBackendService/List" - CASBackendService_Create_FullMethodName = "/controlplane.v1.CASBackendService/Create" - CASBackendService_Update_FullMethodName = "/controlplane.v1.CASBackendService/Update" - CASBackendService_Delete_FullMethodName = "/controlplane.v1.CASBackendService/Delete" + CASBackendService_List_FullMethodName = "/controlplane.v1.CASBackendService/List" + CASBackendService_Create_FullMethodName = "/controlplane.v1.CASBackendService/Create" + CASBackendService_Update_FullMethodName = "/controlplane.v1.CASBackendService/Update" + CASBackendService_Delete_FullMethodName = "/controlplane.v1.CASBackendService/Delete" + CASBackendService_Revalidate_FullMethodName = "/controlplane.v1.CASBackendService/Revalidate" ) // CASBackendServiceClient is the client API for CASBackendService service. @@ -48,6 +49,7 @@ type CASBackendServiceClient interface { Create(ctx context.Context, in *CASBackendServiceCreateRequest, opts ...grpc.CallOption) (*CASBackendServiceCreateResponse, error) Update(ctx context.Context, in *CASBackendServiceUpdateRequest, opts ...grpc.CallOption) (*CASBackendServiceUpdateResponse, error) Delete(ctx context.Context, in *CASBackendServiceDeleteRequest, opts ...grpc.CallOption) (*CASBackendServiceDeleteResponse, error) + Revalidate(ctx context.Context, in *CASBackendServiceRevalidateRequest, opts ...grpc.CallOption) (*CASBackendServiceRevalidateResponse, error) } type cASBackendServiceClient struct { @@ -94,6 +96,15 @@ func (c *cASBackendServiceClient) Delete(ctx context.Context, in *CASBackendServ return out, nil } +func (c *cASBackendServiceClient) Revalidate(ctx context.Context, in *CASBackendServiceRevalidateRequest, opts ...grpc.CallOption) (*CASBackendServiceRevalidateResponse, error) { + out := new(CASBackendServiceRevalidateResponse) + err := c.cc.Invoke(ctx, CASBackendService_Revalidate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // CASBackendServiceServer is the server API for CASBackendService service. // All implementations must embed UnimplementedCASBackendServiceServer // for forward compatibility @@ -102,6 +113,7 @@ type CASBackendServiceServer interface { Create(context.Context, *CASBackendServiceCreateRequest) (*CASBackendServiceCreateResponse, error) Update(context.Context, *CASBackendServiceUpdateRequest) (*CASBackendServiceUpdateResponse, error) Delete(context.Context, *CASBackendServiceDeleteRequest) (*CASBackendServiceDeleteResponse, error) + Revalidate(context.Context, *CASBackendServiceRevalidateRequest) (*CASBackendServiceRevalidateResponse, error) mustEmbedUnimplementedCASBackendServiceServer() } @@ -121,6 +133,9 @@ func (UnimplementedCASBackendServiceServer) Update(context.Context, *CASBackendS func (UnimplementedCASBackendServiceServer) Delete(context.Context, *CASBackendServiceDeleteRequest) (*CASBackendServiceDeleteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } +func (UnimplementedCASBackendServiceServer) Revalidate(context.Context, *CASBackendServiceRevalidateRequest) (*CASBackendServiceRevalidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Revalidate not implemented") +} func (UnimplementedCASBackendServiceServer) mustEmbedUnimplementedCASBackendServiceServer() {} // UnsafeCASBackendServiceServer may be embedded to opt out of forward compatibility for this service. @@ -206,6 +221,24 @@ func _CASBackendService_Delete_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _CASBackendService_Revalidate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CASBackendServiceRevalidateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CASBackendServiceServer).Revalidate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CASBackendService_Revalidate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CASBackendServiceServer).Revalidate(ctx, req.(*CASBackendServiceRevalidateRequest)) + } + return interceptor(ctx, in, info, handler) +} + // CASBackendService_ServiceDesc is the grpc.ServiceDesc for CASBackendService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -229,6 +262,10 @@ var CASBackendService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Delete", Handler: _CASBackendService_Delete_Handler, }, + { + MethodName: "Revalidate", + Handler: _CASBackendService_Revalidate_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "controlplane/v1/cas_backends.proto", diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts b/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts index 3f17912d9..9e1350e71 100644 --- a/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts +++ b/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts @@ -115,6 +115,13 @@ export interface CASBackendServiceDeleteRequest { export interface CASBackendServiceDeleteResponse { } +export interface CASBackendServiceRevalidateRequest { + name: string; +} + +export interface CASBackendServiceRevalidateResponse { +} + function createBaseCASBackendServiceListRequest(): CASBackendServiceListRequest { return {}; } @@ -701,6 +708,114 @@ export const CASBackendServiceDeleteResponse = { }, }; +function createBaseCASBackendServiceRevalidateRequest(): CASBackendServiceRevalidateRequest { + return { name: "" }; +} + +export const CASBackendServiceRevalidateRequest = { + encode(message: CASBackendServiceRevalidateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CASBackendServiceRevalidateRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCASBackendServiceRevalidateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CASBackendServiceRevalidateRequest { + return { name: isSet(object.name) ? String(object.name) : "" }; + }, + + toJSON(message: CASBackendServiceRevalidateRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + create, I>>( + base?: I, + ): CASBackendServiceRevalidateRequest { + return CASBackendServiceRevalidateRequest.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): CASBackendServiceRevalidateRequest { + const message = createBaseCASBackendServiceRevalidateRequest(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseCASBackendServiceRevalidateResponse(): CASBackendServiceRevalidateResponse { + return {}; +} + +export const CASBackendServiceRevalidateResponse = { + encode(_: CASBackendServiceRevalidateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CASBackendServiceRevalidateResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCASBackendServiceRevalidateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): CASBackendServiceRevalidateResponse { + return {}; + }, + + toJSON(_: CASBackendServiceRevalidateResponse): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>( + base?: I, + ): CASBackendServiceRevalidateResponse { + return CASBackendServiceRevalidateResponse.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + _: I, + ): CASBackendServiceRevalidateResponse { + const message = createBaseCASBackendServiceRevalidateResponse(); + return message; + }, +}; + export interface CASBackendService { List( request: DeepPartial, @@ -718,6 +833,10 @@ export interface CASBackendService { request: DeepPartial, metadata?: grpc.Metadata, ): Promise; + Revalidate( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; } export class CASBackendServiceClientImpl implements CASBackendService { @@ -729,6 +848,7 @@ export class CASBackendServiceClientImpl implements CASBackendService { this.Create = this.Create.bind(this); this.Update = this.Update.bind(this); this.Delete = this.Delete.bind(this); + this.Revalidate = this.Revalidate.bind(this); } List( @@ -758,6 +878,17 @@ export class CASBackendServiceClientImpl implements CASBackendService { ): Promise { return this.rpc.unary(CASBackendServiceDeleteDesc, CASBackendServiceDeleteRequest.fromPartial(request), metadata); } + + Revalidate( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + CASBackendServiceRevalidateDesc, + CASBackendServiceRevalidateRequest.fromPartial(request), + metadata, + ); + } } export const CASBackendServiceDesc = { serviceName: "controlplane.v1.CASBackendService" }; @@ -854,6 +985,29 @@ export const CASBackendServiceDeleteDesc: UnaryMethodDefinitionish = { } as any, }; +export const CASBackendServiceRevalidateDesc: UnaryMethodDefinitionish = { + methodName: "Revalidate", + service: CASBackendServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return CASBackendServiceRevalidateRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = CASBackendServiceRevalidateResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { requestStream: any; responseStream: any; diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.jsonschema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.jsonschema.json new file mode 100644 index 000000000..9cda71efa --- /dev/null +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.jsonschema.json @@ -0,0 +1,12 @@ +{ + "$id": "controlplane.v1.CASBackendServiceRevalidateRequest.jsonschema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "title": "CAS Backend Service Revalidate Request", + "type": "object" +} diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.schema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.schema.json new file mode 100644 index 000000000..caa60e219 --- /dev/null +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateRequest.schema.json @@ -0,0 +1,12 @@ +{ + "$id": "controlplane.v1.CASBackendServiceRevalidateRequest.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "title": "CAS Backend Service Revalidate Request", + "type": "object" +} diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.jsonschema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.jsonschema.json new file mode 100644 index 000000000..f5d491c57 --- /dev/null +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.jsonschema.json @@ -0,0 +1,8 @@ +{ + "$id": "controlplane.v1.CASBackendServiceRevalidateResponse.jsonschema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": {}, + "title": "CAS Backend Service Revalidate Response", + "type": "object" +} diff --git a/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.schema.json b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.schema.json new file mode 100644 index 000000000..c586c9ff9 --- /dev/null +++ b/app/controlplane/api/gen/jsonschema/controlplane.v1.CASBackendServiceRevalidateResponse.schema.json @@ -0,0 +1,8 @@ +{ + "$id": "controlplane.v1.CASBackendServiceRevalidateResponse.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": {}, + "title": "CAS Backend Service Revalidate Response", + "type": "object" +} diff --git a/app/controlplane/internal/service/casbackend.go b/app/controlplane/internal/service/casbackend.go index 642292866..40f4df2a7 100644 --- a/app/controlplane/internal/service/casbackend.go +++ b/app/controlplane/internal/service/casbackend.go @@ -1,5 +1,5 @@ // -// Copyright 2023-2025 The Chainloop Authors. +// Copyright 2024-2025 The Chainloop Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -164,6 +164,34 @@ func (s *CASBackendService) Delete(ctx context.Context, req *pb.CASBackendServic return &pb.CASBackendServiceDeleteResponse{}, nil } +// Revalidate triggers a manual validation for a non-inline CAS backend +func (s *CASBackendService) Revalidate(ctx context.Context, req *pb.CASBackendServiceRevalidateRequest) (*pb.CASBackendServiceRevalidateResponse, error) { + currentOrg, err := requireCurrentOrg(ctx) + if err != nil { + return nil, err + } + + backend, err := s.uc.FindByNameInOrg(ctx, currentOrg.ID, req.Name) + if err != nil { + return nil, handleUseCaseErr(err, s.log) + } + + // Only allow revalidation for non-inline backends + if backend.Inline { + return nil, errors.BadRequest("invalid request", "inline CAS backends do not require validation") + } + + // Launch validation in a goroutine and return immediately + go func() { + // Use background context to avoid cancellation when request context is cancelled + if err := s.uc.PerformValidation(context.Background(), backend.ID.String()); err != nil { + s.log.Errorw("msg", "background validation failed", "backend", backend.ID, "error", err) + } + }() + + return &pb.CASBackendServiceRevalidateResponse{}, nil +} + func bizCASBackendToPb(in *biz.CASBackend) *pb.CASBackendItem { r := &pb.CASBackendItem{ Id: in.ID.String(), Location: in.Location, Description: in.Description, diff --git a/app/controlplane/pkg/authz/authz.go b/app/controlplane/pkg/authz/authz.go index 89fd0789e..f7706dbf6 100644 --- a/app/controlplane/pkg/authz/authz.go +++ b/app/controlplane/pkg/authz/authz.go @@ -130,7 +130,8 @@ var ( PolicyArtifactDownload = &Policy{ResourceCASArtifact, ActionRead} PolicyArtifactUpload = &Policy{ResourceCASArtifact, ActionCreate} // CAS backend - PolicyCASBackendList = &Policy{ResourceCASBackend, ActionList} + PolicyCASBackendList = &Policy{ResourceCASBackend, ActionList} + PolicyCASBackendUpdate = &Policy{ResourceCASBackend, ActionUpdate} // Available integrations PolicyAvailableIntegrationList = &Policy{ResourceAvailableIntegration, ActionList} PolicyAvailableIntegrationRead = &Policy{ResourceAvailableIntegration, ActionRead} @@ -370,7 +371,8 @@ var ServerOperationsMap = map[string][]*Policy{ // Or to retrieve a download url "/controlplane.v1.CASRedirectService/GetDownloadURL": {PolicyArtifactDownload}, // CAS Backend listing - "/controlplane.v1.CASBackendService/List": {PolicyCASBackendList}, + "/controlplane.v1.CASBackendService/List": {PolicyCASBackendList}, + "/controlplane.v1.CASBackendService/Revalidate": {PolicyCASBackendUpdate}, // Available integrations "/controlplane.v1.IntegrationsService/ListAvailable": {PolicyAvailableIntegrationList, PolicyAvailableIntegrationRead}, // Registered integrations