From 2d815365a68b4584cc1e24069a5ddcd99b2ad99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Thu, 21 May 2026 19:11:19 +0100 Subject: [PATCH] chore: vendor at_revision zedtoken on DownloadPermissionSetsResponse Bringing in authzed/api#169. Bump BufTag to 55aa23d533a34fa8bf8c7cf1744d8bf7 and regenerate. --- magefiles/gen.go | 2 +- .../materialize/v0/watchpermissionsets.pb.go | 43 ++++++--- .../v0/watchpermissionsets.pb.validate.go | 29 ++++++ .../v0/watchpermissionsets_vtproto.pb.go | 90 +++++++++++++++++++ .../api/materialize/zz_generated.version.go | 2 +- proto/authzed/api/v0/zz_generated.version.go | 2 +- proto/authzed/api/v1/zz_generated.version.go | 2 +- 7 files changed, 152 insertions(+), 18 deletions(-) diff --git a/magefiles/gen.go b/magefiles/gen.go index 13155b9..5f5fd8e 100644 --- a/magefiles/gen.go +++ b/magefiles/gen.go @@ -24,7 +24,7 @@ func (g Gen) All() error { const ( ProtoPath = "proto/authzed/api" BufRepository = "buf.build/authzed/api" - BufTag = "1d4ce2d4563b4dcbacdf7fb651e358b5" + BufTag = "55aa23d533a34fa8bf8c7cf1744d8bf7" ) // Proto runs proto codegen diff --git a/proto/authzed/api/materialize/v0/watchpermissionsets.pb.go b/proto/authzed/api/materialize/v0/watchpermissionsets.pb.go index fa1f7af..d97c643 100644 --- a/proto/authzed/api/materialize/v0/watchpermissionsets.pb.go +++ b/proto/authzed/api/materialize/v0/watchpermissionsets.pb.go @@ -913,7 +913,12 @@ type DownloadPermissionSetsResponse struct { // files contains the list of downloadable files with their URLs Files []*File `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` // timestamp represents the time associated with the returned data revision. - Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // at_revision is the snapshot revision the returned files were produced at, + // encoded as a ZedToken. Consumers should pass this token to + // WatchPermissionSets as optional_starting_after to resume the stream + // immediately after the snapshot without leaving gaps in event history. + AtRevision *v1.ZedToken `protobuf:"bytes,3,opt,name=at_revision,json=atRevision,proto3" json:"at_revision,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -962,6 +967,13 @@ func (x *DownloadPermissionSetsResponse) GetTimestamp() *timestamppb.Timestamp { return nil } +func (x *DownloadPermissionSetsResponse) GetAtRevision() *v1.ZedToken { + if x != nil { + return x.AtRevision + } + return nil +} + var File_authzed_api_materialize_v0_watchpermissionsets_proto protoreflect.FileDescriptor const file_authzed_api_materialize_v0_watchpermissionsets_proto_rawDesc = "" + @@ -1022,10 +1034,12 @@ const file_authzed_api_materialize_v0_watchpermissionsets_proto_rawDesc = "" + "\x14optional_at_revision\x18\x01 \x01(\v2\x18.authzed.api.v1.ZedTokenR\x12optionalAtRevision\",\n" + "\x04File\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + - "\x03url\x18\x02 \x01(\tR\x03url\"\x92\x01\n" + + "\x03url\x18\x02 \x01(\tR\x03url\"\xcd\x01\n" + "\x1eDownloadPermissionSetsResponse\x126\n" + "\x05files\x18\x01 \x03(\v2 .authzed.api.materialize.v0.FileR\x05files\x128\n" + - "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp2\xcd\x03\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x129\n" + + "\vat_revision\x18\x03 \x01(\v2\x18.authzed.api.v1.ZedTokenR\n" + + "atRevision2\xcd\x03\n" + "\x1aWatchPermissionSetsService\x12\x8a\x01\n" + "\x13WatchPermissionSets\x126.authzed.api.materialize.v0.WatchPermissionSetsRequest\x1a7.authzed.api.materialize.v0.WatchPermissionSetsResponse\"\x000\x01\x12\x8d\x01\n" + "\x14LookupPermissionSets\x127.authzed.api.materialize.v0.LookupPermissionSetsRequest\x1a8.authzed.api.materialize.v0.LookupPermissionSetsResponse\"\x000\x01\x12\x91\x01\n" + @@ -1087,17 +1101,18 @@ var file_authzed_api_materialize_v0_watchpermissionsets_proto_depIdxs = []int32{ 14, // 18: authzed.api.materialize.v0.DownloadPermissionSetsRequest.optional_at_revision:type_name -> authzed.api.v1.ZedToken 12, // 19: authzed.api.materialize.v0.DownloadPermissionSetsResponse.files:type_name -> authzed.api.materialize.v0.File 16, // 20: authzed.api.materialize.v0.DownloadPermissionSetsResponse.timestamp:type_name -> google.protobuf.Timestamp - 1, // 21: authzed.api.materialize.v0.WatchPermissionSetsService.WatchPermissionSets:input_type -> authzed.api.materialize.v0.WatchPermissionSetsRequest - 4, // 22: authzed.api.materialize.v0.WatchPermissionSetsService.LookupPermissionSets:input_type -> authzed.api.materialize.v0.LookupPermissionSetsRequest - 11, // 23: authzed.api.materialize.v0.WatchPermissionSetsService.DownloadPermissionSets:input_type -> authzed.api.materialize.v0.DownloadPermissionSetsRequest - 2, // 24: authzed.api.materialize.v0.WatchPermissionSetsService.WatchPermissionSets:output_type -> authzed.api.materialize.v0.WatchPermissionSetsResponse - 5, // 25: authzed.api.materialize.v0.WatchPermissionSetsService.LookupPermissionSets:output_type -> authzed.api.materialize.v0.LookupPermissionSetsResponse - 13, // 26: authzed.api.materialize.v0.WatchPermissionSetsService.DownloadPermissionSets:output_type -> authzed.api.materialize.v0.DownloadPermissionSetsResponse - 24, // [24:27] is the sub-list for method output_type - 21, // [21:24] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 14, // 21: authzed.api.materialize.v0.DownloadPermissionSetsResponse.at_revision:type_name -> authzed.api.v1.ZedToken + 1, // 22: authzed.api.materialize.v0.WatchPermissionSetsService.WatchPermissionSets:input_type -> authzed.api.materialize.v0.WatchPermissionSetsRequest + 4, // 23: authzed.api.materialize.v0.WatchPermissionSetsService.LookupPermissionSets:input_type -> authzed.api.materialize.v0.LookupPermissionSetsRequest + 11, // 24: authzed.api.materialize.v0.WatchPermissionSetsService.DownloadPermissionSets:input_type -> authzed.api.materialize.v0.DownloadPermissionSetsRequest + 2, // 25: authzed.api.materialize.v0.WatchPermissionSetsService.WatchPermissionSets:output_type -> authzed.api.materialize.v0.WatchPermissionSetsResponse + 5, // 26: authzed.api.materialize.v0.WatchPermissionSetsService.LookupPermissionSets:output_type -> authzed.api.materialize.v0.LookupPermissionSetsResponse + 13, // 27: authzed.api.materialize.v0.WatchPermissionSetsService.DownloadPermissionSets:output_type -> authzed.api.materialize.v0.DownloadPermissionSetsResponse + 25, // [25:28] is the sub-list for method output_type + 22, // [22:25] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_authzed_api_materialize_v0_watchpermissionsets_proto_init() } diff --git a/proto/authzed/api/materialize/v0/watchpermissionsets.pb.validate.go b/proto/authzed/api/materialize/v0/watchpermissionsets.pb.validate.go index 81bc4e4..2244940 100644 --- a/proto/authzed/api/materialize/v0/watchpermissionsets.pb.validate.go +++ b/proto/authzed/api/materialize/v0/watchpermissionsets.pb.validate.go @@ -1975,6 +1975,35 @@ func (m *DownloadPermissionSetsResponse) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetAtRevision()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, DownloadPermissionSetsResponseValidationError{ + field: "AtRevision", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, DownloadPermissionSetsResponseValidationError{ + field: "AtRevision", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAtRevision()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DownloadPermissionSetsResponseValidationError{ + field: "AtRevision", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return DownloadPermissionSetsResponseMultiError(errors) } diff --git a/proto/authzed/api/materialize/v0/watchpermissionsets_vtproto.pb.go b/proto/authzed/api/materialize/v0/watchpermissionsets_vtproto.pb.go index 91c1f76..5052287 100644 --- a/proto/authzed/api/materialize/v0/watchpermissionsets_vtproto.pb.go +++ b/proto/authzed/api/materialize/v0/watchpermissionsets_vtproto.pb.go @@ -372,6 +372,13 @@ func (m *DownloadPermissionSetsResponse) CloneVT() *DownloadPermissionSetsRespon } r.Files = tmpContainer } + if rhs := m.AtRevision; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *v1.ZedToken }); ok { + r.AtRevision = vtpb.CloneVT() + } else { + r.AtRevision = proto.Clone(rhs).(*v1.ZedToken) + } + } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -902,6 +909,13 @@ func (this *DownloadPermissionSetsResponse) EqualVT(that *DownloadPermissionSets if !(*timestamppb1.Timestamp)(this.Timestamp).EqualVT((*timestamppb1.Timestamp)(that.Timestamp)) { return false } + if equal, ok := interface{}(this.AtRevision).(interface{ EqualVT(*v1.ZedToken) bool }); ok { + if !equal.EqualVT(that.AtRevision) { + return false + } + } else if !proto.Equal(this.AtRevision, that.AtRevision) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -1812,6 +1826,28 @@ func (m *DownloadPermissionSetsResponse) MarshalToSizedBufferVT(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.AtRevision != nil { + if vtmsg, ok := interface{}(m.AtRevision).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.AtRevision) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1a + } if m.Timestamp != nil { size, err := (*timestamppb1.Timestamp)(m.Timestamp).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -2216,6 +2252,16 @@ func (m *DownloadPermissionSetsResponse) SizeVT() (n int) { l = (*timestamppb1.Timestamp)(m.Timestamp).SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.AtRevision != nil { + if size, ok := interface{}(m.AtRevision).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.AtRevision) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -4095,6 +4141,50 @@ func (m *DownloadPermissionSetsResponse) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AtRevision", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AtRevision == nil { + m.AtRevision = &v1.ZedToken{} + } + if unmarshal, ok := interface{}(m.AtRevision).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.AtRevision); err != nil { + return err + } + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/proto/authzed/api/materialize/zz_generated.version.go b/proto/authzed/api/materialize/zz_generated.version.go index 3f4b598..5d270d0 100644 --- a/proto/authzed/api/materialize/zz_generated.version.go +++ b/proto/authzed/api/materialize/zz_generated.version.go @@ -2,5 +2,5 @@ package materialize const ( BufRepository = "buf.build/authzed/api" - BufTag = "1d4ce2d4563b4dcbacdf7fb651e358b5" + BufTag = "55aa23d533a34fa8bf8c7cf1744d8bf7" ) diff --git a/proto/authzed/api/v0/zz_generated.version.go b/proto/authzed/api/v0/zz_generated.version.go index b164fe4..6bf3c39 100644 --- a/proto/authzed/api/v0/zz_generated.version.go +++ b/proto/authzed/api/v0/zz_generated.version.go @@ -2,5 +2,5 @@ package v0 const ( BufRepository = "buf.build/authzed/api" - BufTag = "1d4ce2d4563b4dcbacdf7fb651e358b5" + BufTag = "55aa23d533a34fa8bf8c7cf1744d8bf7" ) diff --git a/proto/authzed/api/v1/zz_generated.version.go b/proto/authzed/api/v1/zz_generated.version.go index e94a61b..0e44d2e 100644 --- a/proto/authzed/api/v1/zz_generated.version.go +++ b/proto/authzed/api/v1/zz_generated.version.go @@ -2,5 +2,5 @@ package v1 const ( BufRepository = "buf.build/authzed/api" - BufTag = "1d4ce2d4563b4dcbacdf7fb651e358b5" + BufTag = "55aa23d533a34fa8bf8c7cf1744d8bf7" )