From 3798f861145260941b5ebe04ae0d2e13468a8a60 Mon Sep 17 00:00:00 2001 From: Superblocks Admin Date: Fri, 15 Nov 2024 22:58:50 +0000 Subject: [PATCH] syncing up to 76d00866ace4ed65746d545573ba275d91e856fb Co-authored-by: Bruce Yu <51087152+bruce-y@users.noreply.github.com> --- CHANGELOG.md | 1 + internal/signature/reconciler/reconciler.go | 10 +- .../signature/reconciler/reconciler_test.go | 37 +++- types/Makefile | 2 +- types/api/security/v1/service.swagger.json | 4 + types/gen/go/security/v1/service.pb.go | 171 ++++++++++-------- .../gen/go/security/v1/service.pb.validate.go | 29 +++ types/gen/js/security/v1/service_pb.d.ts | 6 + types/gen/js/security/v1/service_pb.js | 53 +++++- .../security/v1/service_pb2.py | 32 ++-- types/proto/security/v1/service.proto | 2 + .../types/src/security/v1/service_pb.ts | 6 + 12 files changed, 251 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d9b686..ab804aff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add support for machine-to-machine (M2M) authentication for Databricks plugin - Update `WaitGroup` runnable to block `Close` method on the `WaitGroup` completing (addresses `redis: client is closed` errors) - Allow branch name to be given in workflow HTTP requests as a header: `X-Superblocks-Branch` +- Add `last_updated` field to the `Resource` proto, and set last updated time in update signature requests to server ## v1.16.0 diff --git a/internal/signature/reconciler/reconciler.go b/internal/signature/reconciler/reconciler.go index 9e10471d..b3a33d4e 100644 --- a/internal/signature/reconciler/reconciler.go +++ b/internal/signature/reconciler/reconciler.go @@ -16,6 +16,7 @@ import ( pbsecurity "github.com/superblocksteam/agent/types/gen/go/security/v1" pbutils "github.com/superblocksteam/agent/types/gen/go/utils/v1" "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" "go.uber.org/zap" ) @@ -333,14 +334,14 @@ func (r *reconciler) prep(log *zap.Logger, resources []*signingResult) prepped { fullResId := strings.TrimLeft(strings.Join([]string{resType, resId}, "-"), "-") if res.GetApiLiteral() != nil { - update, err := r.updateFromApiLiteral(resId, result, res.GetApiLiteral().GetData().GetStructValue()) + update, err := r.updateFromApiLiteral(resId, result, res.GetApiLiteral().GetData().GetStructValue(), res.GetLastUpdated()) if err != nil { log.Error("error building patch from api literal", zap.Error(err), zap.String(observability.OBS_TAG_RESOURCE_ID, fullResId)) continue } prepped.apiUpdates = append(prepped.apiUpdates, update) } else if res.GetApi() != nil { - update, err := r.updateFromApiLiteral(resId, result, res.GetApi().GetStructValue()) + update, err := r.updateFromApiLiteral(resId, result, res.GetApi().GetStructValue(), res.GetLastUpdated()) if err != nil { log.Error("error building patch from api", zap.Error(err), zap.String(observability.OBS_TAG_RESOURCE_ID, fullResId)) continue @@ -383,9 +384,10 @@ func (r *reconciler) prep(log *zap.Logger, resources []*signingResult) prepped { return prepped } -func (r *reconciler) updateFromApiLiteral(id string, res *signingResult, api *structpb.Struct) (*pbapi.UpdateApiSignature, error) { +func (r *reconciler) updateFromApiLiteral(id string, res *signingResult, api *structpb.Struct, lastUpdated *timestamppb.Timestamp) (*pbapi.UpdateApiSignature, error) { update := &pbapi.UpdateApiSignature{ - ApiId: id, + ApiId: id, + Updated: lastUpdated, } errs := []error{res.err} diff --git a/internal/signature/reconciler/reconciler_test.go b/internal/signature/reconciler/reconciler_test.go index 79a49645..46b35c58 100644 --- a/internal/signature/reconciler/reconciler_test.go +++ b/internal/signature/reconciler/reconciler_test.go @@ -15,6 +15,7 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/structpb" + "google.golang.org/protobuf/types/known/timestamppb" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -715,12 +716,46 @@ func TestPatchFromApiLiteralMissingSignature(t *testing.T) { require.NoError(t, err) resource := &pbsecurity.Resource{ + LastUpdated: ×tamppb.Timestamp{Seconds: 1}, Config: &pbsecurity.Resource_Api{ Api: structpb.NewStructValue(apiNoSig), }, } - patchApi, err := args.reconciler.updateFromApiLiteral(apiId, &signingResult{resource: resource}, apiNoSig) + patchApi, err := args.reconciler.updateFromApiLiteral(apiId, &signingResult{resource: resource}, apiNoSig, nil) require.NoError(t, err) require.NotNil(t, patchApi) + require.NotNil(t, patchApi.GetResult()) + require.Nil(t, patchApi.GetUpdated()) +} + +func TestUpdateFromApiLiteral(t *testing.T) { + t.Parallel() + + args := validArgs(t) + apiId := "0" + api, err := structpb.NewStruct(map[string]any{ + "blocks": map[string]any{}, + "metadata": map[string]any{ + "id": apiId, + }, + }) + require.NoError(t, err) + + resource := &pbsecurity.Resource{ + LastUpdated: ×tamppb.Timestamp{Seconds: 1}, + Config: &pbsecurity.Resource_ApiLiteral_{ + ApiLiteral: &pbsecurity.Resource_ApiLiteral{ + Data: structpb.NewStructValue(api), + }, + }, + } + err = args.signer.SignAndUpdateResource(resource) + require.NoError(t, err) + + patchApi, err := args.reconciler.updateFromApiLiteral(apiId, &signingResult{resource: resource}, api, resource.GetLastUpdated()) + require.NoError(t, err) + require.NotNil(t, patchApi) + require.NotNil(t, patchApi.GetResult()) + require.NotNil(t, patchApi.GetUpdated()) } diff --git a/types/Makefile b/types/Makefile index f9483b5a..acaaa5b5 100644 --- a/types/Makefile +++ b/types/Makefile @@ -2,7 +2,7 @@ BUF_VERSION = "1.45.0" .ONESHELL: -PYTHON_CMD = python3.10 +PYTHON_CMD = python # ":" delimited string of paths PYTHONPATH=.:superblocks_types diff --git a/types/api/security/v1/service.swagger.json b/types/api/security/v1/service.swagger.json index a8212c5d..4d5306f0 100644 --- a/types/api/security/v1/service.swagger.json +++ b/types/api/security/v1/service.swagger.json @@ -175,6 +175,10 @@ }, "branchName": { "type": "string" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" } } }, diff --git a/types/gen/go/security/v1/service.pb.go b/types/gen/go/security/v1/service.pb.go index 4370652c..81dcfed5 100644 --- a/types/gen/go/security/v1/service.pb.go +++ b/types/gen/go/security/v1/service.pb.go @@ -40,7 +40,8 @@ type Resource struct { // // *Resource_CommitId // *Resource_BranchName - GitRef isResource_GitRef `protobuf_oneof:"git_ref"` + GitRef isResource_GitRef `protobuf_oneof:"git_ref"` + LastUpdated *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` } func (x *Resource) Reset() { @@ -125,6 +126,13 @@ func (x *Resource) GetBranchName() string { return "" } +func (x *Resource) GetLastUpdated() *timestamppb.Timestamp { + if x != nil { + return x.LastUpdated + } + return nil +} + type isResource_Config interface { isResource_Config() } @@ -508,7 +516,7 @@ var file_security_v1_service_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x74, 0x69, - 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x05, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x05, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x03, 0x61, 0x70, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, @@ -524,65 +532,69 @@ var file_security_v1_service_proto_rawDesc = []byte{ 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0a, 0x62, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0xbb, 0x02, 0x0a, 0x07, 0x4c, 0x69, 0x74, 0x65, - 0x72, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x36, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x12, 0x3d, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 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, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x65, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4c, 0x69, 0x74, 0x65, - 0x72, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, - 0x0f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, - 0x42, 0x10, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x12, 0x05, 0xba, 0x48, 0x02, - 0x08, 0x01, 0x22, 0x40, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x31, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x22, 0x41, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x44, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x27, 0x0a, - 0x0e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x32, 0xd2, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5a, 0x0a, 0x04, 0x53, - 0x69, 0x67, 0x6e, 0x12, 0x18, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, - 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x62, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, - 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x42, 0x3b, 0x5a, 0x39, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 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, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x1a, 0xbb, 0x02, 0x0a, 0x07, 0x4c, 0x69, 0x74, 0x65, 0x72, + 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x36, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x3d, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 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, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4c, 0x69, 0x74, 0x65, 0x72, + 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0f, + 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x42, + 0x10, 0x0a, 0x07, 0x67, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, + 0x01, 0x22, 0x40, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x31, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x22, 0x41, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x44, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x27, 0x0a, 0x0e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, + 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6b, 0x65, 0x79, 0x49, 0x64, 0x32, 0xd2, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5a, 0x0a, 0x04, 0x53, 0x69, + 0x67, 0x6e, 0x12, 0x18, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, + 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x62, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -607,29 +619,30 @@ var file_security_v1_service_proto_goTypes = []interface{}{ (*Resource_Literal)(nil), // 5: security.v1.Resource.Literal (*Resource_ApiLiteral)(nil), // 6: security.v1.Resource.ApiLiteral (*structpb.Value)(nil), // 7: google.protobuf.Value - (*v1.Signature)(nil), // 8: utils.v1.Signature - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (*v1.Signature)(nil), // 9: utils.v1.Signature } var file_security_v1_service_proto_depIdxs = []int32{ 7, // 0: security.v1.Resource.api:type_name -> google.protobuf.Value 5, // 1: security.v1.Resource.literal:type_name -> security.v1.Resource.Literal 6, // 2: security.v1.Resource.api_literal:type_name -> security.v1.Resource.ApiLiteral - 0, // 3: security.v1.SignRequest.resource:type_name -> security.v1.Resource - 8, // 4: security.v1.SignResponse.signature:type_name -> utils.v1.Signature - 0, // 5: security.v1.VerifyRequest.resources:type_name -> security.v1.Resource - 7, // 6: security.v1.Resource.Literal.data:type_name -> google.protobuf.Value - 8, // 7: security.v1.Resource.Literal.signature:type_name -> utils.v1.Signature - 9, // 8: security.v1.Resource.Literal.last_updated:type_name -> google.protobuf.Timestamp - 7, // 9: security.v1.Resource.ApiLiteral.data:type_name -> google.protobuf.Value - 1, // 10: security.v1.SignatureService.Sign:input_type -> security.v1.SignRequest - 3, // 11: security.v1.SignatureService.Verify:input_type -> security.v1.VerifyRequest - 2, // 12: security.v1.SignatureService.Sign:output_type -> security.v1.SignResponse - 4, // 13: security.v1.SignatureService.Verify:output_type -> security.v1.VerifyResponse - 12, // [12:14] is the sub-list for method output_type - 10, // [10:12] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 8, // 3: security.v1.Resource.last_updated:type_name -> google.protobuf.Timestamp + 0, // 4: security.v1.SignRequest.resource:type_name -> security.v1.Resource + 9, // 5: security.v1.SignResponse.signature:type_name -> utils.v1.Signature + 0, // 6: security.v1.VerifyRequest.resources:type_name -> security.v1.Resource + 7, // 7: security.v1.Resource.Literal.data:type_name -> google.protobuf.Value + 9, // 8: security.v1.Resource.Literal.signature:type_name -> utils.v1.Signature + 8, // 9: security.v1.Resource.Literal.last_updated:type_name -> google.protobuf.Timestamp + 7, // 10: security.v1.Resource.ApiLiteral.data:type_name -> google.protobuf.Value + 1, // 11: security.v1.SignatureService.Sign:input_type -> security.v1.SignRequest + 3, // 12: security.v1.SignatureService.Verify:input_type -> security.v1.VerifyRequest + 2, // 13: security.v1.SignatureService.Sign:output_type -> security.v1.SignResponse + 4, // 14: security.v1.SignatureService.Verify:output_type -> security.v1.VerifyResponse + 13, // [13:15] is the sub-list for method output_type + 11, // [11:13] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_security_v1_service_proto_init() } diff --git a/types/gen/go/security/v1/service.pb.validate.go b/types/gen/go/security/v1/service.pb.validate.go index c626ab53..39694e3b 100644 --- a/types/gen/go/security/v1/service.pb.validate.go +++ b/types/gen/go/security/v1/service.pb.validate.go @@ -57,6 +57,35 @@ func (m *Resource) validate(all bool) error { var errors []error + if all { + switch v := interface{}(m.GetLastUpdated()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "LastUpdated", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ResourceValidationError{ + field: "LastUpdated", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLastUpdated()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ResourceValidationError{ + field: "LastUpdated", + reason: "embedded message failed validation", + cause: err, + } + } + } + switch v := m.Config.(type) { case *Resource_Api: if v == nil { diff --git a/types/gen/js/security/v1/service_pb.d.ts b/types/gen/js/security/v1/service_pb.d.ts index 8e679303..30018b39 100644 --- a/types/gen/js/security/v1/service_pb.d.ts +++ b/types/gen/js/security/v1/service_pb.d.ts @@ -37,6 +37,11 @@ export class Resource extends jspb.Message { getBranchName(): string; setBranchName(value: string): Resource; + hasLastUpdated(): boolean; + clearLastUpdated(): void; + getLastUpdated(): google_protobuf_timestamp_pb.Timestamp | undefined; + setLastUpdated(value?: google_protobuf_timestamp_pb.Timestamp): Resource; + getConfigCase(): Resource.ConfigCase; getGitRefCase(): Resource.GitRefCase; @@ -57,6 +62,7 @@ export namespace Resource { apiLiteral?: Resource.ApiLiteral.AsObject, commitId: string, branchName: string, + lastUpdated?: google_protobuf_timestamp_pb.Timestamp.AsObject, } diff --git a/types/gen/js/security/v1/service_pb.js b/types/gen/js/security/v1/service_pb.js index 2d819a8f..784bc5b3 100644 --- a/types/gen/js/security/v1/service_pb.js +++ b/types/gen/js/security/v1/service_pb.js @@ -266,7 +266,8 @@ api: (f = msg.getApi()) && google_protobuf_struct_pb.Value.toObject(includeInsta literal: (f = msg.getLiteral()) && proto.security.v1.Resource.Literal.toObject(includeInstance, f), apiLiteral: (f = msg.getApiLiteral()) && proto.security.v1.Resource.ApiLiteral.toObject(includeInstance, f), commitId: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, -branchName: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f +branchName: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, +lastUpdated: (f = msg.getLastUpdated()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f) }; if (includeInstance) { @@ -326,6 +327,11 @@ proto.security.v1.Resource.deserializeBinaryFromReader = function(msg, reader) { var value = /** @type {string} */ (reader.readString()); msg.setBranchName(value); break; + case 6: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setLastUpdated(value); + break; default: reader.skipField(); break; @@ -393,6 +399,14 @@ proto.security.v1.Resource.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getLastUpdated(); + if (f != null) { + writer.writeMessage( + 6, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } }; @@ -1103,6 +1117,43 @@ proto.security.v1.Resource.prototype.hasBranchName = function() { }; +/** + * optional google.protobuf.Timestamp last_updated = 6; + * @return {?proto.google.protobuf.Timestamp} + */ +proto.security.v1.Resource.prototype.getLastUpdated = function() { + return /** @type{?proto.google.protobuf.Timestamp} */ ( + jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 6)); +}; + + +/** + * @param {?proto.google.protobuf.Timestamp|undefined} value + * @return {!proto.security.v1.Resource} returns this +*/ +proto.security.v1.Resource.prototype.setLastUpdated = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.security.v1.Resource} returns this + */ +proto.security.v1.Resource.prototype.clearLastUpdated = function() { + return this.setLastUpdated(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.security.v1.Resource.prototype.hasLastUpdated = function() { + return jspb.Message.getField(this, 6) != null; +}; + + diff --git a/types/gen/py/superblocks_types/security/v1/service_pb2.py b/types/gen/py/superblocks_types/security/v1/service_pb2.py index 59bef7d2..d0724eb3 100644 --- a/types/gen/py/superblocks_types/security/v1/service_pb2.py +++ b/types/gen/py/superblocks_types/security/v1/service_pb2.py @@ -29,7 +29,7 @@ from superblocks_types.utils.v1 import utils_pb2 as utils_dot_v1_dot_utils__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19security/v1/service.proto\x12\x0bsecurity.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14utils/v1/utils.proto\"\x97\x05\n\x08Resource\x12.\n\x03\x61pi\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueB\x02\x18\x01H\x00R\x03\x61pi\x12\x39\n\x07literal\x18\x02 \x01(\x0b\x32\x1d.security.v1.Resource.LiteralH\x00R\x07literal\x12\x43\n\x0b\x61pi_literal\x18\x05 \x01(\x0b\x32 .security.v1.Resource.ApiLiteralH\x00R\napiLiteral\x12\x1d\n\tcommit_id\x18\x03 \x01(\tH\x01R\x08\x63ommitId\x12!\n\x0b\x62ranch_name\x18\x04 \x01(\tH\x01R\nbranchName\x1a\xbb\x02\n\x07Literal\x12*\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueR\x04\x64\x61ta\x12\x36\n\tsignature\x18\x02 \x01(\x0b\x32\x13.utils.v1.SignatureH\x00R\tsignature\x88\x01\x01\x12\x1f\n\x0bresource_id\x18\x03 \x01(\tR\nresourceId\x12\'\n\x0forganization_id\x18\x04 \x01(\tR\x0eorganizationId\x12=\n\x0clast_updated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0blastUpdated\x12\x12\n\x04type\x18\x06 \x01(\tR\x04type\x12!\n\x0cpage_version\x18\x07 \x01(\x05R\x0bpageVersionB\x0c\n\n_signature\x1a\x38\n\nApiLiteral\x12*\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueR\x04\x64\x61taB\x0f\n\x06\x63onfig\x12\x05\xbaH\x02\x08\x01\x42\x10\n\x07git_ref\x12\x05\xbaH\x02\x08\x01\"@\n\x0bSignRequest\x12\x31\n\x08resource\x18\x01 \x01(\x0b\x32\x15.security.v1.ResourceR\x08resource\"A\n\x0cSignResponse\x12\x31\n\tsignature\x18\x01 \x01(\x0b\x32\x13.utils.v1.SignatureR\tsignature\"D\n\rVerifyRequest\x12\x33\n\tresources\x18\x01 \x03(\x0b\x32\x15.security.v1.ResourceR\tresources\"\'\n\x0eVerifyResponse\x12\x15\n\x06key_id\x18\x01 \x01(\tR\x05keyId2\xd2\x01\n\x10SignatureService\x12Z\n\x04Sign\x12\x18.security.v1.SignRequest\x1a\x19.security.v1.SignResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/v1/signature/sign:\x01*\x12\x62\n\x06Verify\x12\x1a.security.v1.VerifyRequest\x1a\x1b.security.v1.VerifyResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/v1/signature/verify:\x01*B;Z9github.com/superblocksteam/agent/types/gen/go/security/v1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19security/v1/service.proto\x12\x0bsecurity.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14utils/v1/utils.proto\"\xd6\x05\n\x08Resource\x12.\n\x03\x61pi\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueB\x02\x18\x01H\x00R\x03\x61pi\x12\x39\n\x07literal\x18\x02 \x01(\x0b\x32\x1d.security.v1.Resource.LiteralH\x00R\x07literal\x12\x43\n\x0b\x61pi_literal\x18\x05 \x01(\x0b\x32 .security.v1.Resource.ApiLiteralH\x00R\napiLiteral\x12\x1d\n\tcommit_id\x18\x03 \x01(\tH\x01R\x08\x63ommitId\x12!\n\x0b\x62ranch_name\x18\x04 \x01(\tH\x01R\nbranchName\x12=\n\x0clast_updated\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0blastUpdated\x1a\xbb\x02\n\x07Literal\x12*\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueR\x04\x64\x61ta\x12\x36\n\tsignature\x18\x02 \x01(\x0b\x32\x13.utils.v1.SignatureH\x00R\tsignature\x88\x01\x01\x12\x1f\n\x0bresource_id\x18\x03 \x01(\tR\nresourceId\x12\'\n\x0forganization_id\x18\x04 \x01(\tR\x0eorganizationId\x12=\n\x0clast_updated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0blastUpdated\x12\x12\n\x04type\x18\x06 \x01(\tR\x04type\x12!\n\x0cpage_version\x18\x07 \x01(\x05R\x0bpageVersionB\x0c\n\n_signature\x1a\x38\n\nApiLiteral\x12*\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x16.google.protobuf.ValueR\x04\x64\x61taB\x0f\n\x06\x63onfig\x12\x05\xbaH\x02\x08\x01\x42\x10\n\x07git_ref\x12\x05\xbaH\x02\x08\x01\"@\n\x0bSignRequest\x12\x31\n\x08resource\x18\x01 \x01(\x0b\x32\x15.security.v1.ResourceR\x08resource\"A\n\x0cSignResponse\x12\x31\n\tsignature\x18\x01 \x01(\x0b\x32\x13.utils.v1.SignatureR\tsignature\"D\n\rVerifyRequest\x12\x33\n\tresources\x18\x01 \x03(\x0b\x32\x15.security.v1.ResourceR\tresources\"\'\n\x0eVerifyResponse\x12\x15\n\x06key_id\x18\x01 \x01(\tR\x05keyId2\xd2\x01\n\x10SignatureService\x12Z\n\x04Sign\x12\x18.security.v1.SignRequest\x1a\x19.security.v1.SignResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x12/v1/signature/sign:\x01*\x12\x62\n\x06Verify\x12\x1a.security.v1.VerifyRequest\x1a\x1b.security.v1.VerifyResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/v1/signature/verify:\x01*B;Z9github.com/superblocksteam/agent/types/gen/go/security/v1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -48,19 +48,19 @@ _globals['_SIGNATURESERVICE'].methods_by_name['Verify']._loaded_options = None _globals['_SIGNATURESERVICE'].methods_by_name['Verify']._serialized_options = b'\202\323\344\223\002\031\"\024/v1/signature/verify:\001*' _globals['_RESOURCE']._serialized_start=187 - _globals['_RESOURCE']._serialized_end=850 - _globals['_RESOURCE_LITERAL']._serialized_start=442 - _globals['_RESOURCE_LITERAL']._serialized_end=757 - _globals['_RESOURCE_APILITERAL']._serialized_start=759 - _globals['_RESOURCE_APILITERAL']._serialized_end=815 - _globals['_SIGNREQUEST']._serialized_start=852 - _globals['_SIGNREQUEST']._serialized_end=916 - _globals['_SIGNRESPONSE']._serialized_start=918 - _globals['_SIGNRESPONSE']._serialized_end=983 - _globals['_VERIFYREQUEST']._serialized_start=985 - _globals['_VERIFYREQUEST']._serialized_end=1053 - _globals['_VERIFYRESPONSE']._serialized_start=1055 - _globals['_VERIFYRESPONSE']._serialized_end=1094 - _globals['_SIGNATURESERVICE']._serialized_start=1097 - _globals['_SIGNATURESERVICE']._serialized_end=1307 + _globals['_RESOURCE']._serialized_end=913 + _globals['_RESOURCE_LITERAL']._serialized_start=505 + _globals['_RESOURCE_LITERAL']._serialized_end=820 + _globals['_RESOURCE_APILITERAL']._serialized_start=822 + _globals['_RESOURCE_APILITERAL']._serialized_end=878 + _globals['_SIGNREQUEST']._serialized_start=915 + _globals['_SIGNREQUEST']._serialized_end=979 + _globals['_SIGNRESPONSE']._serialized_start=981 + _globals['_SIGNRESPONSE']._serialized_end=1046 + _globals['_VERIFYREQUEST']._serialized_start=1048 + _globals['_VERIFYREQUEST']._serialized_end=1116 + _globals['_VERIFYRESPONSE']._serialized_start=1118 + _globals['_VERIFYRESPONSE']._serialized_end=1157 + _globals['_SIGNATURESERVICE']._serialized_start=1160 + _globals['_SIGNATURESERVICE']._serialized_end=1370 # @@protoc_insertion_point(module_scope) diff --git a/types/proto/security/v1/service.proto b/types/proto/security/v1/service.proto index 8e0654cb..3e6e28ec 100644 --- a/types/proto/security/v1/service.proto +++ b/types/proto/security/v1/service.proto @@ -53,6 +53,8 @@ message Resource { string commit_id = 3; string branch_name = 4; } + + google.protobuf.Timestamp last_updated = 6; } message SignRequest { diff --git a/workers/javascript/packages/types/src/security/v1/service_pb.ts b/workers/javascript/packages/types/src/security/v1/service_pb.ts index db95f5da..8142fdd1 100644 --- a/workers/javascript/packages/types/src/security/v1/service_pb.ts +++ b/workers/javascript/packages/types/src/security/v1/service_pb.ts @@ -52,6 +52,11 @@ export class Resource extends Message { case: "branchName"; } | { case: undefined; value?: undefined } = { case: undefined }; + /** + * @generated from field: google.protobuf.Timestamp last_updated = 6; + */ + lastUpdated?: Timestamp; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -65,6 +70,7 @@ export class Resource extends Message { { no: 5, name: "api_literal", kind: "message", T: Resource_ApiLiteral, oneof: "config" }, { no: 3, name: "commit_id", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "git_ref" }, { no: 4, name: "branch_name", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "git_ref" }, + { no: 6, name: "last_updated", kind: "message", T: Timestamp }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Resource {