From d47d7f5d1dd69b3451e409b555d5191f79452bc1 Mon Sep 17 00:00:00 2001 From: Justin Gallardo Date: Fri, 29 Aug 2025 12:38:05 -0700 Subject: [PATCH 1/3] Checkpoint Fix deadlock Play around with concurrent resource tasks A little log cleanup More log cleanup fix build Add task with retry and backoff default shouldFetchRelated to false Check context when waiting to add task Fix syntax error fix logging Fix deadlocks Don't exit the sync early if we aren't making enough progress. Call expand grants until it is complete Wire up parallel sync config option to service mode sync tasks. fix issue where only 10,000 entitlements are synced add CollectEntitlementsAndGrantsTasksOp set default worker count to 2 apply lock when updating entitlements progress during parallel sync use exponential backoff in addTaskWithRetry refactor so that AddTask* has minimal locking fix entitlement and grant progress counts we are tracking the number of resources processed, not the total number of entitlements and grants lock when expanding queues Use a transaction per chunk during bulk object put, also retry sqlite busy/dblocked errors. WAL checkpoint on 5 minute interval pause sqlite activity during checkpoint manual WAL checkpoints only apply to parallel sync update comment --- pb/c1/connector/v2/resource.pb.go | 2896 ++++++-------------- pb/c1/connector/v2/resource.pb.validate.go | 2 + pkg/cli/commands.go | 4 + pkg/connectorrunner/runner.go | 13 +- pkg/dotc1z/c1file.go | 109 +- pkg/dotc1z/manager/local/local.go | 18 +- pkg/dotc1z/manager/manager.go | 17 +- pkg/dotc1z/manager/s3/s3.go | 20 +- pkg/dotc1z/sql_helpers.go | 103 +- pkg/field/defaults.go | 2 + pkg/sync/parallel_syncer.go | 2189 +++++++++++++++ pkg/sync/state.go | 5 + pkg/sync/syncer.go | 298 +- pkg/tasks/c1api/full_sync.go | 13 +- pkg/tasks/c1api/manager.go | 14 +- pkg/tasks/local/syncer.go | 19 +- proto/c1/connector/v2/resource.proto | 6 + 17 files changed, 3531 insertions(+), 2197 deletions(-) create mode 100644 pkg/sync/parallel_syncer.go diff --git a/pb/c1/connector/v2/resource.pb.go b/pb/c1/connector/v2/resource.pb.go index f09a6418b..34606533a 100644 --- a/pb/c1/connector/v2/resource.pb.go +++ b/pb/c1/connector/v2/resource.pb.go @@ -1,11 +1,9 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 +// protoc-gen-go v1.36.4 // protoc (unknown) // source: c1/connector/v2/resource.proto -//go:build !protoopaque - package v2 import ( @@ -15,6 +13,7 @@ import ( anypb "google.golang.org/protobuf/types/known/anypb" structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" + sync "sync" unsafe "unsafe" ) @@ -78,6 +77,11 @@ func (x ResourceType_Trait) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } +// Deprecated: Use ResourceType_Trait.Descriptor instead. +func (ResourceType_Trait) EnumDescriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{0, 0} +} + // FIXME(mstanbCO): call this something else? Should it just be a bool? Possibly just use an annotation? type Resource_CreationSource int32 @@ -123,16 +127,26 @@ func (x Resource_CreationSource) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } +// Deprecated: Use Resource_CreationSource.Descriptor instead. +func (Resource_CreationSource) EnumDescriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21, 0} +} + type ResourceType struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` Traits []ResourceType_Trait `protobuf:"varint,3,rep,packed,name=traits,proto3,enum=c1.connector.v2.ResourceType_Trait" json:"traits,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` SourcedExternally bool `protobuf:"varint,6,opt,name=sourced_externally,json=sourcedExternally,proto3" json:"sourced_externally,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Sync bucketing configuration for parallel processing + // Resource types with the same bucket name will be processed sequentially within that bucket + // Resource types with different bucket names can be processed in parallel + // If not specified, the default bucket from ParallelSyncConfig will be used + SyncBucket string `protobuf:"bytes,7,opt,name=sync_bucket,json=syncBucket,proto3" json:"sync_bucket,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ResourceType) Reset() { @@ -160,6 +174,11 @@ func (x *ResourceType) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use ResourceType.ProtoReflect.Descriptor instead. +func (*ResourceType) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{0} +} + func (x *ResourceType) GetId() string { if x != nil { return x.Id @@ -202,56 +221,15 @@ func (x *ResourceType) GetSourcedExternally() bool { return false } -func (x *ResourceType) SetId(v string) { - x.Id = v -} - -func (x *ResourceType) SetDisplayName(v string) { - x.DisplayName = v -} - -func (x *ResourceType) SetTraits(v []ResourceType_Trait) { - x.Traits = v -} - -func (x *ResourceType) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *ResourceType) SetDescription(v string) { - x.Description = v -} - -func (x *ResourceType) SetSourcedExternally(v bool) { - x.SourcedExternally = v -} - -type ResourceType_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string - DisplayName string - Traits []ResourceType_Trait - Annotations []*anypb.Any - Description string - SourcedExternally bool -} - -func (b0 ResourceType_builder) Build() *ResourceType { - m0 := &ResourceType{} - b, x := &b0, m0 - _, _ = b, x - x.Id = b.Id - x.DisplayName = b.DisplayName - x.Traits = b.Traits - x.Annotations = b.Annotations - x.Description = b.Description - x.SourcedExternally = b.SourcedExternally - return m0 +func (x *ResourceType) GetSyncBucket() string { + if x != nil { + return x.SyncBucket + } + return "" } type ResourceTypesServiceListResourceTypesRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Parent *Resource `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` @@ -286,6 +264,11 @@ func (x *ResourceTypesServiceListResourceTypesRequest) ProtoReflect() protorefle return mi.MessageOf(x) } +// Deprecated: Use ResourceTypesServiceListResourceTypesRequest.ProtoReflect.Descriptor instead. +func (*ResourceTypesServiceListResourceTypesRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{1} +} + func (x *ResourceTypesServiceListResourceTypesRequest) GetParent() *Resource { if x != nil { return x.Parent @@ -321,61 +304,8 @@ func (x *ResourceTypesServiceListResourceTypesRequest) GetActiveSyncId() string return "" } -func (x *ResourceTypesServiceListResourceTypesRequest) SetParent(v *Resource) { - x.Parent = v -} - -func (x *ResourceTypesServiceListResourceTypesRequest) SetPageSize(v uint32) { - x.PageSize = v -} - -func (x *ResourceTypesServiceListResourceTypesRequest) SetPageToken(v string) { - x.PageToken = v -} - -func (x *ResourceTypesServiceListResourceTypesRequest) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *ResourceTypesServiceListResourceTypesRequest) SetActiveSyncId(v string) { - x.ActiveSyncId = v -} - -func (x *ResourceTypesServiceListResourceTypesRequest) HasParent() bool { - if x == nil { - return false - } - return x.Parent != nil -} - -func (x *ResourceTypesServiceListResourceTypesRequest) ClearParent() { - x.Parent = nil -} - -type ResourceTypesServiceListResourceTypesRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Parent *Resource - PageSize uint32 - PageToken string - Annotations []*anypb.Any - ActiveSyncId string -} - -func (b0 ResourceTypesServiceListResourceTypesRequest_builder) Build() *ResourceTypesServiceListResourceTypesRequest { - m0 := &ResourceTypesServiceListResourceTypesRequest{} - b, x := &b0, m0 - _, _ = b, x - x.Parent = b.Parent - x.PageSize = b.PageSize - x.PageToken = b.PageToken - x.Annotations = b.Annotations - x.ActiveSyncId = b.ActiveSyncId - return m0 -} - type ResourceTypesServiceListResourceTypesResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` List []*ResourceType `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -408,6 +338,11 @@ func (x *ResourceTypesServiceListResourceTypesResponse) ProtoReflect() protorefl return mi.MessageOf(x) } +// Deprecated: Use ResourceTypesServiceListResourceTypesResponse.ProtoReflect.Descriptor instead. +func (*ResourceTypesServiceListResourceTypesResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{2} +} + func (x *ResourceTypesServiceListResourceTypesResponse) GetList() []*ResourceType { if x != nil { return x.List @@ -429,38 +364,8 @@ func (x *ResourceTypesServiceListResourceTypesResponse) GetAnnotations() []*anyp return nil } -func (x *ResourceTypesServiceListResourceTypesResponse) SetList(v []*ResourceType) { - x.List = v -} - -func (x *ResourceTypesServiceListResourceTypesResponse) SetNextPageToken(v string) { - x.NextPageToken = v -} - -func (x *ResourceTypesServiceListResourceTypesResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -type ResourceTypesServiceListResourceTypesResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - List []*ResourceType - NextPageToken string - Annotations []*anypb.Any -} - -func (b0 ResourceTypesServiceListResourceTypesResponse_builder) Build() *ResourceTypesServiceListResourceTypesResponse { - m0 := &ResourceTypesServiceListResourceTypesResponse{} - b, x := &b0, m0 - _, _ = b, x - x.List = b.List - x.NextPageToken = b.NextPageToken - x.Annotations = b.Annotations - return m0 -} - type CreateResourceRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -491,6 +396,11 @@ func (x *CreateResourceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CreateResourceRequest.ProtoReflect.Descriptor instead. +func (*CreateResourceRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{3} +} + func (x *CreateResourceRequest) GetResource() *Resource { if x != nil { return x.Resource @@ -498,37 +408,8 @@ func (x *CreateResourceRequest) GetResource() *Resource { return nil } -func (x *CreateResourceRequest) SetResource(v *Resource) { - x.Resource = v -} - -func (x *CreateResourceRequest) HasResource() bool { - if x == nil { - return false - } - return x.Resource != nil -} - -func (x *CreateResourceRequest) ClearResource() { - x.Resource = nil -} - -type CreateResourceRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Resource *Resource -} - -func (b0 CreateResourceRequest_builder) Build() *CreateResourceRequest { - m0 := &CreateResourceRequest{} - b, x := &b0, m0 - _, _ = b, x - x.Resource = b.Resource - return m0 -} - type CreateResourceResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Created *Resource `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields @@ -560,6 +441,11 @@ func (x *CreateResourceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CreateResourceResponse.ProtoReflect.Descriptor instead. +func (*CreateResourceResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{4} +} + func (x *CreateResourceResponse) GetCreated() *Resource { if x != nil { return x.Created @@ -574,43 +460,8 @@ func (x *CreateResourceResponse) GetAnnotations() []*anypb.Any { return nil } -func (x *CreateResourceResponse) SetCreated(v *Resource) { - x.Created = v -} - -func (x *CreateResourceResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *CreateResourceResponse) HasCreated() bool { - if x == nil { - return false - } - return x.Created != nil -} - -func (x *CreateResourceResponse) ClearCreated() { - x.Created = nil -} - -type CreateResourceResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Created *Resource - Annotations []*anypb.Any -} - -func (b0 CreateResourceResponse_builder) Build() *CreateResourceResponse { - m0 := &CreateResourceResponse{} - b, x := &b0, m0 - _, _ = b, x - x.Created = b.Created - x.Annotations = b.Annotations - return m0 -} - type DeleteResourceRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` unknownFields protoimpl.UnknownFields @@ -642,6 +493,11 @@ func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead. +func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{5} +} + func (x *DeleteResourceRequest) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -656,54 +512,8 @@ func (x *DeleteResourceRequest) GetParentResourceId() *ResourceId { return nil } -func (x *DeleteResourceRequest) SetResourceId(v *ResourceId) { - x.ResourceId = v -} - -func (x *DeleteResourceRequest) SetParentResourceId(v *ResourceId) { - x.ParentResourceId = v -} - -func (x *DeleteResourceRequest) HasResourceId() bool { - if x == nil { - return false - } - return x.ResourceId != nil -} - -func (x *DeleteResourceRequest) HasParentResourceId() bool { - if x == nil { - return false - } - return x.ParentResourceId != nil -} - -func (x *DeleteResourceRequest) ClearResourceId() { - x.ResourceId = nil -} - -func (x *DeleteResourceRequest) ClearParentResourceId() { - x.ParentResourceId = nil -} - -type DeleteResourceRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceId *ResourceId - ParentResourceId *ResourceId -} - -func (b0 DeleteResourceRequest_builder) Build() *DeleteResourceRequest { - m0 := &DeleteResourceRequest{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceId = b.ResourceId - x.ParentResourceId = b.ParentResourceId - return m0 -} - type DeleteResourceResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -734,6 +544,11 @@ func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use DeleteResourceResponse.ProtoReflect.Descriptor instead. +func (*DeleteResourceResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{6} +} + func (x *DeleteResourceResponse) GetAnnotations() []*anypb.Any { if x != nil { return x.Annotations @@ -741,26 +556,8 @@ func (x *DeleteResourceResponse) GetAnnotations() []*anypb.Any { return nil } -func (x *DeleteResourceResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -type DeleteResourceResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Annotations []*anypb.Any -} - -func (b0 DeleteResourceResponse_builder) Build() *DeleteResourceResponse { - m0 := &DeleteResourceResponse{} - b, x := &b0, m0 - _, _ = b, x - x.Annotations = b.Annotations - return m0 -} - type DeleteResourceV2Request struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` unknownFields protoimpl.UnknownFields @@ -792,6 +589,11 @@ func (x *DeleteResourceV2Request) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use DeleteResourceV2Request.ProtoReflect.Descriptor instead. +func (*DeleteResourceV2Request) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{7} +} + func (x *DeleteResourceV2Request) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -806,54 +608,8 @@ func (x *DeleteResourceV2Request) GetParentResourceId() *ResourceId { return nil } -func (x *DeleteResourceV2Request) SetResourceId(v *ResourceId) { - x.ResourceId = v -} - -func (x *DeleteResourceV2Request) SetParentResourceId(v *ResourceId) { - x.ParentResourceId = v -} - -func (x *DeleteResourceV2Request) HasResourceId() bool { - if x == nil { - return false - } - return x.ResourceId != nil -} - -func (x *DeleteResourceV2Request) HasParentResourceId() bool { - if x == nil { - return false - } - return x.ParentResourceId != nil -} - -func (x *DeleteResourceV2Request) ClearResourceId() { - x.ResourceId = nil -} - -func (x *DeleteResourceV2Request) ClearParentResourceId() { - x.ParentResourceId = nil -} - -type DeleteResourceV2Request_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceId *ResourceId - ParentResourceId *ResourceId -} - -func (b0 DeleteResourceV2Request_builder) Build() *DeleteResourceV2Request { - m0 := &DeleteResourceV2Request{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceId = b.ResourceId - x.ParentResourceId = b.ParentResourceId - return m0 -} - type DeleteResourceV2Response struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -884,6 +640,11 @@ func (x *DeleteResourceV2Response) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use DeleteResourceV2Response.ProtoReflect.Descriptor instead. +func (*DeleteResourceV2Response) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{8} +} + func (x *DeleteResourceV2Response) GetAnnotations() []*anypb.Any { if x != nil { return x.Annotations @@ -891,26 +652,8 @@ func (x *DeleteResourceV2Response) GetAnnotations() []*anypb.Any { return nil } -func (x *DeleteResourceV2Response) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -type DeleteResourceV2Response_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Annotations []*anypb.Any -} - -func (b0 DeleteResourceV2Response_builder) Build() *DeleteResourceV2Response { - m0 := &DeleteResourceV2Response{} - b, x := &b0, m0 - _, _ = b, x - x.Annotations = b.Annotations - return m0 -} - type RotateCredentialRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` @@ -943,6 +686,11 @@ func (x *RotateCredentialRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use RotateCredentialRequest.ProtoReflect.Descriptor instead. +func (*RotateCredentialRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{9} +} + func (x *RotateCredentialRequest) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -964,60 +712,8 @@ func (x *RotateCredentialRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } -func (x *RotateCredentialRequest) SetResourceId(v *ResourceId) { - x.ResourceId = v -} - -func (x *RotateCredentialRequest) SetCredentialOptions(v *CredentialOptions) { - x.CredentialOptions = v -} - -func (x *RotateCredentialRequest) SetEncryptionConfigs(v []*EncryptionConfig) { - x.EncryptionConfigs = v -} - -func (x *RotateCredentialRequest) HasResourceId() bool { - if x == nil { - return false - } - return x.ResourceId != nil -} - -func (x *RotateCredentialRequest) HasCredentialOptions() bool { - if x == nil { - return false - } - return x.CredentialOptions != nil -} - -func (x *RotateCredentialRequest) ClearResourceId() { - x.ResourceId = nil -} - -func (x *RotateCredentialRequest) ClearCredentialOptions() { - x.CredentialOptions = nil -} - -type RotateCredentialRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceId *ResourceId - CredentialOptions *CredentialOptions - EncryptionConfigs []*EncryptionConfig -} - -func (b0 RotateCredentialRequest_builder) Build() *RotateCredentialRequest { - m0 := &RotateCredentialRequest{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceId = b.ResourceId - x.CredentialOptions = b.CredentialOptions - x.EncryptionConfigs = b.EncryptionConfigs - return m0 -} - type RotateCredentialResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` EncryptedData []*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` ResourceId *ResourceId `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -1050,6 +746,11 @@ func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use RotateCredentialResponse.ProtoReflect.Descriptor instead. +func (*RotateCredentialResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{10} +} + func (x *RotateCredentialResponse) GetEncryptedData() []*EncryptedData { if x != nil { return x.EncryptedData @@ -1071,49 +772,8 @@ func (x *RotateCredentialResponse) GetAnnotations() []*anypb.Any { return nil } -func (x *RotateCredentialResponse) SetEncryptedData(v []*EncryptedData) { - x.EncryptedData = v -} - -func (x *RotateCredentialResponse) SetResourceId(v *ResourceId) { - x.ResourceId = v -} - -func (x *RotateCredentialResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *RotateCredentialResponse) HasResourceId() bool { - if x == nil { - return false - } - return x.ResourceId != nil -} - -func (x *RotateCredentialResponse) ClearResourceId() { - x.ResourceId = nil -} - -type RotateCredentialResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - EncryptedData []*EncryptedData - ResourceId *ResourceId - Annotations []*anypb.Any -} - -func (b0 RotateCredentialResponse_builder) Build() *RotateCredentialResponse { - m0 := &RotateCredentialResponse{} - b, x := &b0, m0 - _, _ = b, x - x.EncryptedData = b.EncryptedData - x.ResourceId = b.ResourceId - x.Annotations = b.Annotations - return m0 -} - type AccountInfo struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Emails []*AccountInfo_Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` // The user's login Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` @@ -1149,6 +809,11 @@ func (x *AccountInfo) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use AccountInfo.ProtoReflect.Descriptor instead. +func (*AccountInfo) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{11} +} + func (x *AccountInfo) GetEmails() []*AccountInfo_Email { if x != nil { return x.Emails @@ -1177,57 +842,8 @@ func (x *AccountInfo) GetProfile() *structpb.Struct { return nil } -func (x *AccountInfo) SetEmails(v []*AccountInfo_Email) { - x.Emails = v -} - -func (x *AccountInfo) SetLogin(v string) { - x.Login = v -} - -func (x *AccountInfo) SetLoginAliases(v []string) { - x.LoginAliases = v -} - -func (x *AccountInfo) SetProfile(v *structpb.Struct) { - x.Profile = v -} - -func (x *AccountInfo) HasProfile() bool { - if x == nil { - return false - } - return x.Profile != nil -} - -func (x *AccountInfo) ClearProfile() { - x.Profile = nil -} - -type AccountInfo_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Emails []*AccountInfo_Email - // The user's login - Login string - // Any additional login aliases for the user - LoginAliases []string - Profile *structpb.Struct -} - -func (b0 AccountInfo_builder) Build() *AccountInfo { - m0 := &AccountInfo{} - b, x := &b0, m0 - _, _ = b, x - x.Emails = b.Emails - x.Login = b.Login - x.LoginAliases = b.LoginAliases - x.Profile = b.Profile - return m0 -} - type CredentialOptions struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Options: // // *CredentialOptions_RandomPassword_ @@ -1265,6 +881,11 @@ func (x *CredentialOptions) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CredentialOptions.ProtoReflect.Descriptor instead. +func (*CredentialOptions) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12} +} + func (x *CredentialOptions) GetOptions() isCredentialOptions_Options { if x != nil { return x.Options @@ -1315,206 +936,37 @@ func (x *CredentialOptions) GetForceChangeAtNextLogin() bool { return false } -func (x *CredentialOptions) SetRandomPassword(v *CredentialOptions_RandomPassword) { - if v == nil { - x.Options = nil - return - } - x.Options = &CredentialOptions_RandomPassword_{v} -} - -func (x *CredentialOptions) SetNoPassword(v *CredentialOptions_NoPassword) { - if v == nil { - x.Options = nil - return - } - x.Options = &CredentialOptions_NoPassword_{v} -} - -func (x *CredentialOptions) SetSso(v *CredentialOptions_SSO) { - if v == nil { - x.Options = nil - return - } - x.Options = &CredentialOptions_Sso{v} +type isCredentialOptions_Options interface { + isCredentialOptions_Options() } -func (x *CredentialOptions) SetEncryptedPassword(v *CredentialOptions_EncryptedPassword) { - if v == nil { - x.Options = nil - return - } - x.Options = &CredentialOptions_EncryptedPassword_{v} +type CredentialOptions_RandomPassword_ struct { + RandomPassword *CredentialOptions_RandomPassword `protobuf:"bytes,100,opt,name=random_password,json=randomPassword,proto3,oneof"` } -func (x *CredentialOptions) SetForceChangeAtNextLogin(v bool) { - x.ForceChangeAtNextLogin = v +type CredentialOptions_NoPassword_ struct { + NoPassword *CredentialOptions_NoPassword `protobuf:"bytes,101,opt,name=no_password,json=noPassword,proto3,oneof"` } -func (x *CredentialOptions) HasOptions() bool { - if x == nil { - return false - } - return x.Options != nil +type CredentialOptions_Sso struct { + Sso *CredentialOptions_SSO `protobuf:"bytes,102,opt,name=sso,proto3,oneof"` } -func (x *CredentialOptions) HasRandomPassword() bool { - if x == nil { - return false - } - _, ok := x.Options.(*CredentialOptions_RandomPassword_) - return ok +type CredentialOptions_EncryptedPassword_ struct { + EncryptedPassword *CredentialOptions_EncryptedPassword `protobuf:"bytes,103,opt,name=encrypted_password,json=encryptedPassword,proto3,oneof"` } -func (x *CredentialOptions) HasNoPassword() bool { - if x == nil { - return false - } - _, ok := x.Options.(*CredentialOptions_NoPassword_) - return ok -} +func (*CredentialOptions_RandomPassword_) isCredentialOptions_Options() {} -func (x *CredentialOptions) HasSso() bool { - if x == nil { - return false - } - _, ok := x.Options.(*CredentialOptions_Sso) - return ok -} +func (*CredentialOptions_NoPassword_) isCredentialOptions_Options() {} -func (x *CredentialOptions) HasEncryptedPassword() bool { - if x == nil { - return false - } - _, ok := x.Options.(*CredentialOptions_EncryptedPassword_) - return ok -} +func (*CredentialOptions_Sso) isCredentialOptions_Options() {} -func (x *CredentialOptions) ClearOptions() { - x.Options = nil -} - -func (x *CredentialOptions) ClearRandomPassword() { - if _, ok := x.Options.(*CredentialOptions_RandomPassword_); ok { - x.Options = nil - } -} - -func (x *CredentialOptions) ClearNoPassword() { - if _, ok := x.Options.(*CredentialOptions_NoPassword_); ok { - x.Options = nil - } -} - -func (x *CredentialOptions) ClearSso() { - if _, ok := x.Options.(*CredentialOptions_Sso); ok { - x.Options = nil - } -} - -func (x *CredentialOptions) ClearEncryptedPassword() { - if _, ok := x.Options.(*CredentialOptions_EncryptedPassword_); ok { - x.Options = nil - } -} - -const CredentialOptions_Options_not_set_case case_CredentialOptions_Options = 0 -const CredentialOptions_RandomPassword_case case_CredentialOptions_Options = 100 -const CredentialOptions_NoPassword_case case_CredentialOptions_Options = 101 -const CredentialOptions_Sso_case case_CredentialOptions_Options = 102 -const CredentialOptions_EncryptedPassword_case case_CredentialOptions_Options = 103 - -func (x *CredentialOptions) WhichOptions() case_CredentialOptions_Options { - if x == nil { - return CredentialOptions_Options_not_set_case - } - switch x.Options.(type) { - case *CredentialOptions_RandomPassword_: - return CredentialOptions_RandomPassword_case - case *CredentialOptions_NoPassword_: - return CredentialOptions_NoPassword_case - case *CredentialOptions_Sso: - return CredentialOptions_Sso_case - case *CredentialOptions_EncryptedPassword_: - return CredentialOptions_EncryptedPassword_case - default: - return CredentialOptions_Options_not_set_case - } -} - -type CredentialOptions_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // Fields of oneof Options: - RandomPassword *CredentialOptions_RandomPassword - NoPassword *CredentialOptions_NoPassword - Sso *CredentialOptions_SSO - EncryptedPassword *CredentialOptions_EncryptedPassword - // -- end of Options - ForceChangeAtNextLogin bool -} - -func (b0 CredentialOptions_builder) Build() *CredentialOptions { - m0 := &CredentialOptions{} - b, x := &b0, m0 - _, _ = b, x - if b.RandomPassword != nil { - x.Options = &CredentialOptions_RandomPassword_{b.RandomPassword} - } - if b.NoPassword != nil { - x.Options = &CredentialOptions_NoPassword_{b.NoPassword} - } - if b.Sso != nil { - x.Options = &CredentialOptions_Sso{b.Sso} - } - if b.EncryptedPassword != nil { - x.Options = &CredentialOptions_EncryptedPassword_{b.EncryptedPassword} - } - x.ForceChangeAtNextLogin = b.ForceChangeAtNextLogin - return m0 -} - -type case_CredentialOptions_Options protoreflect.FieldNumber - -func (x case_CredentialOptions_Options) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[12].Descriptor() - if x == 0 { - return "not set" - } - return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) -} - -type isCredentialOptions_Options interface { - isCredentialOptions_Options() -} - -type CredentialOptions_RandomPassword_ struct { - RandomPassword *CredentialOptions_RandomPassword `protobuf:"bytes,100,opt,name=random_password,json=randomPassword,proto3,oneof"` -} - -type CredentialOptions_NoPassword_ struct { - NoPassword *CredentialOptions_NoPassword `protobuf:"bytes,101,opt,name=no_password,json=noPassword,proto3,oneof"` -} - -type CredentialOptions_Sso struct { - Sso *CredentialOptions_SSO `protobuf:"bytes,102,opt,name=sso,proto3,oneof"` -} - -type CredentialOptions_EncryptedPassword_ struct { - EncryptedPassword *CredentialOptions_EncryptedPassword `protobuf:"bytes,103,opt,name=encrypted_password,json=encryptedPassword,proto3,oneof"` -} - -func (*CredentialOptions_RandomPassword_) isCredentialOptions_Options() {} - -func (*CredentialOptions_NoPassword_) isCredentialOptions_Options() {} - -func (*CredentialOptions_Sso) isCredentialOptions_Options() {} - -func (*CredentialOptions_EncryptedPassword_) isCredentialOptions_Options() {} +func (*CredentialOptions_EncryptedPassword_) isCredentialOptions_Options() {} // Do not use this in any RPC or any message that is in an RPC. type LocalCredentialOptions struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Options: // // *LocalCredentialOptions_RandomPassword_ @@ -1552,6 +1004,11 @@ func (x *LocalCredentialOptions) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use LocalCredentialOptions.ProtoReflect.Descriptor instead. +func (*LocalCredentialOptions) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13} +} + func (x *LocalCredentialOptions) GetOptions() isLocalCredentialOptions_Options { if x != nil { return x.Options @@ -1602,175 +1059,6 @@ func (x *LocalCredentialOptions) GetForceChangeAtNextLogin() bool { return false } -func (x *LocalCredentialOptions) SetRandomPassword(v *LocalCredentialOptions_RandomPassword) { - if v == nil { - x.Options = nil - return - } - x.Options = &LocalCredentialOptions_RandomPassword_{v} -} - -func (x *LocalCredentialOptions) SetNoPassword(v *LocalCredentialOptions_NoPassword) { - if v == nil { - x.Options = nil - return - } - x.Options = &LocalCredentialOptions_NoPassword_{v} -} - -func (x *LocalCredentialOptions) SetSso(v *LocalCredentialOptions_SSO) { - if v == nil { - x.Options = nil - return - } - x.Options = &LocalCredentialOptions_Sso{v} -} - -func (x *LocalCredentialOptions) SetPlaintextPassword(v *LocalCredentialOptions_PlaintextPassword) { - if v == nil { - x.Options = nil - return - } - x.Options = &LocalCredentialOptions_PlaintextPassword_{v} -} - -func (x *LocalCredentialOptions) SetForceChangeAtNextLogin(v bool) { - x.ForceChangeAtNextLogin = v -} - -func (x *LocalCredentialOptions) HasOptions() bool { - if x == nil { - return false - } - return x.Options != nil -} - -func (x *LocalCredentialOptions) HasRandomPassword() bool { - if x == nil { - return false - } - _, ok := x.Options.(*LocalCredentialOptions_RandomPassword_) - return ok -} - -func (x *LocalCredentialOptions) HasNoPassword() bool { - if x == nil { - return false - } - _, ok := x.Options.(*LocalCredentialOptions_NoPassword_) - return ok -} - -func (x *LocalCredentialOptions) HasSso() bool { - if x == nil { - return false - } - _, ok := x.Options.(*LocalCredentialOptions_Sso) - return ok -} - -func (x *LocalCredentialOptions) HasPlaintextPassword() bool { - if x == nil { - return false - } - _, ok := x.Options.(*LocalCredentialOptions_PlaintextPassword_) - return ok -} - -func (x *LocalCredentialOptions) ClearOptions() { - x.Options = nil -} - -func (x *LocalCredentialOptions) ClearRandomPassword() { - if _, ok := x.Options.(*LocalCredentialOptions_RandomPassword_); ok { - x.Options = nil - } -} - -func (x *LocalCredentialOptions) ClearNoPassword() { - if _, ok := x.Options.(*LocalCredentialOptions_NoPassword_); ok { - x.Options = nil - } -} - -func (x *LocalCredentialOptions) ClearSso() { - if _, ok := x.Options.(*LocalCredentialOptions_Sso); ok { - x.Options = nil - } -} - -func (x *LocalCredentialOptions) ClearPlaintextPassword() { - if _, ok := x.Options.(*LocalCredentialOptions_PlaintextPassword_); ok { - x.Options = nil - } -} - -const LocalCredentialOptions_Options_not_set_case case_LocalCredentialOptions_Options = 0 -const LocalCredentialOptions_RandomPassword_case case_LocalCredentialOptions_Options = 100 -const LocalCredentialOptions_NoPassword_case case_LocalCredentialOptions_Options = 101 -const LocalCredentialOptions_Sso_case case_LocalCredentialOptions_Options = 102 -const LocalCredentialOptions_PlaintextPassword_case case_LocalCredentialOptions_Options = 103 - -func (x *LocalCredentialOptions) WhichOptions() case_LocalCredentialOptions_Options { - if x == nil { - return LocalCredentialOptions_Options_not_set_case - } - switch x.Options.(type) { - case *LocalCredentialOptions_RandomPassword_: - return LocalCredentialOptions_RandomPassword_case - case *LocalCredentialOptions_NoPassword_: - return LocalCredentialOptions_NoPassword_case - case *LocalCredentialOptions_Sso: - return LocalCredentialOptions_Sso_case - case *LocalCredentialOptions_PlaintextPassword_: - return LocalCredentialOptions_PlaintextPassword_case - default: - return LocalCredentialOptions_Options_not_set_case - } -} - -type LocalCredentialOptions_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // Fields of oneof Options: - RandomPassword *LocalCredentialOptions_RandomPassword - NoPassword *LocalCredentialOptions_NoPassword - Sso *LocalCredentialOptions_SSO - PlaintextPassword *LocalCredentialOptions_PlaintextPassword - // -- end of Options - ForceChangeAtNextLogin bool -} - -func (b0 LocalCredentialOptions_builder) Build() *LocalCredentialOptions { - m0 := &LocalCredentialOptions{} - b, x := &b0, m0 - _, _ = b, x - if b.RandomPassword != nil { - x.Options = &LocalCredentialOptions_RandomPassword_{b.RandomPassword} - } - if b.NoPassword != nil { - x.Options = &LocalCredentialOptions_NoPassword_{b.NoPassword} - } - if b.Sso != nil { - x.Options = &LocalCredentialOptions_Sso{b.Sso} - } - if b.PlaintextPassword != nil { - x.Options = &LocalCredentialOptions_PlaintextPassword_{b.PlaintextPassword} - } - x.ForceChangeAtNextLogin = b.ForceChangeAtNextLogin - return m0 -} - -type case_LocalCredentialOptions_Options protoreflect.FieldNumber - -func (x case_LocalCredentialOptions_Options) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[13].Descriptor() - if x == 0 { - return "not set" - } - return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) -} - type isLocalCredentialOptions_Options interface { isLocalCredentialOptions_Options() } @@ -1800,7 +1088,7 @@ func (*LocalCredentialOptions_Sso) isLocalCredentialOptions_Options() {} func (*LocalCredentialOptions_PlaintextPassword_) isLocalCredentialOptions_Options() {} type PasswordConstraint struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` CharSet string `protobuf:"bytes,1,opt,name=char_set,json=charSet,proto3" json:"char_set,omitempty"` MinCount uint32 `protobuf:"varint,2,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` unknownFields protoimpl.UnknownFields @@ -1832,6 +1120,11 @@ func (x *PasswordConstraint) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use PasswordConstraint.ProtoReflect.Descriptor instead. +func (*PasswordConstraint) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{14} +} + func (x *PasswordConstraint) GetCharSet() string { if x != nil { return x.CharSet @@ -1846,32 +1139,8 @@ func (x *PasswordConstraint) GetMinCount() uint32 { return 0 } -func (x *PasswordConstraint) SetCharSet(v string) { - x.CharSet = v -} - -func (x *PasswordConstraint) SetMinCount(v uint32) { - x.MinCount = v -} - -type PasswordConstraint_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - CharSet string - MinCount uint32 -} - -func (b0 PasswordConstraint_builder) Build() *PasswordConstraint { - m0 := &PasswordConstraint{} - b, x := &b0, m0 - _, _ = b, x - x.CharSet = b.CharSet - x.MinCount = b.MinCount - return m0 -} - type CreateAccountRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` AccountInfo *AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` @@ -1904,6 +1173,11 @@ func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CreateAccountRequest.ProtoReflect.Descriptor instead. +func (*CreateAccountRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{15} +} + func (x *CreateAccountRequest) GetAccountInfo() *AccountInfo { if x != nil { return x.AccountInfo @@ -1925,60 +1199,8 @@ func (x *CreateAccountRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } -func (x *CreateAccountRequest) SetAccountInfo(v *AccountInfo) { - x.AccountInfo = v -} - -func (x *CreateAccountRequest) SetCredentialOptions(v *CredentialOptions) { - x.CredentialOptions = v -} - -func (x *CreateAccountRequest) SetEncryptionConfigs(v []*EncryptionConfig) { - x.EncryptionConfigs = v -} - -func (x *CreateAccountRequest) HasAccountInfo() bool { - if x == nil { - return false - } - return x.AccountInfo != nil -} - -func (x *CreateAccountRequest) HasCredentialOptions() bool { - if x == nil { - return false - } - return x.CredentialOptions != nil -} - -func (x *CreateAccountRequest) ClearAccountInfo() { - x.AccountInfo = nil -} - -func (x *CreateAccountRequest) ClearCredentialOptions() { - x.CredentialOptions = nil -} - -type CreateAccountRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - AccountInfo *AccountInfo - CredentialOptions *CredentialOptions - EncryptionConfigs []*EncryptionConfig -} - -func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { - m0 := &CreateAccountRequest{} - b, x := &b0, m0 - _, _ = b, x - x.AccountInfo = b.AccountInfo - x.CredentialOptions = b.CredentialOptions - x.EncryptionConfigs = b.EncryptionConfigs - return m0 -} - type CreateAccountResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Result: // // *CreateAccountResponse_Success @@ -2015,6 +1237,11 @@ func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CreateAccountResponse.ProtoReflect.Descriptor instead. +func (*CreateAccountResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16} +} + func (x *CreateAccountResponse) GetResult() isCreateAccountResponse_Result { if x != nil { return x.Result @@ -2054,123 +1281,6 @@ func (x *CreateAccountResponse) GetAnnotations() []*anypb.Any { return nil } -func (x *CreateAccountResponse) SetSuccess(v *CreateAccountResponse_SuccessResult) { - if v == nil { - x.Result = nil - return - } - x.Result = &CreateAccountResponse_Success{v} -} - -func (x *CreateAccountResponse) SetActionRequired(v *CreateAccountResponse_ActionRequiredResult) { - if v == nil { - x.Result = nil - return - } - x.Result = &CreateAccountResponse_ActionRequired{v} -} - -func (x *CreateAccountResponse) SetEncryptedData(v []*EncryptedData) { - x.EncryptedData = v -} - -func (x *CreateAccountResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *CreateAccountResponse) HasResult() bool { - if x == nil { - return false - } - return x.Result != nil -} - -func (x *CreateAccountResponse) HasSuccess() bool { - if x == nil { - return false - } - _, ok := x.Result.(*CreateAccountResponse_Success) - return ok -} - -func (x *CreateAccountResponse) HasActionRequired() bool { - if x == nil { - return false - } - _, ok := x.Result.(*CreateAccountResponse_ActionRequired) - return ok -} - -func (x *CreateAccountResponse) ClearResult() { - x.Result = nil -} - -func (x *CreateAccountResponse) ClearSuccess() { - if _, ok := x.Result.(*CreateAccountResponse_Success); ok { - x.Result = nil - } -} - -func (x *CreateAccountResponse) ClearActionRequired() { - if _, ok := x.Result.(*CreateAccountResponse_ActionRequired); ok { - x.Result = nil - } -} - -const CreateAccountResponse_Result_not_set_case case_CreateAccountResponse_Result = 0 -const CreateAccountResponse_Success_case case_CreateAccountResponse_Result = 100 -const CreateAccountResponse_ActionRequired_case case_CreateAccountResponse_Result = 101 - -func (x *CreateAccountResponse) WhichResult() case_CreateAccountResponse_Result { - if x == nil { - return CreateAccountResponse_Result_not_set_case - } - switch x.Result.(type) { - case *CreateAccountResponse_Success: - return CreateAccountResponse_Success_case - case *CreateAccountResponse_ActionRequired: - return CreateAccountResponse_ActionRequired_case - default: - return CreateAccountResponse_Result_not_set_case - } -} - -type CreateAccountResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - // Fields of oneof Result: - Success *CreateAccountResponse_SuccessResult - ActionRequired *CreateAccountResponse_ActionRequiredResult - // -- end of Result - EncryptedData []*EncryptedData - Annotations []*anypb.Any -} - -func (b0 CreateAccountResponse_builder) Build() *CreateAccountResponse { - m0 := &CreateAccountResponse{} - b, x := &b0, m0 - _, _ = b, x - if b.Success != nil { - x.Result = &CreateAccountResponse_Success{b.Success} - } - if b.ActionRequired != nil { - x.Result = &CreateAccountResponse_ActionRequired{b.ActionRequired} - } - x.EncryptedData = b.EncryptedData - x.Annotations = b.Annotations - return m0 -} - -type case_CreateAccountResponse_Result protoreflect.FieldNumber - -func (x case_CreateAccountResponse_Result) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[16].Descriptor() - if x == 0 { - return "not set" - } - return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) -} - type isCreateAccountResponse_Result interface { isCreateAccountResponse_Result() } @@ -2188,7 +1298,7 @@ func (*CreateAccountResponse_Success) isCreateAccountResponse_Result() {} func (*CreateAccountResponse_ActionRequired) isCreateAccountResponse_Result() {} type EncryptedData struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` @@ -2226,6 +1336,11 @@ func (x *EncryptedData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use EncryptedData.ProtoReflect.Descriptor instead. +func (*EncryptedData) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{17} +} + func (x *EncryptedData) GetProvider() string { if x != nil { return x.Provider @@ -2276,67 +1391,8 @@ func (x *EncryptedData) GetKeyIds() []string { return nil } -func (x *EncryptedData) SetProvider(v string) { - x.Provider = v -} - -// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. -func (x *EncryptedData) SetKeyId(v string) { - x.KeyId = v -} - -func (x *EncryptedData) SetName(v string) { - x.Name = v -} - -func (x *EncryptedData) SetDescription(v string) { - x.Description = v -} - -func (x *EncryptedData) SetSchema(v string) { - x.Schema = v -} - -func (x *EncryptedData) SetEncryptedBytes(v []byte) { - if v == nil { - v = []byte{} - } - x.EncryptedBytes = v -} - -func (x *EncryptedData) SetKeyIds(v []string) { - x.KeyIds = v -} - -type EncryptedData_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Provider string - // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. - KeyId string - Name string - Description string - Schema string - EncryptedBytes []byte - KeyIds []string -} - -func (b0 EncryptedData_builder) Build() *EncryptedData { - m0 := &EncryptedData{} - b, x := &b0, m0 - _, _ = b, x - x.Provider = b.Provider - x.KeyId = b.KeyId - x.Name = b.Name - x.Description = b.Description - x.Schema = b.Schema - x.EncryptedBytes = b.EncryptedBytes - x.KeyIds = b.KeyIds - return m0 -} - type PlaintextData struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` Schema string `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` // optional @@ -2370,6 +1426,11 @@ func (x *PlaintextData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use PlaintextData.ProtoReflect.Descriptor instead. +func (*PlaintextData) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{18} +} + func (x *PlaintextData) GetName() string { if x != nil { return x.Name @@ -2398,47 +1459,8 @@ func (x *PlaintextData) GetBytes() []byte { return nil } -func (x *PlaintextData) SetName(v string) { - x.Name = v -} - -func (x *PlaintextData) SetDescription(v string) { - x.Description = v -} - -func (x *PlaintextData) SetSchema(v string) { - x.Schema = v -} - -func (x *PlaintextData) SetBytes(v []byte) { - if v == nil { - v = []byte{} - } - x.Bytes = v -} - -type PlaintextData_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Name string - Description string - Schema string - Bytes []byte -} - -func (b0 PlaintextData_builder) Build() *PlaintextData { - m0 := &PlaintextData{} - b, x := &b0, m0 - _, _ = b, x - x.Name = b.Name - x.Description = b.Description - x.Schema = b.Schema - x.Bytes = b.Bytes - return m0 -} - type EncryptionConfig struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Principal *Resource `protobuf:"bytes,1,opt,name=principal,proto3" json:"principal,omitempty"` Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` @@ -2475,6 +1497,11 @@ func (x *EncryptionConfig) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use EncryptionConfig.ProtoReflect.Descriptor instead. +func (*EncryptionConfig) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19} +} + func (x *EncryptionConfig) GetPrincipal() *Resource { if x != nil { return x.Principal @@ -2512,111 +1539,6 @@ func (x *EncryptionConfig) GetJwkPublicKeyConfig() *EncryptionConfig_JWKPublicKe return nil } -func (x *EncryptionConfig) SetPrincipal(v *Resource) { - x.Principal = v -} - -func (x *EncryptionConfig) SetProvider(v string) { - x.Provider = v -} - -func (x *EncryptionConfig) SetKeyId(v string) { - x.KeyId = v -} - -func (x *EncryptionConfig) SetJwkPublicKeyConfig(v *EncryptionConfig_JWKPublicKeyConfig) { - if v == nil { - x.Config = nil - return - } - x.Config = &EncryptionConfig_JwkPublicKeyConfig{v} -} - -func (x *EncryptionConfig) HasPrincipal() bool { - if x == nil { - return false - } - return x.Principal != nil -} - -func (x *EncryptionConfig) HasConfig() bool { - if x == nil { - return false - } - return x.Config != nil -} - -func (x *EncryptionConfig) HasJwkPublicKeyConfig() bool { - if x == nil { - return false - } - _, ok := x.Config.(*EncryptionConfig_JwkPublicKeyConfig) - return ok -} - -func (x *EncryptionConfig) ClearPrincipal() { - x.Principal = nil -} - -func (x *EncryptionConfig) ClearConfig() { - x.Config = nil -} - -func (x *EncryptionConfig) ClearJwkPublicKeyConfig() { - if _, ok := x.Config.(*EncryptionConfig_JwkPublicKeyConfig); ok { - x.Config = nil - } -} - -const EncryptionConfig_Config_not_set_case case_EncryptionConfig_Config = 0 -const EncryptionConfig_JwkPublicKeyConfig_case case_EncryptionConfig_Config = 100 - -func (x *EncryptionConfig) WhichConfig() case_EncryptionConfig_Config { - if x == nil { - return EncryptionConfig_Config_not_set_case - } - switch x.Config.(type) { - case *EncryptionConfig_JwkPublicKeyConfig: - return EncryptionConfig_JwkPublicKeyConfig_case - default: - return EncryptionConfig_Config_not_set_case - } -} - -type EncryptionConfig_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Principal *Resource - Provider string - KeyId string - // Fields of oneof Config: - JwkPublicKeyConfig *EncryptionConfig_JWKPublicKeyConfig - // -- end of Config -} - -func (b0 EncryptionConfig_builder) Build() *EncryptionConfig { - m0 := &EncryptionConfig{} - b, x := &b0, m0 - _, _ = b, x - x.Principal = b.Principal - x.Provider = b.Provider - x.KeyId = b.KeyId - if b.JwkPublicKeyConfig != nil { - x.Config = &EncryptionConfig_JwkPublicKeyConfig{b.JwkPublicKeyConfig} - } - return m0 -} - -type case_EncryptionConfig_Config protoreflect.FieldNumber - -func (x case_EncryptionConfig_Config) String() string { - md := file_c1_connector_v2_resource_proto_msgTypes[19].Descriptor() - if x == 0 { - return "not set" - } - return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) -} - type isEncryptionConfig_Config interface { isEncryptionConfig_Config() } @@ -2628,7 +1550,7 @@ type EncryptionConfig_JwkPublicKeyConfig struct { func (*EncryptionConfig_JwkPublicKeyConfig) isEncryptionConfig_Config() {} type ResourceId struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` BatonResource bool `protobuf:"varint,3,opt,name=baton_resource,json=batonResource,proto3" json:"baton_resource,omitempty"` @@ -2661,6 +1583,11 @@ func (x *ResourceId) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use ResourceId.ProtoReflect.Descriptor instead. +func (*ResourceId) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{20} +} + func (x *ResourceId) GetResourceType() string { if x != nil { return x.ResourceType @@ -2672,48 +1599,18 @@ func (x *ResourceId) GetResource() string { if x != nil { return x.Resource } - return "" -} - -func (x *ResourceId) GetBatonResource() bool { - if x != nil { - return x.BatonResource - } - return false -} - -func (x *ResourceId) SetResourceType(v string) { - x.ResourceType = v -} - -func (x *ResourceId) SetResource(v string) { - x.Resource = v -} - -func (x *ResourceId) SetBatonResource(v bool) { - x.BatonResource = v -} - -type ResourceId_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceType string - Resource string - BatonResource bool + return "" } -func (b0 ResourceId_builder) Build() *ResourceId { - m0 := &ResourceId{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceType = b.ResourceType - x.Resource = b.Resource - x.BatonResource = b.BatonResource - return m0 +func (x *ResourceId) GetBatonResource() bool { + if x != nil { + return x.BatonResource + } + return false } type Resource struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Id *ResourceId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` @@ -2751,6 +1648,11 @@ func (x *Resource) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use Resource.ProtoReflect.Descriptor instead. +func (*Resource) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21} +} + func (x *Resource) GetId() *ResourceId { if x != nil { return x.Id @@ -2807,101 +1709,8 @@ func (x *Resource) GetCreationSource() Resource_CreationSource { return Resource_CREATION_SOURCE_UNSPECIFIED } -func (x *Resource) SetId(v *ResourceId) { - x.Id = v -} - -func (x *Resource) SetParentResourceId(v *ResourceId) { - x.ParentResourceId = v -} - -func (x *Resource) SetDisplayName(v string) { - x.DisplayName = v -} - -func (x *Resource) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *Resource) SetDescription(v string) { - x.Description = v -} - -func (x *Resource) SetBatonResource(v bool) { - x.BatonResource = v -} - -func (x *Resource) SetExternalId(v *ExternalId) { - x.ExternalId = v -} - -func (x *Resource) SetCreationSource(v Resource_CreationSource) { - x.CreationSource = v -} - -func (x *Resource) HasId() bool { - if x == nil { - return false - } - return x.Id != nil -} - -func (x *Resource) HasParentResourceId() bool { - if x == nil { - return false - } - return x.ParentResourceId != nil -} - -func (x *Resource) HasExternalId() bool { - if x == nil { - return false - } - return x.ExternalId != nil -} - -func (x *Resource) ClearId() { - x.Id = nil -} - -func (x *Resource) ClearParentResourceId() { - x.ParentResourceId = nil -} - -func (x *Resource) ClearExternalId() { - x.ExternalId = nil -} - -type Resource_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id *ResourceId - ParentResourceId *ResourceId - DisplayName string - Annotations []*anypb.Any - Description string - BatonResource bool - ExternalId *ExternalId - CreationSource Resource_CreationSource -} - -func (b0 Resource_builder) Build() *Resource { - m0 := &Resource{} - b, x := &b0, m0 - _, _ = b, x - x.Id = b.Id - x.ParentResourceId = b.ParentResourceId - x.DisplayName = b.DisplayName - x.Annotations = b.Annotations - x.Description = b.Description - x.BatonResource = b.BatonResource - x.ExternalId = b.ExternalId - x.CreationSource = b.CreationSource - return m0 -} - type ResourcesServiceListResourcesRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` ResourceTypeId string `protobuf:"bytes,1,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` @@ -2937,6 +1746,11 @@ func (x *ResourcesServiceListResourcesRequest) ProtoReflect() protoreflect.Messa return mi.MessageOf(x) } +// Deprecated: Use ResourcesServiceListResourcesRequest.ProtoReflect.Descriptor instead. +func (*ResourcesServiceListResourcesRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{22} +} + func (x *ResourcesServiceListResourcesRequest) GetResourceTypeId() string { if x != nil { return x.ResourceTypeId @@ -2979,67 +1793,8 @@ func (x *ResourcesServiceListResourcesRequest) GetActiveSyncId() string { return "" } -func (x *ResourcesServiceListResourcesRequest) SetResourceTypeId(v string) { - x.ResourceTypeId = v -} - -func (x *ResourcesServiceListResourcesRequest) SetParentResourceId(v *ResourceId) { - x.ParentResourceId = v -} - -func (x *ResourcesServiceListResourcesRequest) SetPageSize(v uint32) { - x.PageSize = v -} - -func (x *ResourcesServiceListResourcesRequest) SetPageToken(v string) { - x.PageToken = v -} - -func (x *ResourcesServiceListResourcesRequest) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *ResourcesServiceListResourcesRequest) SetActiveSyncId(v string) { - x.ActiveSyncId = v -} - -func (x *ResourcesServiceListResourcesRequest) HasParentResourceId() bool { - if x == nil { - return false - } - return x.ParentResourceId != nil -} - -func (x *ResourcesServiceListResourcesRequest) ClearParentResourceId() { - x.ParentResourceId = nil -} - -type ResourcesServiceListResourcesRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceTypeId string - ParentResourceId *ResourceId - PageSize uint32 - PageToken string - Annotations []*anypb.Any - ActiveSyncId string -} - -func (b0 ResourcesServiceListResourcesRequest_builder) Build() *ResourcesServiceListResourcesRequest { - m0 := &ResourcesServiceListResourcesRequest{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceTypeId = b.ResourceTypeId - x.ParentResourceId = b.ParentResourceId - x.PageSize = b.PageSize - x.PageToken = b.PageToken - x.Annotations = b.Annotations - x.ActiveSyncId = b.ActiveSyncId - return m0 -} - type ResourcesServiceListResourcesResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` List []*Resource `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -3072,6 +1827,11 @@ func (x *ResourcesServiceListResourcesResponse) ProtoReflect() protoreflect.Mess return mi.MessageOf(x) } +// Deprecated: Use ResourcesServiceListResourcesResponse.ProtoReflect.Descriptor instead. +func (*ResourcesServiceListResourcesResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{23} +} + func (x *ResourcesServiceListResourcesResponse) GetList() []*Resource { if x != nil { return x.List @@ -3093,38 +1853,8 @@ func (x *ResourcesServiceListResourcesResponse) GetAnnotations() []*anypb.Any { return nil } -func (x *ResourcesServiceListResourcesResponse) SetList(v []*Resource) { - x.List = v -} - -func (x *ResourcesServiceListResourcesResponse) SetNextPageToken(v string) { - x.NextPageToken = v -} - -func (x *ResourcesServiceListResourcesResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -type ResourcesServiceListResourcesResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - List []*Resource - NextPageToken string - Annotations []*anypb.Any -} - -func (b0 ResourcesServiceListResourcesResponse_builder) Build() *ResourcesServiceListResourcesResponse { - m0 := &ResourcesServiceListResourcesResponse{} - b, x := &b0, m0 - _, _ = b, x - x.List = b.List - x.NextPageToken = b.NextPageToken - x.Annotations = b.Annotations - return m0 -} - type ResourceGetterServiceGetResourceRequest struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -3158,6 +1888,11 @@ func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Me return mi.MessageOf(x) } +// Deprecated: Use ResourceGetterServiceGetResourceRequest.ProtoReflect.Descriptor instead. +func (*ResourceGetterServiceGetResourceRequest) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{24} +} + func (x *ResourceGetterServiceGetResourceRequest) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -3186,66 +1921,8 @@ func (x *ResourceGetterServiceGetResourceRequest) GetActiveSyncId() string { return "" } -func (x *ResourceGetterServiceGetResourceRequest) SetResourceId(v *ResourceId) { - x.ResourceId = v -} - -func (x *ResourceGetterServiceGetResourceRequest) SetParentResourceId(v *ResourceId) { - x.ParentResourceId = v -} - -func (x *ResourceGetterServiceGetResourceRequest) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *ResourceGetterServiceGetResourceRequest) SetActiveSyncId(v string) { - x.ActiveSyncId = v -} - -func (x *ResourceGetterServiceGetResourceRequest) HasResourceId() bool { - if x == nil { - return false - } - return x.ResourceId != nil -} - -func (x *ResourceGetterServiceGetResourceRequest) HasParentResourceId() bool { - if x == nil { - return false - } - return x.ParentResourceId != nil -} - -func (x *ResourceGetterServiceGetResourceRequest) ClearResourceId() { - x.ResourceId = nil -} - -func (x *ResourceGetterServiceGetResourceRequest) ClearParentResourceId() { - x.ParentResourceId = nil -} - -type ResourceGetterServiceGetResourceRequest_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - ResourceId *ResourceId - ParentResourceId *ResourceId - Annotations []*anypb.Any - ActiveSyncId string -} - -func (b0 ResourceGetterServiceGetResourceRequest_builder) Build() *ResourceGetterServiceGetResourceRequest { - m0 := &ResourceGetterServiceGetResourceRequest{} - b, x := &b0, m0 - _, _ = b, x - x.ResourceId = b.ResourceId - x.ParentResourceId = b.ParentResourceId - x.Annotations = b.Annotations - x.ActiveSyncId = b.ActiveSyncId - return m0 -} - type ResourceGetterServiceGetResourceResponse struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields @@ -3277,6 +1954,11 @@ func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.M return mi.MessageOf(x) } +// Deprecated: Use ResourceGetterServiceGetResourceResponse.ProtoReflect.Descriptor instead. +func (*ResourceGetterServiceGetResourceResponse) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{25} +} + func (x *ResourceGetterServiceGetResourceResponse) GetResource() *Resource { if x != nil { return x.Resource @@ -3291,43 +1973,8 @@ func (x *ResourceGetterServiceGetResourceResponse) GetAnnotations() []*anypb.Any return nil } -func (x *ResourceGetterServiceGetResourceResponse) SetResource(v *Resource) { - x.Resource = v -} - -func (x *ResourceGetterServiceGetResourceResponse) SetAnnotations(v []*anypb.Any) { - x.Annotations = v -} - -func (x *ResourceGetterServiceGetResourceResponse) HasResource() bool { - if x == nil { - return false - } - return x.Resource != nil -} - -func (x *ResourceGetterServiceGetResourceResponse) ClearResource() { - x.Resource = nil -} - -type ResourceGetterServiceGetResourceResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Resource *Resource - Annotations []*anypb.Any -} - -func (b0 ResourceGetterServiceGetResourceResponse_builder) Build() *ResourceGetterServiceGetResourceResponse { - m0 := &ResourceGetterServiceGetResourceResponse{} - b, x := &b0, m0 - _, _ = b, x - x.Resource = b.Resource - x.Annotations = b.Annotations - return m0 -} - type ExternalId struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Link string `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` @@ -3360,6 +2007,11 @@ func (x *ExternalId) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use ExternalId.ProtoReflect.Descriptor instead. +func (*ExternalId) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{26} +} + func (x *ExternalId) GetId() string { if x != nil { return x.Id @@ -3381,38 +2033,8 @@ func (x *ExternalId) GetDescription() string { return "" } -func (x *ExternalId) SetId(v string) { - x.Id = v -} - -func (x *ExternalId) SetLink(v string) { - x.Link = v -} - -func (x *ExternalId) SetDescription(v string) { - x.Description = v -} - -type ExternalId_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Id string - Link string - Description string -} - -func (b0 ExternalId_builder) Build() *ExternalId { - m0 := &ExternalId{} - b, x := &b0, m0 - _, _ = b, x - x.Id = b.Id - x.Link = b.Link - x.Description = b.Description - return m0 -} - type AccountInfo_Email struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // Indicates if this is the user's primary email. Only one entry can be marked as primary. IsPrimary bool `protobuf:"varint,2,opt,name=is_primary,json=isPrimary,proto3" json:"is_primary,omitempty"` @@ -3445,6 +2067,11 @@ func (x *AccountInfo_Email) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use AccountInfo_Email.ProtoReflect.Descriptor instead. +func (*AccountInfo_Email) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{11, 0} +} + func (x *AccountInfo_Email) GetAddress() string { if x != nil { return x.Address @@ -3459,33 +2086,8 @@ func (x *AccountInfo_Email) GetIsPrimary() bool { return false } -func (x *AccountInfo_Email) SetAddress(v string) { - x.Address = v -} - -func (x *AccountInfo_Email) SetIsPrimary(v bool) { - x.IsPrimary = v -} - -type AccountInfo_Email_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Address string - // Indicates if this is the user's primary email. Only one entry can be marked as primary. - IsPrimary bool -} - -func (b0 AccountInfo_Email_builder) Build() *AccountInfo_Email { - m0 := &AccountInfo_Email{} - b, x := &b0, m0 - _, _ = b, x - x.Address = b.Address - x.IsPrimary = b.IsPrimary - return m0 -} - type CredentialOptions_RandomPassword struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` Constraints []*PasswordConstraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"` unknownFields protoimpl.UnknownFields @@ -3517,6 +2119,11 @@ func (x *CredentialOptions_RandomPassword) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CredentialOptions_RandomPassword.ProtoReflect.Descriptor instead. +func (*CredentialOptions_RandomPassword) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 0} +} + func (x *CredentialOptions_RandomPassword) GetLength() int64 { if x != nil { return x.Length @@ -3531,32 +2138,8 @@ func (x *CredentialOptions_RandomPassword) GetConstraints() []*PasswordConstrain return nil } -func (x *CredentialOptions_RandomPassword) SetLength(v int64) { - x.Length = v -} - -func (x *CredentialOptions_RandomPassword) SetConstraints(v []*PasswordConstraint) { - x.Constraints = v -} - -type CredentialOptions_RandomPassword_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Length int64 - Constraints []*PasswordConstraint -} - -func (b0 CredentialOptions_RandomPassword_builder) Build() *CredentialOptions_RandomPassword { - m0 := &CredentialOptions_RandomPassword{} - b, x := &b0, m0 - _, _ = b, x - x.Length = b.Length - x.Constraints = b.Constraints - return m0 -} - type CredentialOptions_NoPassword struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -3586,20 +2169,13 @@ func (x *CredentialOptions_NoPassword) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -type CredentialOptions_NoPassword_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - -} - -func (b0 CredentialOptions_NoPassword_builder) Build() *CredentialOptions_NoPassword { - m0 := &CredentialOptions_NoPassword{} - b, x := &b0, m0 - _, _ = b, x - return m0 +// Deprecated: Use CredentialOptions_NoPassword.ProtoReflect.Descriptor instead. +func (*CredentialOptions_NoPassword) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 1} } type CredentialOptions_SSO struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` SsoProvider string `protobuf:"bytes,1,opt,name=sso_provider,json=ssoProvider,proto3" json:"sso_provider,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -3630,6 +2206,11 @@ func (x *CredentialOptions_SSO) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use CredentialOptions_SSO.ProtoReflect.Descriptor instead. +func (*CredentialOptions_SSO) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 2} +} + func (x *CredentialOptions_SSO) GetSsoProvider() string { if x != nil { return x.SsoProvider @@ -3637,26 +2218,8 @@ func (x *CredentialOptions_SSO) GetSsoProvider() string { return "" } -func (x *CredentialOptions_SSO) SetSsoProvider(v string) { - x.SsoProvider = v -} - -type CredentialOptions_SSO_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - SsoProvider string -} - -func (b0 CredentialOptions_SSO_builder) Build() *CredentialOptions_SSO { - m0 := &CredentialOptions_SSO{} - b, x := &b0, m0 - _, _ = b, x - x.SsoProvider = b.SsoProvider - return m0 -} - type CredentialOptions_EncryptedPassword struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` EncryptedPasswords []*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_passwords,json=encryptedPasswords,proto3" json:"encrypted_passwords,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -3687,6 +2250,11 @@ func (x *CredentialOptions_EncryptedPassword) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } +// Deprecated: Use CredentialOptions_EncryptedPassword.ProtoReflect.Descriptor instead. +func (*CredentialOptions_EncryptedPassword) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 3} +} + func (x *CredentialOptions_EncryptedPassword) GetEncryptedPasswords() []*EncryptedData { if x != nil { return x.EncryptedPasswords @@ -3694,26 +2262,8 @@ func (x *CredentialOptions_EncryptedPassword) GetEncryptedPasswords() []*Encrypt return nil } -func (x *CredentialOptions_EncryptedPassword) SetEncryptedPasswords(v []*EncryptedData) { - x.EncryptedPasswords = v -} - -type CredentialOptions_EncryptedPassword_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - EncryptedPasswords []*EncryptedData -} - -func (b0 CredentialOptions_EncryptedPassword_builder) Build() *CredentialOptions_EncryptedPassword { - m0 := &CredentialOptions_EncryptedPassword{} - b, x := &b0, m0 - _, _ = b, x - x.EncryptedPasswords = b.EncryptedPasswords - return m0 -} - type LocalCredentialOptions_RandomPassword struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` Constraints []*PasswordConstraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"` unknownFields protoimpl.UnknownFields @@ -3745,6 +2295,11 @@ func (x *LocalCredentialOptions_RandomPassword) ProtoReflect() protoreflect.Mess return mi.MessageOf(x) } +// Deprecated: Use LocalCredentialOptions_RandomPassword.ProtoReflect.Descriptor instead. +func (*LocalCredentialOptions_RandomPassword) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 0} +} + func (x *LocalCredentialOptions_RandomPassword) GetLength() int64 { if x != nil { return x.Length @@ -3759,32 +2314,8 @@ func (x *LocalCredentialOptions_RandomPassword) GetConstraints() []*PasswordCons return nil } -func (x *LocalCredentialOptions_RandomPassword) SetLength(v int64) { - x.Length = v -} - -func (x *LocalCredentialOptions_RandomPassword) SetConstraints(v []*PasswordConstraint) { - x.Constraints = v -} - -type LocalCredentialOptions_RandomPassword_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Length int64 - Constraints []*PasswordConstraint -} - -func (b0 LocalCredentialOptions_RandomPassword_builder) Build() *LocalCredentialOptions_RandomPassword { - m0 := &LocalCredentialOptions_RandomPassword{} - b, x := &b0, m0 - _, _ = b, x - x.Length = b.Length - x.Constraints = b.Constraints - return m0 -} - type LocalCredentialOptions_NoPassword struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -3814,20 +2345,13 @@ func (x *LocalCredentialOptions_NoPassword) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -type LocalCredentialOptions_NoPassword_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - -} - -func (b0 LocalCredentialOptions_NoPassword_builder) Build() *LocalCredentialOptions_NoPassword { - m0 := &LocalCredentialOptions_NoPassword{} - b, x := &b0, m0 - _, _ = b, x - return m0 +// Deprecated: Use LocalCredentialOptions_NoPassword.ProtoReflect.Descriptor instead. +func (*LocalCredentialOptions_NoPassword) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 1} } type LocalCredentialOptions_SSO struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` SsoProvider string `protobuf:"bytes,1,opt,name=sso_provider,json=ssoProvider,proto3" json:"sso_provider,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -3858,6 +2382,11 @@ func (x *LocalCredentialOptions_SSO) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +// Deprecated: Use LocalCredentialOptions_SSO.ProtoReflect.Descriptor instead. +func (*LocalCredentialOptions_SSO) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 2} +} + func (x *LocalCredentialOptions_SSO) GetSsoProvider() string { if x != nil { return x.SsoProvider @@ -3865,26 +2394,8 @@ func (x *LocalCredentialOptions_SSO) GetSsoProvider() string { return "" } -func (x *LocalCredentialOptions_SSO) SetSsoProvider(v string) { - x.SsoProvider = v -} - -type LocalCredentialOptions_SSO_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - SsoProvider string -} - -func (b0 LocalCredentialOptions_SSO_builder) Build() *LocalCredentialOptions_SSO { - m0 := &LocalCredentialOptions_SSO{} - b, x := &b0, m0 - _, _ = b, x - x.SsoProvider = b.SsoProvider - return m0 -} - type LocalCredentialOptions_PlaintextPassword struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` PlaintextPassword string `protobuf:"bytes,1,opt,name=plaintext_password,json=plaintextPassword,proto3" json:"plaintext_password,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -3915,6 +2426,11 @@ func (x *LocalCredentialOptions_PlaintextPassword) ProtoReflect() protoreflect.M return mi.MessageOf(x) } +// Deprecated: Use LocalCredentialOptions_PlaintextPassword.ProtoReflect.Descriptor instead. +func (*LocalCredentialOptions_PlaintextPassword) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 3} +} + func (x *LocalCredentialOptions_PlaintextPassword) GetPlaintextPassword() string { if x != nil { return x.PlaintextPassword @@ -3922,26 +2438,8 @@ func (x *LocalCredentialOptions_PlaintextPassword) GetPlaintextPassword() string return "" } -func (x *LocalCredentialOptions_PlaintextPassword) SetPlaintextPassword(v string) { - x.PlaintextPassword = v -} - -type LocalCredentialOptions_PlaintextPassword_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - PlaintextPassword string -} - -func (b0 LocalCredentialOptions_PlaintextPassword_builder) Build() *LocalCredentialOptions_PlaintextPassword { - m0 := &LocalCredentialOptions_PlaintextPassword{} - b, x := &b0, m0 - _, _ = b, x - x.PlaintextPassword = b.PlaintextPassword - return m0 -} - type CreateAccountResponse_SuccessResult struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` IsCreateAccountResult bool `protobuf:"varint,2,opt,name=is_create_account_result,json=isCreateAccountResult,proto3" json:"is_create_account_result,omitempty"` unknownFields protoimpl.UnknownFields @@ -3973,6 +2471,11 @@ func (x *CreateAccountResponse_SuccessResult) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } +// Deprecated: Use CreateAccountResponse_SuccessResult.ProtoReflect.Descriptor instead. +func (*CreateAccountResponse_SuccessResult) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16, 0} +} + func (x *CreateAccountResponse_SuccessResult) GetResource() *Resource { if x != nil { return x.Resource @@ -3987,43 +2490,8 @@ func (x *CreateAccountResponse_SuccessResult) GetIsCreateAccountResult() bool { return false } -func (x *CreateAccountResponse_SuccessResult) SetResource(v *Resource) { - x.Resource = v -} - -func (x *CreateAccountResponse_SuccessResult) SetIsCreateAccountResult(v bool) { - x.IsCreateAccountResult = v -} - -func (x *CreateAccountResponse_SuccessResult) HasResource() bool { - if x == nil { - return false - } - return x.Resource != nil -} - -func (x *CreateAccountResponse_SuccessResult) ClearResource() { - x.Resource = nil -} - -type CreateAccountResponse_SuccessResult_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Resource *Resource - IsCreateAccountResult bool -} - -func (b0 CreateAccountResponse_SuccessResult_builder) Build() *CreateAccountResponse_SuccessResult { - m0 := &CreateAccountResponse_SuccessResult{} - b, x := &b0, m0 - _, _ = b, x - x.Resource = b.Resource - x.IsCreateAccountResult = b.IsCreateAccountResult - return m0 -} - type CreateAccountResponse_ActionRequiredResult struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` IsCreateAccountResult bool `protobuf:"varint,3,opt,name=is_create_account_result,json=isCreateAccountResult,proto3" json:"is_create_account_result,omitempty"` @@ -4056,6 +2524,11 @@ func (x *CreateAccountResponse_ActionRequiredResult) ProtoReflect() protoreflect return mi.MessageOf(x) } +// Deprecated: Use CreateAccountResponse_ActionRequiredResult.ProtoReflect.Descriptor instead. +func (*CreateAccountResponse_ActionRequiredResult) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16, 1} +} + func (x *CreateAccountResponse_ActionRequiredResult) GetResource() *Resource { if x != nil { return x.Resource @@ -4077,49 +2550,8 @@ func (x *CreateAccountResponse_ActionRequiredResult) GetIsCreateAccountResult() return false } -func (x *CreateAccountResponse_ActionRequiredResult) SetResource(v *Resource) { - x.Resource = v -} - -func (x *CreateAccountResponse_ActionRequiredResult) SetMessage(v string) { - x.Message = v -} - -func (x *CreateAccountResponse_ActionRequiredResult) SetIsCreateAccountResult(v bool) { - x.IsCreateAccountResult = v -} - -func (x *CreateAccountResponse_ActionRequiredResult) HasResource() bool { - if x == nil { - return false - } - return x.Resource != nil -} - -func (x *CreateAccountResponse_ActionRequiredResult) ClearResource() { - x.Resource = nil -} - -type CreateAccountResponse_ActionRequiredResult_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Resource *Resource - Message string - IsCreateAccountResult bool -} - -func (b0 CreateAccountResponse_ActionRequiredResult_builder) Build() *CreateAccountResponse_ActionRequiredResult { - m0 := &CreateAccountResponse_ActionRequiredResult{} - b, x := &b0, m0 - _, _ = b, x - x.Resource = b.Resource - x.Message = b.Message - x.IsCreateAccountResult = b.IsCreateAccountResult - return m0 -} - type EncryptionConfig_JWKPublicKeyConfig struct { - state protoimpl.MessageState `protogen:"hybrid.v1"` + state protoimpl.MessageState `protogen:"open.v1"` PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -4150,6 +2582,11 @@ func (x *EncryptionConfig_JWKPublicKeyConfig) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } +// Deprecated: Use EncryptionConfig_JWKPublicKeyConfig.ProtoReflect.Descriptor instead. +func (*EncryptionConfig_JWKPublicKeyConfig) Descriptor() ([]byte, []int) { + return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19, 0} +} + func (x *EncryptionConfig_JWKPublicKeyConfig) GetPubKey() []byte { if x != nil { return x.PubKey @@ -4157,244 +2594,563 @@ func (x *EncryptionConfig_JWKPublicKeyConfig) GetPubKey() []byte { return nil } -func (x *EncryptionConfig_JWKPublicKeyConfig) SetPubKey(v []byte) { - if v == nil { - v = []byte{} - } - x.PubKey = v -} +var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor -type EncryptionConfig_JWKPublicKeyConfig_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. +var file_c1_connector_v2_resource_proto_rawDesc = string([]byte{ + 0x0a, 0x1e, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, + 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0f, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x03, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x20, 0x01, 0x28, 0x80, 0x08, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x30, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, + 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x42, 0x0f, 0xfa, 0x42, 0x0c, 0x92, 0x01, 0x09, 0x18, + 0x01, 0x22, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, + 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, + 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x20, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x64, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x79, 0x6e, 0x63, + 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x79, 0x6e, 0x63, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x70, 0x0a, 0x05, 0x54, 0x72, 0x61, + 0x69, 0x74, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x52, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x52, 0x41, + 0x49, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x52, 0x41, + 0x49, 0x54, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x52, + 0x41, 0x49, 0x54, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x52, + 0x41, 0x49, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x52, 0x41, + 0x49, 0x54, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x10, 0x05, 0x22, 0xa6, 0x02, 0x0a, 0x2c, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, + 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x2a, 0x05, 0x18, 0xfa, 0x01, 0x40, 0x01, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, + 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, 0x80, 0x80, 0x40, 0xd0, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x33, 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, + 0x28, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, + 0x6e, 0x63, 0x49, 0x64, 0x22, 0xd2, 0x01, 0x0a, 0x2d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, 0x80, 0x80, 0x40, 0xd0, + 0x01, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x4e, 0x0a, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x16, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x12, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x64, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x64, 0x22, 0x50, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, + 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x49, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0x52, 0x0a, 0x18, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x32, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0xfc, 0x01, 0x0a, 0x17, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x12, + 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0xd7, + 0x01, 0x0a, 0x18, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x65, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x0d, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x0b, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3a, 0x0a, 0x06, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, + 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0c, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, + 0x31, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x1a, 0x49, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x22, 0xd1, 0x05, + 0x0a, 0x11, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x5c, 0x0a, 0x0f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, + 0x00, 0x52, 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x50, 0x0a, 0x0b, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x03, 0x73, 0x73, 0x6f, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x53, 0x4f, 0x48, 0x00, 0x52, 0x03, 0x73, 0x73, 0x6f, 0x12, + 0x65, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x48, 0x00, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x6f, 0x72, 0x63, + 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x1a, 0x7a, 0x0a, 0x0e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x22, 0x04, 0x18, 0x40, 0x28, 0x08, 0x52, + 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, + 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, + 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x1a, 0x0c, + 0x0a, 0x0a, 0x4e, 0x6f, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x28, 0x0a, 0x03, + 0x53, 0x53, 0x4f, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x73, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x73, 0x6f, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x1a, 0x6e, 0x0a, 0x11, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x59, 0x0a, 0x13, 0x65, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, + 0x08, 0x01, 0x52, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0xbe, 0x05, 0x0a, 0x16, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x61, 0x0a, 0x0f, + 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, + 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, + 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x55, 0x0a, 0x0b, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x65, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x03, 0x73, 0x73, 0x6f, 0x18, 0x66, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x53, 0x4f, + 0x48, 0x00, 0x52, 0x03, 0x73, 0x73, 0x6f, 0x12, 0x6a, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x67, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x50, 0x6c, 0x61, + 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, + 0x52, 0x11, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x41, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x1a, + 0x7a, 0x0a, 0x0e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x21, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x22, 0x04, 0x18, 0x40, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, + 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x1a, 0x0c, 0x0a, 0x0a, 0x4e, + 0x6f, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x28, 0x0a, 0x03, 0x53, 0x53, 0x4f, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x73, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x73, 0x6f, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x1a, 0x42, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x22, 0x4c, 0x0a, 0x12, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, + 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x72, + 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, + 0x53, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0xfc, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, + 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, + 0xfe, 0x04, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x66, 0x0a, 0x0f, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x65, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x0e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x1a, 0x7f, 0x0a, 0x0d, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x73, + 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x73, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x1a, 0xa0, 0x01, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x35, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x37, 0x0a, + 0x18, 0x69, 0x73, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x15, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0xd6, 0x01, 0x0a, 0x0d, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x19, + 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 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, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x17, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x22, 0x73, 0x0a, 0x0d, 0x50, 0x6c, 0x61, + 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 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, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xa2, + 0x02, 0x0a, 0x10, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, + 0x69, 0x0a, 0x15, 0x6a, 0x77, 0x6b, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x4a, 0x57, 0x4b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x12, 0x6a, 0x77, 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x2d, 0x0a, 0x12, 0x4a, 0x57, + 0x4b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x22, 0x8c, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, + 0x20, 0x01, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x20, 0x01, 0x28, 0x80, + 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x62, + 0x61, 0x74, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x22, 0xf0, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x2b, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x49, 0x0a, 0x12, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, + 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, + 0x80, 0x10, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x52, 0x0a, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x0e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, + 0x1b, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, + 0x0a, 0x28, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, + 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, 0x49, 0x53, 0x54, + 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x53, 0x10, 0x01, 0x12, 0x37, 0x0a, 0x33, + 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, + 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x47, + 0x52, 0x41, 0x4e, 0x54, 0x53, 0x5f, 0x50, 0x52, 0x49, 0x4e, 0x43, 0x49, 0x50, 0x41, 0x4c, 0x5f, + 0x4a, 0x49, 0x54, 0x10, 0x02, 0x22, 0xf6, 0x02, 0x0a, 0x24, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, + 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x20, + 0x01, 0x28, 0x80, 0x08, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x49, 0x64, 0x12, 0x53, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x00, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x0a, 0xfa, 0x42, + 0x07, 0x2a, 0x05, 0x18, 0xfa, 0x01, 0x40, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, + 0x80, 0x80, 0x40, 0xd0, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x0e, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x08, 0xd0, 0x01, 0x01, + 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x22, 0xc6, + 0x01, 0x0a, 0x25, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, 0x80, 0x80, 0x40, 0xd0, 0x01, 0x01, + 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x27, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x53, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x00, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, + 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, + 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, 0x6e, + 0x63, 0x49, 0x64, 0x22, 0x99, 0x01, 0x0a, 0x28, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x52, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, + 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0xab, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, + 0x11, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x12, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x3e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x92, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, + 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9c, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xde, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x61, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x81, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x67, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x56, 0x32, 0x12, 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x56, 0x32, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x83, 0x01, 0x0a, 0x18, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x10, 0x52, 0x6f, 0x74, 0x61, 0x74, + 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x28, 0x2e, 0x63, 0x31, + 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, + 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x77, 0x0a, 0x15, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x0d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x63, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x63, 0x74, 0x6f, + 0x72, 0x6f, 0x6e, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, + 0x62, 0x2f, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, + 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) - PubKey []byte -} +var ( + file_c1_connector_v2_resource_proto_rawDescOnce sync.Once + file_c1_connector_v2_resource_proto_rawDescData []byte +) -func (b0 EncryptionConfig_JWKPublicKeyConfig_builder) Build() *EncryptionConfig_JWKPublicKeyConfig { - m0 := &EncryptionConfig_JWKPublicKeyConfig{} - b, x := &b0, m0 - _, _ = b, x - x.PubKey = b.PubKey - return m0 +func file_c1_connector_v2_resource_proto_rawDescGZIP() []byte { + file_c1_connector_v2_resource_proto_rawDescOnce.Do(func() { + file_c1_connector_v2_resource_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_c1_connector_v2_resource_proto_rawDesc), len(file_c1_connector_v2_resource_proto_rawDesc))) + }) + return file_c1_connector_v2_resource_proto_rawDescData } -var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor - -const file_c1_connector_v2_resource_proto_rawDesc = "" + - "\n" + - "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xb4\x03\n" + - "\fResourceType\x12\x1a\n" + - "\x02id\x18\x01 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + - "\fdisplay_name\x18\x02 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\vdisplayName\x12L\n" + - "\x06traits\x18\x03 \x03(\x0e2#.c1.connector.v2.ResourceType.TraitB\x0f\xfaB\f\x92\x01\t\x18\x01\"\x05\x82\x01\x02\x10\x01R\x06traits\x126\n" + - "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + - "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + - "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"p\n" + - "\x05Trait\x12\x15\n" + - "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + - "\n" + - "TRAIT_USER\x10\x01\x12\x0f\n" + - "\vTRAIT_GROUP\x10\x02\x12\x0e\n" + - "\n" + - "TRAIT_ROLE\x10\x03\x12\r\n" + - "\tTRAIT_APP\x10\x04\x12\x10\n" + - "\fTRAIT_SECRET\x10\x05\"\xa6\x02\n" + - ",ResourceTypesServiceListResourceTypesRequest\x121\n" + - "\x06parent\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06parent\x12'\n" + - "\tpage_size\x18\x02 \x01(\rB\n" + - "\xfaB\a*\x05\x18\xfa\x01@\x01R\bpageSize\x12-\n" + - "\n" + - "page_token\x18\x03 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\tpageToken\x126\n" + - "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + - "\x0eactive_sync_id\x18\x05 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\factiveSyncId\"\xd2\x01\n" + - "-ResourceTypesServiceListResourceTypesResponse\x121\n" + - "\x04list\x18\x01 \x03(\v2\x1d.c1.connector.v2.ResourceTypeR\x04list\x126\n" + - "\x0fnext_page_token\x18\x02 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\rnextPageToken\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"N\n" + - "\x15CreateResourceRequest\x125\n" + - "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\"\x85\x01\n" + - "\x16CreateResourceResponse\x123\n" + - "\acreated\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\acreated\x126\n" + - "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xa0\x01\n" + - "\x15DeleteResourceRequest\x12<\n" + - "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + - "resourceId\x12I\n" + - "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\"P\n" + - "\x16DeleteResourceResponse\x126\n" + - "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xa2\x01\n" + - "\x17DeleteResourceV2Request\x12<\n" + - "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + - "resourceId\x12I\n" + - "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\"R\n" + - "\x18DeleteResourceV2Response\x126\n" + - "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xfc\x01\n" + - "\x17RotateCredentialRequest\x12<\n" + - "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + - "resourceId\x12Q\n" + - "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xd7\x01\n" + - "\x18RotateCredentialResponse\x12E\n" + - "\x0eencrypted_data\x18\x01 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x12<\n" + - "\vresource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + - "resourceId\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\x82\x02\n" + - "\vAccountInfo\x12:\n" + - "\x06emails\x18\x01 \x03(\v2\".c1.connector.v2.AccountInfo.EmailR\x06emails\x12\x14\n" + - "\x05login\x18\x02 \x01(\tR\x05login\x12#\n" + - "\rlogin_aliases\x18\x03 \x03(\tR\floginAliases\x121\n" + - "\aprofile\x18\x04 \x01(\v2\x17.google.protobuf.StructR\aprofile\x1aI\n" + - "\x05Email\x12!\n" + - "\aaddress\x18\x01 \x01(\tB\a\xfaB\x04r\x02`\x01R\aaddress\x12\x1d\n" + - "\n" + - "is_primary\x18\x02 \x01(\bR\tisPrimary\"\xd1\x05\n" + - "\x11CredentialOptions\x12\\\n" + - "\x0frandom_password\x18d \x01(\v21.c1.connector.v2.CredentialOptions.RandomPasswordH\x00R\x0erandomPassword\x12P\n" + - "\vno_password\x18e \x01(\v2-.c1.connector.v2.CredentialOptions.NoPasswordH\x00R\n" + - "noPassword\x12:\n" + - "\x03sso\x18f \x01(\v2&.c1.connector.v2.CredentialOptions.SSOH\x00R\x03sso\x12e\n" + - "\x12encrypted_password\x18g \x01(\v24.c1.connector.v2.CredentialOptions.EncryptedPasswordH\x00R\x11encryptedPassword\x12:\n" + - "\x1aforce_change_at_next_login\x18\x01 \x01(\bR\x16forceChangeAtNextLogin\x1az\n" + - "\x0eRandomPassword\x12!\n" + - "\x06length\x18\x01 \x01(\x03B\t\xfaB\x06\"\x04\x18@(\bR\x06length\x12E\n" + - "\vconstraints\x18\x02 \x03(\v2#.c1.connector.v2.PasswordConstraintR\vconstraints\x1a\f\n" + - "\n" + - "NoPassword\x1a(\n" + - "\x03SSO\x12!\n" + - "\fsso_provider\x18\x01 \x01(\tR\vssoProvider\x1an\n" + - "\x11EncryptedPassword\x12Y\n" + - "\x13encrypted_passwords\x18\x01 \x03(\v2\x1e.c1.connector.v2.EncryptedDataB\b\xfaB\x05\x92\x01\x02\b\x01R\x12encryptedPasswordsB\t\n" + - "\aoptions\"\xbe\x05\n" + - "\x16LocalCredentialOptions\x12a\n" + - "\x0frandom_password\x18d \x01(\v26.c1.connector.v2.LocalCredentialOptions.RandomPasswordH\x00R\x0erandomPassword\x12U\n" + - "\vno_password\x18e \x01(\v22.c1.connector.v2.LocalCredentialOptions.NoPasswordH\x00R\n" + - "noPassword\x12?\n" + - "\x03sso\x18f \x01(\v2+.c1.connector.v2.LocalCredentialOptions.SSOH\x00R\x03sso\x12j\n" + - "\x12plaintext_password\x18g \x01(\v29.c1.connector.v2.LocalCredentialOptions.PlaintextPasswordH\x00R\x11plaintextPassword\x12:\n" + - "\x1aforce_change_at_next_login\x18\x01 \x01(\bR\x16forceChangeAtNextLogin\x1az\n" + - "\x0eRandomPassword\x12!\n" + - "\x06length\x18\x01 \x01(\x03B\t\xfaB\x06\"\x04\x18@(\bR\x06length\x12E\n" + - "\vconstraints\x18\x02 \x03(\v2#.c1.connector.v2.PasswordConstraintR\vconstraints\x1a\f\n" + - "\n" + - "NoPassword\x1a(\n" + - "\x03SSO\x12!\n" + - "\fsso_provider\x18\x01 \x01(\tR\vssoProvider\x1aB\n" + - "\x11PlaintextPassword\x12-\n" + - "\x12plaintext_password\x18\x01 \x01(\tR\x11plaintextPasswordB\t\n" + - "\aoptions\"L\n" + - "\x12PasswordConstraint\x12\x19\n" + - "\bchar_set\x18\x01 \x01(\tR\acharSet\x12\x1b\n" + - "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xfc\x01\n" + - "\x14CreateAccountRequest\x12?\n" + - "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + - "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + - "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xfe\x04\n" + - "\x15CreateAccountResponse\x12P\n" + - "\asuccess\x18d \x01(\v24.c1.connector.v2.CreateAccountResponse.SuccessResultH\x00R\asuccess\x12f\n" + - "\x0faction_required\x18e \x01(\v2;.c1.connector.v2.CreateAccountResponse.ActionRequiredResultH\x00R\x0eactionRequired\x12E\n" + - "\x0eencrypted_data\x18\x02 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\x7f\n" + - "\rSuccessResult\x125\n" + - "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x127\n" + - "\x18is_create_account_result\x18\x02 \x01(\bR\x15isCreateAccountResult\x1a\xa0\x01\n" + - "\x14ActionRequiredResult\x125\n" + - "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\x127\n" + - "\x18is_create_account_result\x18\x03 \x01(\bR\x15isCreateAccountResultB\b\n" + - "\x06result\"\xd6\x01\n" + - "\rEncryptedData\x12\x1a\n" + - "\bprovider\x18\x01 \x01(\tR\bprovider\x12\x19\n" + - "\x06key_id\x18\x02 \x01(\tB\x02\x18\x01R\x05keyId\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x16\n" + - "\x06schema\x18\x05 \x01(\tR\x06schema\x12'\n" + - "\x0fencrypted_bytes\x18\x06 \x01(\fR\x0eencryptedBytes\x12\x17\n" + - "\akey_ids\x18\a \x03(\tR\x06keyIds\"s\n" + - "\rPlaintextData\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" + - "\x06schema\x18\x03 \x01(\tR\x06schema\x12\x14\n" + - "\x05bytes\x18\x04 \x01(\fR\x05bytes\"\xa2\x02\n" + - "\x10EncryptionConfig\x127\n" + - "\tprincipal\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\tprincipal\x12\x1a\n" + - "\bprovider\x18\x02 \x01(\tR\bprovider\x12\x15\n" + - "\x06key_id\x18\x03 \x01(\tR\x05keyId\x12i\n" + - "\x15jwk_public_key_config\x18d \x01(\v24.c1.connector.v2.EncryptionConfig.JWKPublicKeyConfigH\x00R\x12jwkPublicKeyConfig\x1a-\n" + - "\x12JWKPublicKeyConfig\x12\x17\n" + - "\apub_key\x18\x01 \x01(\fR\x06pubKeyB\b\n" + - "\x06config\"\x8c\x01\n" + - "\n" + - "ResourceId\x12/\n" + - "\rresource_type\x18\x01 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\fresourceType\x12&\n" + - "\bresource\x18\x02 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\bresource\x12%\n" + - "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf0\x04\n" + - "\bResource\x12+\n" + - "\x02id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x02id\x12I\n" + - "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\x120\n" + - "\fdisplay_name\x18\x03 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\vdisplayName\x126\n" + - "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + - "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\x10\xd0\x01\x01R\vdescription\x12%\n" + - "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12<\n" + - "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdR\n" + - "externalId\x12Q\n" + - "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceR\x0ecreationSource\"\x98\x01\n" + - "\x0eCreationSource\x12\x1f\n" + - "\x1bCREATION_SOURCE_UNSPECIFIED\x10\x00\x12,\n" + - "(CREATION_SOURCE_CONNECTOR_LIST_RESOURCES\x10\x01\x127\n" + - "3CREATION_SOURCE_CONNECTOR_LIST_GRANTS_PRINCIPAL_JIT\x10\x02\"\xf6\x02\n" + - "$ResourcesServiceListResourcesRequest\x124\n" + - "\x10resource_type_id\x18\x01 \x01(\tB\n" + - "\xfaB\ar\x05 \x01(\x80\bR\x0eresourceTypeId\x12S\n" + - "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x00R\x10parentResourceId\x12'\n" + - "\tpage_size\x18\x03 \x01(\rB\n" + - "\xfaB\a*\x05\x18\xfa\x01@\x01R\bpageSize\x12-\n" + - "\n" + - "page_token\x18\x04 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\tpageToken\x126\n" + - "\vannotations\x18\x05 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + - "\x0eactive_sync_id\x18\x06 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\factiveSyncId\"\xc6\x01\n" + - "%ResourcesServiceListResourcesResponse\x12-\n" + - "\x04list\x18\x01 \x03(\v2\x19.c1.connector.v2.ResourceR\x04list\x126\n" + - "\x0fnext_page_token\x18\x02 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\rnextPageToken\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xa9\x02\n" + - "'ResourceGetterServiceGetResourceRequest\x12<\n" + - "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + - "resourceId\x12S\n" + - "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x00R\x10parentResourceId\x126\n" + - "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + - "\x0eactive_sync_id\x18\x04 \x01(\tB\r\xfaB\n" + - "r\b \x01(\x80\b\xd0\x01\x01R\factiveSyncId\"\x99\x01\n" + - "(ResourceGetterServiceGetResourceResponse\x125\n" + - "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x126\n" + - "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"R\n" + - "\n" + - "ExternalId\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + - "\x04link\x18\x02 \x01(\tR\x04link\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription2\xab\x01\n" + - "\x14ResourceTypesService\x12\x92\x01\n" + - "\x11ListResourceTypes\x12=.c1.connector.v2.ResourceTypesServiceListResourceTypesRequest\x1a>.c1.connector.v2.ResourceTypesServiceListResourceTypesResponse2\x92\x01\n" + - "\x10ResourcesService\x12~\n" + - "\rListResources\x125.c1.connector.v2.ResourcesServiceListResourcesRequest\x1a6.c1.connector.v2.ResourcesServiceListResourcesResponse2\x9c\x01\n" + - "\x15ResourceGetterService\x12\x82\x01\n" + - "\vGetResource\x128.c1.connector.v2.ResourceGetterServiceGetResourceRequest\x1a9.c1.connector.v2.ResourceGetterServiceGetResourceResponse2\xde\x01\n" + - "\x16ResourceManagerService\x12a\n" + - "\x0eCreateResource\x12&.c1.connector.v2.CreateResourceRequest\x1a'.c1.connector.v2.CreateResourceResponse\x12a\n" + - "\x0eDeleteResource\x12&.c1.connector.v2.DeleteResourceRequest\x1a'.c1.connector.v2.DeleteResourceResponse2\x81\x01\n" + - "\x16ResourceDeleterService\x12g\n" + - "\x10DeleteResourceV2\x12(.c1.connector.v2.DeleteResourceV2Request\x1a).c1.connector.v2.DeleteResourceV2Response2\x83\x01\n" + - "\x18CredentialManagerService\x12g\n" + - "\x10RotateCredential\x12(.c1.connector.v2.RotateCredentialRequest\x1a).c1.connector.v2.RotateCredentialResponse2w\n" + - "\x15AccountManagerService\x12^\n" + - "\rCreateAccount\x12%.c1.connector.v2.CreateAccountRequest\x1a&.c1.connector.v2.CreateAccountResponseB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" - var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_c1_connector_v2_resource_proto_goTypes = []any{ diff --git a/pb/c1/connector/v2/resource.pb.validate.go b/pb/c1/connector/v2/resource.pb.validate.go index 48fa35152..98c4eca67 100644 --- a/pb/c1/connector/v2/resource.pb.validate.go +++ b/pb/c1/connector/v2/resource.pb.validate.go @@ -165,6 +165,8 @@ func (m *ResourceType) validate(all bool) error { // no validation rules for SourcedExternally + // no validation rules for SyncBucket + if len(errors) > 0 { return ResourceTypeMultiError(errors) } diff --git a/pkg/cli/commands.go b/pkg/cli/commands.go index 883632d9d..388cb87f0 100644 --- a/pkg/cli/commands.go +++ b/pkg/cli/commands.go @@ -333,6 +333,10 @@ func MakeMainCommand[T field.Configurable]( } } + if v.GetBool("parallel-sync") { + opts = append(opts, connectorrunner.WithParallelSyncEnabled()) + } + if v.GetString("c1z-temp-dir") != "" { c1zTmpDir := v.GetString("c1z-temp-dir") if _, err := os.Stat(c1zTmpDir); os.IsNotExist(err) { diff --git a/pkg/connectorrunner/runner.go b/pkg/connectorrunner/runner.go index 1f3945971..51ccced79 100644 --- a/pkg/connectorrunner/runner.go +++ b/pkg/connectorrunner/runner.go @@ -341,6 +341,7 @@ type runnerConfig struct { syncDifferConfig *syncDifferConfig syncCompactorConfig *syncCompactorConfig skipFullSync bool + parallelSync bool targetedSyncResourceIDs []string externalResourceC1Z string externalResourceEntitlementIdFilter string @@ -552,6 +553,13 @@ func WithFullSyncDisabled() Option { } } +func WithParallelSyncEnabled() Option { + return func(ctx context.Context, cfg *runnerConfig) error { + cfg.parallelSync = true + return nil + } +} + func WithTargetedSyncResourceIDs(resourceIDs []string) Option { return func(ctx context.Context, cfg *runnerConfig) error { cfg.targetedSyncResourceIDs = resourceIDs @@ -803,6 +811,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op local.WithSkipEntitlementsAndGrants(cfg.skipEntitlementsAndGrants), local.WithSkipGrants(cfg.skipGrants), local.WithSyncResourceTypeIDs(cfg.syncResourceTypeIDs), + local.WithParallelSyncEnabled(cfg.parallelSync), ) if err != nil { return nil, err @@ -815,7 +824,8 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op return runner, nil } - tm, err := c1api.NewC1TaskManager(ctx, + tm, err := c1api.NewC1TaskManager( + ctx, cfg.clientID, cfg.clientSecret, cfg.tempDir, @@ -824,6 +834,7 @@ func NewConnectorRunner(ctx context.Context, c types.ConnectorServer, opts ...Op cfg.externalResourceEntitlementIdFilter, cfg.targetedSyncResourceIDs, cfg.syncResourceTypeIDs, + cfg.parallelSync, ) if err != nil { return nil, err diff --git a/pkg/dotc1z/c1file.go b/pkg/dotc1z/c1file.go index 3e922ec61..bbf717fd0 100644 --- a/pkg/dotc1z/c1file.go +++ b/pkg/dotc1z/c1file.go @@ -49,6 +49,14 @@ type C1File struct { slowQueryLogTimesMu sync.Mutex slowQueryThreshold time.Duration slowQueryLogFrequency time.Duration + + // WAL checkpointing + checkpointTicker *time.Ticker + checkpointStop chan struct{} + checkpointDone chan struct{} + checkpointOnce sync.Once + checkpointMu sync.RWMutex // Prevents DB activity during WAL checkpoint to avoid WAL file growth under heavy load + checkpointEnabled bool // Whether WAL checkpointing is enabled } var _ connectorstore.Writer = (*C1File)(nil) @@ -67,6 +75,12 @@ func WithC1FPragma(name string, value string) C1FOption { } } +func WithC1FWALCheckpoint(enable bool) C1FOption { + return func(o *C1File) { + o.checkpointEnabled = enable + } +} + // Returns a C1File instance for the given db filepath. func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1File, error) { ctx, span := tracer.Start(ctx, "NewC1File") @@ -87,6 +101,8 @@ func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1Fi slowQueryLogTimes: make(map[string]time.Time), slowQueryThreshold: 5 * time.Second, slowQueryLogFrequency: 1 * time.Minute, + checkpointStop: make(chan struct{}), + checkpointDone: make(chan struct{}), } for _, opt := range opts { @@ -107,9 +123,10 @@ func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1Fi } type c1zOptions struct { - tmpDir string - pragmas []pragma - decoderOptions []DecoderOption + tmpDir string + pragmas []pragma + decoderOptions []DecoderOption + enableWALCheckpoint bool } type C1ZOption func(*c1zOptions) @@ -131,6 +148,12 @@ func WithDecoderOptions(opts ...DecoderOption) C1ZOption { } } +func WithWALCheckpoint(enable bool) C1ZOption { + return func(o *c1zOptions) { + o.enableWALCheckpoint = enable + } +} + // Returns a new C1File instance with its state stored at the provided filename. func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) (*C1File, error) { ctx, span := tracer.Start(ctx, "NewC1ZFile") @@ -150,6 +173,9 @@ func NewC1ZFile(ctx context.Context, outputFilePath string, opts ...C1ZOption) ( for _, pragma := range options.pragmas { c1fopts = append(c1fopts, WithC1FPragma(pragma.name, pragma.value)) } + if options.enableWALCheckpoint { + c1fopts = append(c1fopts, WithC1FWALCheckpoint(true)) + } c1File, err := NewC1File(ctx, dbFilePath, c1fopts...) if err != nil { @@ -174,6 +200,15 @@ func cleanupDbDir(dbFilePath string, err error) error { func (c *C1File) Close() error { var err error + // Stop WAL checkpointing if it's running + if c.checkpointTicker != nil { + c.checkpointTicker.Stop() + c.checkpointOnce.Do(func() { + close(c.checkpointStop) + }) + <-c.checkpointDone // Wait for goroutine to finish + } + if c.rawDb != nil { err = c.rawDb.Close() if err != nil { @@ -223,6 +258,11 @@ func (c *C1File) init(ctx context.Context) error { } } + // Start WAL checkpointing if enabled, journal mode is WAL, and checkpointing is enabled + if c.checkpointEnabled && c.isWALMode() { + c.startWALCheckpointing() + } + return nil } @@ -412,3 +452,66 @@ func (c *C1File) GrantStats(ctx context.Context, syncType connectorstore.SyncTyp return stats, nil } + +// isWALMode checks if the database is using WAL mode +func (c *C1File) isWALMode() bool { + for _, pragma := range c.pragmas { + if pragma.name == "journal_mode" && pragma.value == "WAL" { + return true + } + } + return false +} + +// startWALCheckpointing starts a background goroutine to perform WAL checkpoints every 5 minutes +func (c *C1File) startWALCheckpointing() { + c.checkpointTicker = time.NewTicker(5 * time.Minute) + + go func() { + defer close(c.checkpointDone) + for { + select { + case <-c.checkpointTicker.C: + c.performWALCheckpoint() + case <-c.checkpointStop: + return + } + } + }() +} + +// acquireCheckpointLock acquires a read lock for database operations +func (c *C1File) acquireCheckpointLock() { + if c.checkpointEnabled { + c.checkpointMu.RLock() + } +} + +// releaseCheckpointLock releases the read lock for database operations +func (c *C1File) releaseCheckpointLock() { + if c.checkpointEnabled { + c.checkpointMu.RUnlock() + } +} + +// performWALCheckpoint performs a WAL checkpoint using SQLITE_CHECKPOINT_RESTART or SQLITE_CHECKPOINT_TRUNCATE +func (c *C1File) performWALCheckpoint() { + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + // Acquire write lock to pause all database operations during checkpoint + c.checkpointMu.Lock() + defer c.checkpointMu.Unlock() + + // First try SQLITE_CHECKPOINT_TRUNCATE + _, err := c.rawDb.ExecContext(ctx, "PRAGMA wal_checkpoint(TRUNCATE)") + if err != nil { + // If TRUNCATE fails, try RESTART + _, err = c.rawDb.ExecContext(ctx, "PRAGMA wal_checkpoint(RESTART)") + if err != nil { + // Log error but don't fail the operation + // In a real implementation, you might want to use a logger here + fmt.Printf("WAL checkpoint failed: %v\n", err) + } + } +} diff --git a/pkg/dotc1z/manager/local/local.go b/pkg/dotc1z/manager/local/local.go index 6ccbdd9c0..5e273e4fa 100644 --- a/pkg/dotc1z/manager/local/local.go +++ b/pkg/dotc1z/manager/local/local.go @@ -16,10 +16,11 @@ import ( var tracer = otel.Tracer("baton-sdk/pkg.dotc1z.manager.local") type localManager struct { - filePath string - tmpPath string - tmpDir string - decoderOptions []dotc1z.DecoderOption + filePath string + tmpPath string + tmpDir string + decoderOptions []dotc1z.DecoderOption + enableWALCheckpoint bool } type Option func(*localManager) @@ -36,6 +37,12 @@ func WithDecoderOptions(opts ...dotc1z.DecoderOption) Option { } } +func WithWALCheckpoint(enable bool) Option { + return func(o *localManager) { + o.enableWALCheckpoint = enable + } +} + func (l *localManager) copyFileToTmp(ctx context.Context) error { _, span := tracer.Start(ctx, "localManager.copyFileToTmp") defer span.End() @@ -112,6 +119,9 @@ func (l *localManager) LoadC1Z(ctx context.Context) (*dotc1z.C1File, error) { if len(l.decoderOptions) > 0 { opts = append(opts, dotc1z.WithDecoderOptions(l.decoderOptions...)) } + if l.enableWALCheckpoint { + opts = append(opts, dotc1z.WithWALCheckpoint(true)) + } return dotc1z.NewC1ZFile(ctx, l.tmpPath, opts...) } diff --git a/pkg/dotc1z/manager/manager.go b/pkg/dotc1z/manager/manager.go index e94665251..9887d756a 100644 --- a/pkg/dotc1z/manager/manager.go +++ b/pkg/dotc1z/manager/manager.go @@ -18,8 +18,9 @@ type Manager interface { } type managerOptions struct { - tmpDir string - decoderOptions []dotc1z.DecoderOption + tmpDir string + decoderOptions []dotc1z.DecoderOption + enableWALCheckpoint bool } type ManagerOption func(*managerOptions) @@ -36,6 +37,12 @@ func WithDecoderOptions(opts ...dotc1z.DecoderOption) ManagerOption { } } +func WithWALCheckpoint(enable bool) ManagerOption { + return func(o *managerOptions) { + o.enableWALCheckpoint = enable + } +} + // Given a file path, return a Manager that can read and write files to that path. // // The first thing we do is check if the file path starts with "s3://". If it does, we return a new @@ -56,6 +63,9 @@ func New(ctx context.Context, filePath string, opts ...ManagerOption) (Manager, if len(options.decoderOptions) > 0 { s3Opts = append(s3Opts, s3.WithDecoderOptions(options.decoderOptions...)) } + if options.enableWALCheckpoint { + s3Opts = append(s3Opts, s3.WithWALCheckpoint(true)) + } return s3.NewS3Manager(ctx, filePath, s3Opts...) default: var localOpts []local.Option @@ -65,6 +75,9 @@ func New(ctx context.Context, filePath string, opts ...ManagerOption) (Manager, if len(options.decoderOptions) > 0 { localOpts = append(localOpts, local.WithDecoderOptions(options.decoderOptions...)) } + if options.enableWALCheckpoint { + localOpts = append(localOpts, local.WithWALCheckpoint(true)) + } return local.New(ctx, filePath, localOpts...) } } diff --git a/pkg/dotc1z/manager/s3/s3.go b/pkg/dotc1z/manager/s3/s3.go index 385b1bc47..0b707d0cc 100644 --- a/pkg/dotc1z/manager/s3/s3.go +++ b/pkg/dotc1z/manager/s3/s3.go @@ -19,11 +19,12 @@ import ( var tracer = otel.Tracer("baton-sdk/pkg.dotc1z.manager.s3") type s3Manager struct { - client *us3.S3Client - fileName string - tmpFile string - tmpDir string - decoderOptions []dotc1z.DecoderOption + client *us3.S3Client + fileName string + tmpFile string + tmpDir string + decoderOptions []dotc1z.DecoderOption + enableWALCheckpoint bool } type Option func(*s3Manager) @@ -40,6 +41,12 @@ func WithDecoderOptions(opts ...dotc1z.DecoderOption) Option { } } +func WithWALCheckpoint(enable bool) Option { + return func(o *s3Manager) { + o.enableWALCheckpoint = enable + } +} + func (s *s3Manager) copyToTempFile(ctx context.Context, r io.Reader) error { _, span := tracer.Start(ctx, "s3Manager.copyToTempFile") defer span.End() @@ -130,6 +137,9 @@ func (s *s3Manager) LoadC1Z(ctx context.Context) (*dotc1z.C1File, error) { if len(s.decoderOptions) > 0 { opts = append(opts, dotc1z.WithDecoderOptions(s.decoderOptions...)) } + if s.enableWALCheckpoint { + opts = append(opts, dotc1z.WithWALCheckpoint(true)) + } return dotc1z.NewC1ZFile(ctx, s.tmpFile, opts...) } diff --git a/pkg/dotc1z/sql_helpers.go b/pkg/dotc1z/sql_helpers.go index 07b045138..ac5cf262e 100644 --- a/pkg/dotc1z/sql_helpers.go +++ b/pkg/dotc1z/sql_helpers.go @@ -2,9 +2,9 @@ package dotc1z import ( "context" - "errors" "fmt" "strconv" + "strings" "time" "github.com/doug-martin/goqu/v9" @@ -225,6 +225,10 @@ func (c *C1File) listConnectorObjects(ctx context.Context, tableName string, req // Start timing the query execution queryStartTime := time.Now() + // Acquire checkpoint lock to coordinate with WAL checkpointing + c.acquireCheckpointLock() + defer c.releaseCheckpointLock() + // Execute the query rows, err := c.db.QueryContext(ctx, query, args...) if err != nil { @@ -306,7 +310,10 @@ func prepareConnectorObjectRows[T proto.Message]( return rows, nil } -// executeChunkedInsert executes the insert query in chunks. +func isSQLiteBusy(err error) bool { + return strings.Contains(err.Error(), "database is locked") || strings.Contains(err.Error(), "SQLITE_BUSY") +} + func executeChunkedInsert( ctx context.Context, c *C1File, @@ -320,13 +327,6 @@ func executeChunkedInsert( chunks++ } - tx, err := c.db.BeginTx(ctx, nil) - if err != nil { - return err - } - - var txError error - for i := 0; i < chunks; i++ { start := i * chunkSize end := (i + 1) * chunkSize @@ -335,40 +335,95 @@ func executeChunkedInsert( } chunkedRows := rows[start:end] - // Create the base insert dataset + err := executeChunkWithRetry(ctx, c, tableName, chunkedRows, buildQueryFn) + if err != nil { + return err + } + } + + return nil +} + +// executeChunkWithRetry executes a single chunk with retry logic for SQLITE_BUSY errors +func executeChunkWithRetry( + ctx context.Context, + c *C1File, + tableName string, + chunkedRows []*goqu.Record, + buildQueryFn func(*goqu.InsertDataset, []*goqu.Record) (*goqu.InsertDataset, error), +) error { + maxRetries := 5 + baseDelay := 10 * time.Millisecond + + for attempt := 0; attempt < maxRetries; attempt++ { + // Acquire checkpoint lock to coordinate with WAL checkpointing + c.acquireCheckpointLock() + + tx, err := c.db.BeginTx(ctx, nil) + if err != nil { + c.releaseCheckpointLock() + if isSQLiteBusy(err) && attempt < maxRetries-1 { + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(time.Duration(attempt+1) * baseDelay): + continue + } + } + return err + } + insertDs := tx.Insert(tableName) - // Apply the custom query building function insertDs, err = buildQueryFn(insertDs, chunkedRows) if err != nil { - txError = err - break + c.releaseCheckpointLock() + tx.Rollback() + return err } // Generate the SQL query, args, err := insertDs.ToSQL() if err != nil { - txError = err - break + c.releaseCheckpointLock() + tx.Rollback() + return err } - // Execute the query _, err = tx.ExecContext(ctx, query, args...) if err != nil { - txError = err - break + c.releaseCheckpointLock() + tx.Rollback() + if isSQLiteBusy(err) && attempt < maxRetries-1 { + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(time.Duration(attempt+1) * baseDelay): + continue + } + } + return err } - } - if txError != nil { - if rollbackErr := tx.Rollback(); rollbackErr != nil { - return errors.Join(rollbackErr, txError) + err = tx.Commit() + if err != nil { + c.releaseCheckpointLock() + if isSQLiteBusy(err) && attempt < maxRetries-1 { + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(time.Duration(attempt+1) * baseDelay): + continue + } + } + return err } - return fmt.Errorf("error executing chunked insert: %w", txError) + c.releaseCheckpointLock() + return nil } - return tx.Commit() + return fmt.Errorf("failed to execute chunk after %d retries", maxRetries) } func bulkPutConnectorObject[T proto.Message]( diff --git a/pkg/field/defaults.go b/pkg/field/defaults.go index 8a05c7930..56c02ae9b 100644 --- a/pkg/field/defaults.go +++ b/pkg/field/defaults.go @@ -89,6 +89,7 @@ var ( WithPersistent(true), WithExportTarget(ExportTargetOps)) skipFullSync = BoolField("skip-full-sync", WithDescription("This must be set to skip a full sync"), WithPersistent(true), WithExportTarget(ExportTargetNone)) + parallelSync = BoolField("parallel-sync", WithDescription("This must be set to enable parallel sync"), WithPersistent(true), WithExportTarget(ExportTargetNone)) targetedSyncResourceIDs = StringSliceField("sync-resources", WithDescription("The resource IDs to sync"), WithPersistent(true), WithExportTarget(ExportTargetNone)) skipEntitlementsAndGrants = BoolField("skip-entitlements-and-grants", WithDescription("This must be set to skip syncing of entitlements and grants"), @@ -303,6 +304,7 @@ var DefaultFields = []SchemaField{ invokeActionField, invokeActionArgsField, ServerSessionStoreMaximumSizeField, + parallelSync, otelCollectorEndpoint, otelCollectorEndpointTLSCertPath, diff --git a/pkg/sync/parallel_syncer.go b/pkg/sync/parallel_syncer.go new file mode 100644 index 000000000..e335fbb1b --- /dev/null +++ b/pkg/sync/parallel_syncer.go @@ -0,0 +1,2189 @@ +package sync + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strings" + "sync" + "sync/atomic" + "time" + + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.uber.org/zap" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + reader_v2 "github.com/conductorone/baton-sdk/pb/c1/reader/v2" + "github.com/conductorone/baton-sdk/pkg/annotations" +) + +var _ Syncer = (*parallelSyncer)(nil) + +var taskRetryLimit = 5 +var errTaskQueueFull = errors.New("task queue is full") +var parallelTracer = otel.Tracer("baton-sdk/parallel-sync") + +// min returns the smaller of two integers +func min(a, b int) int { + if a < b { + return a + } + return b +} + +// addTaskWithRetry adds a task to the queue with retry logic for queue full errors +func (ps *parallelSyncer) addTaskWithRetry(ctx context.Context, task *task, maxRetries int) error { + for attempt := 0; attempt <= maxRetries; attempt++ { + err := ps.taskQueue.AddTask(ctx, task) + if err == nil { + return nil + } + + if !errors.Is(err, errTaskQueueFull) { + return err + } + + // If this is the last attempt, return the error + if attempt == maxRetries { + return fmt.Errorf("failed to add task after %d retries: %w", maxRetries, err) + } + + // Wait before retrying, with true exponential backoff + backoffDuration := time.Duration(1< 0 { + c.WorkerCount = count + } + return c +} + +// WithDefaultBucket sets the default bucket for resource types that don't specify a sync_bucket +func (c *ParallelSyncConfig) WithDefaultBucket(bucket string) *ParallelSyncConfig { + c.DefaultBucket = bucket + return c +} + +// task represents a unit of work for the parallel syncer +type task struct { + Action Action + ResourceID string + Priority int // Higher priority tasks are processed first + ResourceType *v2.ResourceType // The resource type for this task +} + +// TaskResult contains tasks that should be created after completing a task +type TaskResult struct { + Tasks []*task + Error error +} + +// DeferredTaskAdder collects tasks during processing and adds them after completion +type DeferredTaskAdder struct { + pendingTasks []*task + sync.RWMutex +} + +func NewDeferredTaskAdder() *DeferredTaskAdder { + return &DeferredTaskAdder{ + pendingTasks: make([]*task, 0), + } +} + +func (dta *DeferredTaskAdder) AddPendingTask(task *task) { + dta.Lock() + defer dta.Unlock() + dta.pendingTasks = append(dta.pendingTasks, task) +} + +func (dta *DeferredTaskAdder) GetPendingTasks() []*task { + dta.RLock() + defer dta.RUnlock() + return dta.pendingTasks +} + +func (dta *DeferredTaskAdder) Clear() { + dta.Lock() + defer dta.Unlock() + dta.pendingTasks = dta.pendingTasks[:0] // Reuse slice +} + +// taskQueue manages the distribution of tasks to workers using dynamic bucketing +type taskQueue struct { + bucketQueues map[string]chan *task // Map of bucket name to task channel + config *ParallelSyncConfig + mu sync.RWMutex + closed bool +} + +// newTaskQueue creates a new task queue +func newTaskQueue(config *ParallelSyncConfig) *taskQueue { + // Initialize with an empty map of bucket queues + // Buckets will be created dynamically as tasks are added + return &taskQueue{ + bucketQueues: make(map[string]chan *task), + config: config, + } +} + +func (q *taskQueue) getOrCreateBucketChannel(bucket string) (chan *task, error) { + q.mu.Lock() + defer q.mu.Unlock() + + if q.closed { + return nil, errors.New("task queue is closed") + } + + // Create the bucket queue if it doesn't exist + queue, exists := q.bucketQueues[bucket] + if !exists { + queueSize := q.config.WorkerCount * 10 + queue = make(chan *task, queueSize) + q.bucketQueues[bucket] = queue + } + + return queue, nil +} + +// AddTask adds a task to the appropriate queue +func (q *taskQueue) AddTask(ctx context.Context, t *task) error { + bucket := q.getBucketForTask(t) + queue, err := q.getOrCreateBucketChannel(bucket) + if err != nil { + return err + } + + // Add the task to the appropriate bucket queue with timeout + // This prevents indefinite blocking while still allowing graceful handling of full queues + timeout := 30 * time.Second + select { + case queue <- t: + // Log task addition for debugging + l := ctxzap.Extract(ctx) + l.Info("task added to queue", + zap.String("bucket", bucket), + zap.String("operation", t.Action.Op.String()), + zap.String("resource_type", t.Action.ResourceTypeID), + zap.Int("queue_length", len(queue))) + return nil + case <-time.After(timeout): + return errTaskQueueFull + case <-ctx.Done(): + return ctx.Err() + } +} + +// AddTaskWithTimeout adds a task with a custom timeout and dynamic queue expansion +func (q *taskQueue) AddTaskWithTimeout(ctx context.Context, t *task, timeout time.Duration) error { + bucket := q.getBucketForTask(t) + queue, err := q.getOrCreateBucketChannel(bucket) + if err != nil { + return err + } + + // Try to add the task + select { + case queue <- t: + return nil + case <-time.After(timeout): + // Queue is full, try to expand it + return q.expandQueueAndRetry(bucket, t, timeout) + case <-ctx.Done(): + return ctx.Err() + } +} + +// expandQueueAndRetry attempts to expand the queue and retry adding the task +func (q *taskQueue) expandQueueAndRetry(bucket string, t *task, timeout time.Duration) error { + q.mu.Lock() + defer q.mu.Unlock() + + if q.closed { + return errors.New("task queue is closed") + } + + l := ctxzap.Extract(context.Background()) + + // Get current queue + currentQueue := q.bucketQueues[bucket] + currentSize := cap(currentQueue) + currentLen := len(currentQueue) + + // Only expand if queue is nearly full + if currentLen < currentSize-1 { + return errTaskQueueFull + } + + // Calculate new size (double it, but cap at reasonable limit) + newSize := min(currentSize*2, 50000) // Cap at 50k tasks per bucket + + if newSize <= currentSize { + l.Warn("queue expansion blocked - already at maximum size", + zap.String("bucket", bucket), + zap.Int("current_size", currentSize)) + return errTaskQueueFull + } + + l.Info("expanding queue due to pressure", + zap.String("bucket", bucket), + zap.Int("old_size", currentSize), + zap.Int("new_size", newSize), + zap.Int("current_length", currentLen)) + + // Create new larger queue + newQueue := make(chan *task, newSize) + + // Copy existing tasks to new queue + for len(currentQueue) > 0 { + task := <-currentQueue + select { + case newQueue <- task: + default: + // This should never happen since new queue is larger + l.Error("failed to copy task to expanded queue") + return errTaskQueueFull + } + } + + // Replace the queue + q.bucketQueues[bucket] = newQueue + + // Try to add the new task + select { + case newQueue <- t: + return nil + default: + // This should never happen since we just expanded + l.Error("failed to add task to expanded queue") + return errTaskQueueFull + } +} + +// getBucketForTask determines the bucket for a task based on the resource type's sync_bucket +func (q *taskQueue) getBucketForTask(t *task) string { + // If the resource type has an explicit sync_bucket, use it + if t.ResourceType != nil && t.ResourceType.SyncBucket != "" { + return t.ResourceType.SyncBucket + } + + // If no explicit bucket and default is empty, create a unique bucket per resource type + if q.config.DefaultBucket == "" { + return fmt.Sprintf("resource-type-%s", t.Action.ResourceTypeID) + } + + // Otherwise use the configured default bucket + return q.config.DefaultBucket +} + +// GetTask retrieves the next task with intelligent bucket selection +func (q *taskQueue) GetTask(ctx context.Context) (*task, error) { + q.mu.Lock() // Use write lock to make the operation atomic + defer q.mu.Unlock() + + // Debug logging + l := ctxzap.Extract(ctx) + l.Debug("GetTask called", + zap.Int("total_buckets", len(q.bucketQueues)), + zap.Strings("bucket_names", getMapKeys(q.bucketQueues))) + + if len(q.bucketQueues) == 0 { + l.Debug("no buckets available") + return nil, errors.New("no buckets available") + } + + // First, try to find a bucket with available tasks + var availableBuckets []string + for bucketName, queue := range q.bucketQueues { + queueLen := len(queue) + l.Debug("checking bucket", zap.String("bucket", bucketName), zap.Int("queue_length", queueLen)) + if queueLen > 0 { + availableBuckets = append(availableBuckets, bucketName) + } + } + + l.Debug("available buckets", zap.Strings("buckets", availableBuckets)) + + if len(availableBuckets) == 0 { + l.Debug("no tasks available in any bucket") + return nil, errors.New("no tasks available") + } + + // Try to get a task from each available bucket in round-robin order + // Use a more robust approach that handles the case where a queue becomes empty + for _, bucketName := range availableBuckets { + queue := q.bucketQueues[bucketName] + + // Double-check the queue still has items before trying to read + if len(queue) == 0 { + l.Debug("bucket queue became empty", zap.String("bucket", bucketName)) + continue + } + + select { + case t := <-queue: + l.Debug("retrieved task from bucket", zap.String("bucket", bucketName)) + return t, nil + default: + l.Debug("bucket queue empty when trying to read", zap.String("bucket", bucketName)) + continue + } + } + + l.Debug("failed to get task from any available bucket") + return nil, errors.New("no tasks available") +} + +// getMapKeys returns the keys of a map as a slice +func getMapKeys(m map[string]chan *task) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + return keys +} + +// GetTaskFromBucket retrieves a task from a specific bucket +func (q *taskQueue) GetTaskFromBucket(bucketName string) (*task, error) { + q.mu.Lock() // Use write lock to make the operation atomic + defer q.mu.Unlock() + + queue, exists := q.bucketQueues[bucketName] + if !exists { + return nil, fmt.Errorf("bucket '%s' does not exist", bucketName) + } + + select { + case t := <-queue: + return t, nil + default: + return nil, errors.New("no tasks available in bucket") + } +} + +// GetBucketStats returns statistics about each bucket +func (q *taskQueue) GetBucketStats() map[string]int { + q.mu.RLock() + defer q.mu.RUnlock() + + stats := make(map[string]int) + for bucketName, queue := range q.bucketQueues { + stats[bucketName] = len(queue) + } + return stats +} + +// Close closes the task queue +func (q *taskQueue) Close() { + q.mu.Lock() + defer q.mu.Unlock() + + if !q.closed { + // Close all bucket queues + for _, queue := range q.bucketQueues { + close(queue) + } + q.closed = true + } +} + +// worker represents a worker goroutine that processes tasks +type worker struct { + id int + taskQueue *taskQueue + syncer *parallelSyncer + ctx context.Context + cancel context.CancelFunc + wg *sync.WaitGroup + rateLimited atomic.Bool + isProcessing atomic.Bool +} + +// newWorker creates a new worker +func newWorker(id int, taskQueue *taskQueue, syncer *parallelSyncer, ctx context.Context, wg *sync.WaitGroup) *worker { + workerCtx, cancel := context.WithCancel(ctx) + return &worker{ + id: id, + taskQueue: taskQueue, + syncer: syncer, + ctx: workerCtx, + cancel: cancel, + wg: wg, + } +} + +// Start starts the worker with bucket-aware task processing and work-stealing +func (w *worker) Start() { + defer w.wg.Done() + + l := ctxzap.Extract(w.ctx) + l.Debug("worker started", zap.Int("worker_id", w.id)) + + // Track which bucket this worker is currently working on + currentBucket := "" + consecutiveFailures := 0 + maxConsecutiveFailures := 3 + + for { + select { + case <-w.ctx.Done(): + l.Debug("worker stopped", zap.Int("worker_id", w.id)) + return + default: + + // Try to get a task, with preference for the current bucket if we're making progress + task, err := w.taskQueue.GetTask(w.ctx) + if err != nil { + // No tasks available, wait a bit + l.Debug("no tasks available, waiting", zap.Int("worker_id", w.id), zap.Error(err)) + time.Sleep(100 * time.Millisecond) + continue + } + l.Debug("worker got task", zap.Int("worker_id", w.id), zap.String("task_op", task.Action.Op.String())) + + // Track which bucket we're working on + taskBucket := w.taskQueue.getBucketForTask(task) + if taskBucket != currentBucket { + l.Debug("worker switching buckets", + zap.Int("worker_id", w.id), + zap.String("from_bucket", currentBucket), + zap.String("to_bucket", taskBucket)) + currentBucket = taskBucket + consecutiveFailures = 0 + } + + // Add detailed task information logging + l.Debug("processing task details", + zap.Int("worker_id", w.id), + zap.String("task_op", task.Action.Op.String()), + zap.String("resource_type", task.Action.ResourceTypeID), + zap.String("page_token", task.Action.PageToken), + zap.String("bucket", taskBucket)) + + // Set processing flag + w.isProcessing.Store(true) + + // Process the task + taskResult, err := w.processTask(task) + if err != nil { + + // Add pending tasks after task completion (even if failed, they might be valid) + if taskResult != nil && len(taskResult.Tasks) > 0 { + w.addTasksAfterCompletion(taskResult.Tasks) + } + l.Error("failed to process task", + zap.Int("worker_id", w.id), + zap.String("bucket", taskBucket), + zap.String("operation", task.Action.Op.String()), + zap.String("resource_type", task.Action.ResourceTypeID), + zap.Error(err)) + + consecutiveFailures++ + + // Check if this is a rate limit error + if w.isRateLimitError(err) { + w.rateLimited.Store(true) + + // If we're hitting rate limits in the current bucket, consider switching + if consecutiveFailures >= maxConsecutiveFailures { + l.Info("worker hitting rate limits in bucket, will try other buckets", + zap.Int("worker_id", w.id), + zap.String("bucket", taskBucket), + zap.Int("consecutive_failures", consecutiveFailures)) + + // Force bucket switch on next iteration + currentBucket = "" + consecutiveFailures = 0 + } + + // Wait before retrying with bucket-specific delay + delay := w.getBucketRateLimitDelay(taskBucket) + time.Sleep(delay) + } else { + // Non-rate-limit error, reset rate limit flag + w.rateLimited.Store(false) + } + } else { + // Task succeeded, add any pending tasks after completion + if taskResult != nil && len(taskResult.Tasks) > 0 { + w.addTasksAfterCompletion(taskResult.Tasks) + } + + // Reset failure counters + w.rateLimited.Store(false) + consecutiveFailures = 0 + } + + // Reset processing flag + w.isProcessing.Store(false) + } + } +} + +// processTask processes a single task and returns any tasks that should be created after completion +func (w *worker) processTask(t *task) (*TaskResult, error) { + ctx, span := parallelTracer.Start(w.ctx, "worker.processTask") + defer span.End() + + span.SetAttributes( + attribute.Int("worker_id", w.id), + attribute.String("operation", t.Action.Op.String()), + attribute.String("resource_type", t.Action.ResourceTypeID), + ) + + switch t.Action.Op { + case SyncResourcesOp: + tasks, err := w.syncer.syncResourcesCollectTasks(ctx, t.Action) + return &TaskResult{ + Tasks: tasks, + Error: err, + }, err + case SyncEntitlementsOp: + if t.Action.ResourceID != "" { + err := w.syncer.syncEntitlementsForResource(ctx, t.Action) + return &TaskResult{Tasks: []*task{}, Error: err}, err + } else { + err := w.syncer.syncEntitlementsForResourceType(ctx, t.Action) + return &TaskResult{Tasks: []*task{}, Error: err}, err + } + case SyncGrantsOp: + if t.Action.ResourceID != "" { + err := w.syncer.syncGrantsForResource(ctx, t.Action) + return &TaskResult{Tasks: []*task{}, Error: err}, err + } else { + err := w.syncer.syncGrantsForResourceType(ctx, t.Action) + return &TaskResult{Tasks: []*task{}, Error: err}, err + } + case CollectEntitlementsAndGrantsTasksOp: + tasks, err := w.syncer.collectEntitlementsAndGrantsTasks(ctx, t.Action) + return &TaskResult{ + Tasks: tasks, + Error: err, + }, err + default: + return nil, fmt.Errorf("unsupported operation: %s", t.Action.Op.String()) + } +} + +// isRateLimitError checks if an error is a rate limit error +func (w *worker) isRateLimitError(err error) bool { + // Check for rate limit annotations in the error + if err == nil { + return false + } + + // This is a simplified check - in practice, you'd want to check the actual + // error type returned by the connector for rate limiting + return status.Code(err) == codes.ResourceExhausted || + errors.Is(err, sql.ErrConnDone) // Placeholder for rate limit detection +} + +// getBucketRateLimitDelay returns the appropriate delay for a bucket based on rate limiting +func (w *worker) getBucketRateLimitDelay(bucket string) time.Duration { + // Different buckets can have different rate limit delays + // This allows for bucket-specific rate limiting strategies + + switch { + case strings.Contains(bucket, "rate-limited"): + return 2 * time.Second // Longer delay for rate-limited buckets + case strings.Contains(bucket, "fast-apis"): + return 100 * time.Millisecond // Shorter delay for fast APIs + default: + return 1 * time.Second // Default delay + } +} + +// Stop stops the worker +func (w *worker) Stop() { + w.cancel() +} + +// parallelSyncer extends the base syncer with parallel processing capabilities +type parallelSyncer struct { + syncer *SequentialSyncer + config *ParallelSyncConfig + taskQueue *taskQueue + workers []*worker + workerWg sync.WaitGroup + mu sync.RWMutex +} + +// NewParallelSyncer creates a new parallel syncer +func NewParallelSyncer(baseSyncer *SequentialSyncer, config *ParallelSyncConfig) *parallelSyncer { + if config == nil { + config = DefaultParallelSyncConfig() + } + + // Enable WAL checkpointing for parallel sync to prevent checkpoint failures under high concurrency + baseSyncer.enableWALCheckpoint = true + + return ¶llelSyncer{ + syncer: baseSyncer, + config: config, + } +} + +// Sync implements the Syncer interface using parallel processing +func (ps *parallelSyncer) Sync(ctx context.Context) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.Sync") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Initialize the sync + if err := ps.initializeSync(ctx); err != nil { + return err + } + + // Create task queue + ps.taskQueue = newTaskQueue(ps.config) + defer ps.taskQueue.Close() + + // Start workers + if err := ps.startWorkers(ctx); err != nil { + return err + } + defer ps.stopWorkers() + + // Generate initial tasks + if err := ps.generateInitialTasks(ctx); err != nil { + return err + } + + // Wait for all tasks to complete + if err := ps.waitForCompletion(ctx); err != nil { + return err + } + + // Now that all parallel processing is complete, run grant expansion sequentially + if err := ps.syncGrantExpansion(ctx); err != nil { + l.Error("failed to run grant expansion", zap.Error(err)) + return fmt.Errorf("failed to run grant expansion: %w", err) + } + + // Run external resources sync if configured + if ps.syncer.externalResourceReader != nil { + if err := ps.syncExternalResources(ctx); err != nil { + l.Error("failed to run external resources sync", zap.Error(err)) + return fmt.Errorf("failed to run external resources sync: %w", err) + } + } + + // Finalize sync + if err := ps.finalizeSync(ctx); err != nil { + return err + } + + return nil +} + +// initializeSync performs the initial sync setup +func (ps *parallelSyncer) initializeSync(ctx context.Context) error { + // Load store and validate connector (reuse existing logic) + if err := ps.syncer.loadStore(ctx); err != nil { + return err + } + + _, err := ps.syncer.connector.Validate(ctx, &v2.ConnectorServiceValidateRequest{}) + if err != nil { + return err + } + + // Start or resume sync + _, _, err = ps.syncer.startOrResumeSync(ctx) + if err != nil { + return err + } + + // Set up state + currentStep, err := ps.syncer.store.CurrentSyncStep(ctx) + if err != nil { + return err + } + + state := &state{} + if err := state.Unmarshal(currentStep); err != nil { + return err + } + ps.syncer.state = state + + // Set progress counts to parallel mode for thread safety + if ps.syncer.counts != nil { + ps.syncer.counts.SetSequentialMode(false) + } + + return nil +} + +// startWorkers starts all worker goroutines +func (ps *parallelSyncer) startWorkers(ctx context.Context) error { + ps.workers = make([]*worker, ps.config.WorkerCount) + + for i := 0; i < ps.config.WorkerCount; i++ { + worker := newWorker(i, ps.taskQueue, ps, ctx, &ps.workerWg) + ps.workers[i] = worker + ps.workerWg.Add(1) + go worker.Start() + } + + return nil +} + +// stopWorkers stops all workers +func (ps *parallelSyncer) stopWorkers() { + for _, worker := range ps.workers { + worker.Stop() + } + ps.workerWg.Wait() +} + +// areWorkersIdle checks if all workers are currently idle (not processing tasks) +func (ps *parallelSyncer) areWorkersIdle() bool { + ps.mu.RLock() + defer ps.mu.RUnlock() + + for _, worker := range ps.workers { + if worker.isProcessing.Load() { + return false + } + } + return true +} + +// generateInitialTasks creates the initial set of tasks following the original sync workflow +func (ps *parallelSyncer) generateInitialTasks(ctx context.Context) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.generateInitialTasks") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Follow the exact same workflow as the original sync + // 1. Start with resource types + // 2. Then resources for each resource type (sequentially within each resource type) + // 3. Then entitlements for each resource type (sequentially within each resource type) + // 4. Then grants for each resource type (sequentially within each resource type) + // 5. Then grant expansion and external resources + + // First, sync resource types + if err := ps.syncResourceTypes(ctx); err != nil { + l.Error("failed to sync resource types", zap.Error(err)) + return err + } + + // Get all resource types and create resource sync tasks + resp, err := ps.syncer.store.ListResourceTypes(ctx, &v2.ResourceTypesServiceListResourceTypesRequest{}) + if err != nil { + l.Error("failed to list resource types", zap.Error(err)) + return err + } + + // Group resource types by their buckets for better task organization + bucketGroups := make(map[string][]*v2.ResourceType) + for _, rt := range resp.List { + bucket := ps.getBucketForResourceType(rt) + bucketGroups[bucket] = append(bucketGroups[bucket], rt) + } + + // Create tasks for each bucket, ensuring sequential processing within each bucket + for _, resourceTypes := range bucketGroups { + l := ctxzap.Extract(ctx) + + // Create tasks for this bucket + for _, rt := range resourceTypes { + // Create task to sync resources for this resource type + task := &task{ + Action: Action{ + Op: SyncResourcesOp, + ResourceTypeID: rt.Id, + }, + Priority: 1, + ResourceType: rt, // Include the resource type for bucket determination + } + + if err := ps.addTaskWithRetry(ctx, task, taskRetryLimit); err != nil { + l.Error("failed to add resource sync task", zap.Error(err)) + return fmt.Errorf("failed to add resource sync task for resource type %s: %w", rt.Id, err) + } + } + } + + // Note: Grant expansion and external resources tasks are NOT added here + // They are added after ALL resource types are completely processed + // This ensures the correct order: resources → entitlements → grants → grant expansion → external resources + + return nil +} + +// getBucketForResourceType determines the bucket for a resource type +func (ps *parallelSyncer) getBucketForResourceType(rt *v2.ResourceType) string { + // If the resource type has an explicit sync_bucket, use it + if rt.SyncBucket != "" { + return rt.SyncBucket + } + + // If no explicit bucket and default is empty, create a unique bucket per resource type + if ps.config.DefaultBucket == "" { + return fmt.Sprintf("resource-type-%s", rt.Id) + } + + // Otherwise use the configured default bucket + return ps.config.DefaultBucket +} + +// waitForCompletion waits for all tasks to complete with bucket-aware monitoring +func (ps *parallelSyncer) waitForCompletion(ctx context.Context) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.waitForCompletion") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Monitor task completion with periodic status updates + ticker := time.NewTicker(5 * time.Second) + defer ticker.Stop() + + lastTaskCount := 0 + noProgressCount := 0 + maxNoProgressCount := 6 // 30 seconds without progress + + for { + select { + case <-ctx.Done(): + return ctx.Err() + case <-ticker.C: + // Get current bucket statistics + bucketStats := ps.taskQueue.GetBucketStats() + totalTasks := 0 + for _, count := range bucketStats { + totalTasks += count + } + + // Log progress + if len(bucketStats) > 0 { + // Debug: Log which buckets still have active tasks + activeBuckets := make([]string, 0) + for bucketName, taskCount := range bucketStats { + if taskCount > 0 && bucketName != "resource-type-" { + activeBuckets = append(activeBuckets, fmt.Sprintf("%s:%d", bucketName, taskCount)) + } + } + } + + // Check if we're making progress + if totalTasks == lastTaskCount { + noProgressCount++ + if noProgressCount >= maxNoProgressCount { + l.Warn("no task progress detected", + zap.Int("no_progress_count", noProgressCount), + zap.Int("last_task_count", lastTaskCount), + zap.Int("total_tasks", totalTasks)) + } + } else { + noProgressCount = 0 + lastTaskCount = totalTasks + } + + // Check if all resource-specific tasks are complete + // We need to ensure ALL resource types have finished processing + if totalTasks == 0 { + // Double-check that we're truly done with resource processing + // Look for any active resource processing in the bucket stats + allResourceProcessingComplete := true + for bucketName, taskCount := range bucketStats { + // Skip the default bucket (used for final tasks) + if bucketName == "resource-type-" { + continue + } + if taskCount > 0 { + allResourceProcessingComplete = false + break + } + } + + if allResourceProcessingComplete { + // Additional safety check: wait a bit more to ensure workers are truly idle + time.Sleep(2 * time.Second) + + // Check one more time to ensure no new tasks appeared + finalBucketStats := ps.taskQueue.GetBucketStats() + finalTotalTasks := 0 + for _, count := range finalBucketStats { + finalTotalTasks += count + } + + if finalTotalTasks == 0 { + // Final check: ensure all workers are actually idle + if ps.areWorkersIdle() { + return nil + } else { + // Reset progress counters since we're not done yet + noProgressCount = 0 + lastTaskCount = finalTotalTasks + } + } else { + // Reset progress counters since we're not done yet + noProgressCount = 0 + lastTaskCount = finalTotalTasks + } + } + } + } + } +} + +// syncGrantExpansion handles grant expansion by delegating to the base syncer +func (ps *parallelSyncer) syncGrantExpansion(ctx context.Context) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantExpansion") + defer span.End() + + // The base syncer's SyncGrantExpansion expects to have actions in its state stack + // We need to set up the proper state context before calling it + ps.syncer.state.PushAction(ctx, Action{ + Op: SyncGrantExpansionOp, + }) + + for { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + currentAction := ps.syncer.state.Current() + if currentAction == nil || currentAction.Op != SyncGrantExpansionOp { + break + } + + // Delegate to the base syncer's grant expansion logic + // This ensures we get the exact same behavior as the sequential sync + err := ps.syncer.SyncGrantExpansion(ctx) + if err != nil { + return err + } + } + + return nil +} + +// syncExternalResources handles external resources by delegating to the base syncer +func (ps *parallelSyncer) syncExternalResources(ctx context.Context) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncExternalResources") + defer span.End() + + // The base syncer's SyncExternalResources expects to have actions in its state stack + // We need to set up the proper state context before calling it + ps.syncer.state.PushAction(ctx, Action{ + Op: SyncExternalResourcesOp, + }) + + // Delegate to the base syncer's external resources logic + // This ensures we get the exact same behavior as the sequential sync + err := ps.syncer.SyncExternalResources(ctx) + + // Clean up the state + ps.syncer.state.FinishAction(ctx) + + return err +} + +// finalizeSync performs final sync cleanup +func (ps *parallelSyncer) finalizeSync(ctx context.Context) error { + // End sync + if err := ps.syncer.store.EndSync(ctx); err != nil { + return err + } + + // Cleanup + if err := ps.syncer.store.Cleanup(ctx); err != nil { + return err + } + + _, err := ps.syncer.connector.Cleanup(ctx, &v2.ConnectorServiceCleanupRequest{}) + if err != nil { + ctxzap.Extract(ctx).Error("error clearing connector caches", zap.Error(err)) + } + + return nil +} + +// syncResourceTypes syncs resource types (equivalent to SyncResourceTypes) +func (ps *parallelSyncer) syncResourceTypes(ctx context.Context) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncResourceTypes") + defer span.End() + + // This replicates the exact logic from the original SyncResourceTypes + resp, err := ps.syncer.connector.ListResourceTypes(ctx, &v2.ResourceTypesServiceListResourceTypesRequest{}) + if err != nil { + return err + } + + err = ps.syncer.store.PutResourceTypes(ctx, resp.List...) + if err != nil { + return err + } + + ps.syncer.counts.AddResourceTypes(len(resp.List)) + + return nil +} + +// syncResources processes resources for a specific resource type (equivalent to SyncResources) +func (ps *parallelSyncer) syncResources(ctx context.Context, action Action) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncResources") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Add panic recovery to catch any unexpected errors + defer func() { + if r := recover(); r != nil { + l.Error("panic in syncResources", + zap.String("resource_type", action.ResourceTypeID), + zap.Any("panic", r)) + } + }() + + // This replicates the exact logic from the original SyncResources + req := &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: action.ResourceTypeID, + PageToken: action.PageToken, + } + + // If this is a child resource task, set the parent resource ID + if action.ParentResourceID != "" { + req.ParentResourceId = &v2.ResourceId{ + ResourceType: action.ParentResourceTypeID, + Resource: action.ParentResourceID, + } + } + + resp, err := ps.syncer.connector.ListResources(ctx, req) + if err != nil { + l.Error("failed to list resources", zap.Error(err)) + return err + } + + // Store resources + if len(resp.List) > 0 { + err = ps.syncer.store.PutResources(ctx, resp.List...) + if err != nil { + l.Error("failed to store resources", zap.Error(err)) + return err + } + } + + // Update progress counts + resourceTypeId := action.ResourceTypeID + ps.syncer.counts.AddResources(resourceTypeId, len(resp.List)) + + // Log progress + if len(resp.List) > 0 { + ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) + } else { + // Even with no resources, we should log progress + ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) + } + + // Process each resource (handle sub-resources) + for _, r := range resp.List { + // Use the base syncer's getSubResources method + if err := ps.syncer.getSubResources(ctx, r); err != nil { + l.Error("failed to process sub-resources", zap.Error(err)) + return err + } + } + + // Handle pagination - if there are more pages, create a task for the next page + if resp.NextPageToken != "" { + nextPageTask := &task{ + Action: Action{ + Op: SyncResourcesOp, + ResourceTypeID: action.ResourceTypeID, + PageToken: resp.NextPageToken, + }, + Priority: 1, + } + + if err := ps.addTaskWithRetry(ctx, nextPageTask, taskRetryLimit); err != nil { + return fmt.Errorf("failed to add next page task for resource type %s: %w", action.ResourceTypeID, err) + } + + return nil // Don't create entitlement/grant tasks yet, wait for all pages + } + + // Get all resources for this resource type to create individual tasks + allResourcesResp, err := ps.syncer.store.ListResources(ctx, &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: action.ResourceTypeID, + PageToken: "", + }) + if err != nil { + l.Error("failed to list resources for task creation", zap.Error(err)) + return err + } + // Check if this resource type has child resource types that need to be processed + // We need to process child resources before entitlements and grants + if err := ps.processChildResourceTypes(ctx, action.ResourceTypeID); err != nil { + l.Error("failed to process child resource types", zap.Error(err)) + return err + } + + // Create individual tasks for each resource's entitlements and grants + for _, resource := range allResourcesResp.List { + // Check if we should skip entitlements and grants for this resource + shouldSkip, err := ps.shouldSkipEntitlementsAndGrants(ctx, resource) + if err != nil { + l.Error("failed to check if resource should be skipped", zap.Error(err)) + return err + } + if shouldSkip { + continue + } + + // Create task to sync entitlements for this specific resource + entitlementsTask := &task{ + Action: Action{ + Op: SyncEntitlementsOp, + ResourceTypeID: action.ResourceTypeID, + ResourceID: resource.Id.Resource, + }, + Priority: 2, + } + + if err := ps.addTaskWithRetry(ctx, entitlementsTask, taskRetryLimit); err != nil { + return fmt.Errorf("failed to add entitlements task for resource %s: %w", resource.Id.Resource, err) + } + + // Create task to sync grants for this specific resource + grantsTask := &task{ + Action: Action{ + Op: SyncGrantsOp, + ResourceTypeID: action.ResourceTypeID, + ResourceID: resource.Id.Resource, + }, + Priority: 3, + } + + if err := ps.addTaskWithRetry(ctx, grantsTask, taskRetryLimit); err != nil { + l.Error("failed to add grants task", zap.Error(err)) + return fmt.Errorf("failed to add grants task for resource %s: %w", resource.Id.Resource, err) + } + } + + return nil +} + +// syncResourcesCollectTasks does the same work as syncResources but collects tasks instead of adding them immediately +func (ps *parallelSyncer) syncResourcesCollectTasks(ctx context.Context, action Action) ([]*task, error) { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncResourcesCollectTasks") + defer span.End() + + l := ctxzap.Extract(ctx) + var collectedTasks []*task + + // Add panic recovery to catch any unexpected errors + defer func() { + if r := recover(); r != nil { + l.Error("panic in syncResourcesCollectTasks", + zap.String("resource_type", action.ResourceTypeID), + zap.Any("panic", r)) + } + }() + + // This replicates the exact logic from the original SyncResources + req := &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: action.ResourceTypeID, + PageToken: action.PageToken, + } + + // If this is a child resource task, set the parent resource ID + if action.ParentResourceID != "" { + req.ParentResourceId = &v2.ResourceId{ + ResourceType: action.ParentResourceTypeID, + Resource: action.ParentResourceID, + } + } + + resp, err := ps.syncer.connector.ListResources(ctx, req) + if err != nil { + l.Error("failed to list resources", zap.Error(err)) + return nil, err + } + + // Store resources + if len(resp.List) > 0 { + err = ps.syncer.store.PutResources(ctx, resp.List...) + if err != nil { + l.Error("failed to store resources", zap.Error(err)) + return nil, err + } + } + + // Update progress counts + resourceTypeId := action.ResourceTypeID + ps.syncer.counts.AddResources(resourceTypeId, len(resp.List)) + + // Log progress + if len(resp.List) > 0 { + ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) + } else { + ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) + } + + // Process each resource (handle sub-resources) + for _, r := range resp.List { + if err := ps.syncer.getSubResources(ctx, r); err != nil { + l.Error("failed to process sub-resources", zap.Error(err)) + return nil, err + } + } + + // Handle pagination - if there are more pages, collect the task for next page + if resp.NextPageToken != "" { + nextPageTask := &task{ + Action: Action{ + Op: SyncResourcesOp, + ResourceTypeID: action.ResourceTypeID, + PageToken: resp.NextPageToken, + }, + Priority: 1, + } + collectedTasks = append(collectedTasks, nextPageTask) + return collectedTasks, nil // Don't create entitlement/grant tasks yet, wait for all pages + } + + // Check if this resource type has child resource types that need to be processed + if err := ps.processChildResourceTypes(ctx, action.ResourceTypeID); err != nil { + l.Error("failed to process child resource types", zap.Error(err)) + return nil, err + } + + actionForEntitlementsAndGrants := Action{ + Op: CollectEntitlementsAndGrantsTasksOp, + ResourceTypeID: action.ResourceTypeID, + PageToken: "", + } + entitlementsAndGrantsTasks, err := ps.collectEntitlementsAndGrantsTasks(ctx, actionForEntitlementsAndGrants) + if err != nil { + l.Error("failed to collect entitlements and grants tasks", zap.Error(err)) + return nil, err + } + + collectedTasks = append(collectedTasks, entitlementsAndGrantsTasks...) + + return collectedTasks, nil +} + +// syncResourcesCollectTasks does the same work as syncResources but collects tasks instead of adding them immediately +func (ps *parallelSyncer) collectEntitlementsAndGrantsTasks(ctx context.Context, action Action) ([]*task, error) { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.collectEntitlementsAndGrantsTasks") + defer span.End() + + l := ctxzap.Extract(ctx) + var collectedTasks []*task + + // Add panic recovery to catch any unexpected errors + defer func() { + if r := recover(); r != nil { + l.Error("panic in collectEntitlementsAndGrantsTasks", + zap.String("resource_type", action.ResourceTypeID), + zap.Any("panic", r)) + } + }() + + allResourcesResp, err := ps.syncer.store.ListResources(ctx, &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: action.ResourceTypeID, + PageToken: action.PageToken, + }) + if err != nil { + l.Error("failed to list resources for task creation", zap.Error(err)) + return nil, err + } + + // Create individual tasks for each resource's entitlements and grants + for _, resource := range allResourcesResp.List { + // Check if we should skip entitlements and grants for this resource + shouldSkip, err := ps.shouldSkipEntitlementsAndGrants(ctx, resource) + if err != nil { + l.Error("failed to check if resource should be skipped", zap.Error(err)) + return nil, err + } + if shouldSkip { + continue + } + + // Create task to sync entitlements for this specific resource + entitlementsTask := &task{ + Action: Action{ + Op: SyncEntitlementsOp, + ResourceTypeID: action.ResourceTypeID, + ResourceID: resource.Id.Resource, + }, + Priority: 2, + } + collectedTasks = append(collectedTasks, entitlementsTask) + + // Create task to sync grants for this specific resource + grantsTask := &task{ + Action: Action{ + Op: SyncGrantsOp, + ResourceTypeID: action.ResourceTypeID, + ResourceID: resource.Id.Resource, + }, + Priority: 3, + } + collectedTasks = append(collectedTasks, grantsTask) + } + if allResourcesResp.NextPageToken != "" { + collectedTasks = append(collectedTasks, &task{ + Action: Action{ + Op: CollectEntitlementsAndGrantsTasksOp, + ResourceTypeID: action.ResourceTypeID, + PageToken: allResourcesResp.NextPageToken, + }, + Priority: 3, + }) + } + + return collectedTasks, nil +} + +// processChildResourceTypes processes child resource types for a given parent resource type +func (ps *parallelSyncer) processChildResourceTypes(ctx context.Context, parentResourceTypeID string) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.processChildResourceTypes") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Get all resources of the parent resource type + resp, err := ps.syncer.store.ListResources(ctx, &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: parentResourceTypeID, + PageToken: "", + }) + if err != nil { + l.Error("failed to list parent resources", zap.Error(err)) + return err + } + + // For each parent resource, check if it has child resource types + for _, parentResource := range resp.List { + if err := ps.processChildResourcesForParent(ctx, parentResource); err != nil { + l.Error("failed to process child resources for parent", + zap.Error(err), + zap.String("parent_resource_id", parentResource.Id.Resource), + zap.String("parent_resource_type", parentResource.Id.ResourceType)) + return err + } + } + + return nil +} + +// processChildResourcesForParent processes child resources for a specific parent resource +func (ps *parallelSyncer) processChildResourcesForParent(ctx context.Context, parentResource *v2.Resource) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.processChildResourcesForParent") + defer span.End() + + // Check for ChildResourceType annotations + for _, annotation := range parentResource.Annotations { + var childResourceType v2.ChildResourceType + if err := annotation.UnmarshalTo(&childResourceType); err != nil { + // Not a ChildResourceType annotation, skip + continue + } + + childResourceTypeID := childResourceType.ResourceTypeId + + // Create a task to sync child resources for this parent + childResourcesTask := &task{ + Action: Action{ + Op: SyncResourcesOp, + ResourceTypeID: childResourceTypeID, + ParentResourceTypeID: parentResource.Id.ResourceType, + ParentResourceID: parentResource.Id.Resource, + }, + Priority: 1, // Lower priority than parent resources + } + + if err := ps.addTaskWithRetry(ctx, childResourcesTask, taskRetryLimit); err != nil { + return fmt.Errorf("failed to add child resources task for %s under parent %s: %w", + childResourceTypeID, parentResource.Id.Resource, err) + } + } + + return nil +} + +// syncEntitlementsForResourceType processes entitlements for all resources of a resource type +func (ps *parallelSyncer) syncEntitlementsForResourceType(ctx context.Context, action Action) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncEntitlementsForResourceType") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Get all resources for this resource type + resp, err := ps.syncer.store.ListResources(ctx, &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: action.ResourceTypeID, + PageToken: action.PageToken, + }) + if err != nil { + l.Error("failed to list resources for entitlements", zap.Error(err)) + return err + } + + // Process each resource's entitlements sequentially + for _, r := range resp.List { + // Check if we should skip entitlements for this resource + shouldSkip, err := ps.shouldSkipEntitlementsAndGrants(ctx, r) + if err != nil { + return err + } + if shouldSkip { + continue + } + + // Create local state context for this resource + localState := NewLocalStateContext(r.Id) + + // Use our state-agnostic method to sync entitlements for this specific resource + decision, err := ps.syncEntitlementsForResourceLogic(ctx, r.Id, localState) + if err != nil { + l.Error("failed to sync entitlements for resource", + zap.String("resource_type", r.Id.ResourceType), + zap.String("resource_id", r.Id.Resource), + zap.Error(err)) + return err + } + + // Handle pagination if needed + for decision.ShouldContinue && decision.Action == "next_page" { + + // Update the local state with the new page token before continuing + if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { + l.Error("failed to update local state with next page token", + zap.String("resource_type", r.Id.ResourceType), + zap.String("page_token", decision.NextPageToken), + zap.Error(err)) + return err + } + + // Continue with next page + decision, err = ps.syncEntitlementsForResourceLogic(ctx, r.Id, localState) + if err != nil { + l.Error("failed to sync entitlements for resource on next page", + zap.String("resource_type", r.Id.ResourceType), + zap.String("resource_id", r.Id.Resource), + zap.Error(err)) + return err + } + } + } + + return nil +} + +// syncEntitlementsForResource processes entitlements for a specific resource +func (ps *parallelSyncer) syncEntitlementsForResource(ctx context.Context, action Action) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncEntitlementsForResource") + defer span.End() + + l := ctxzap.Extract(ctx) + // Create resource ID from action + resourceID := &v2.ResourceId{ + ResourceType: action.ResourceTypeID, + Resource: action.ResourceID, + } + + // Create local state context for this resource + localState := NewLocalStateContext(resourceID) + + // Use existing logic but for single resource + decision, err := ps.syncEntitlementsForResourceLogic(ctx, resourceID, localState) + if err != nil { + l.Error("failed to sync entitlements for resource", + zap.String("resource_type", action.ResourceTypeID), + zap.String("resource_id", action.ResourceID), + zap.Error(err)) + return err + } + + // Handle pagination if needed + for decision.ShouldContinue && decision.Action == "next_page" { + // Update the local state with the new page token before continuing + if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { + l.Error("failed to update local state with next page token", + zap.String("resource_type", action.ResourceTypeID), + zap.String("resource_id", action.ResourceID), + zap.String("page_token", decision.NextPageToken), + zap.Error(err)) + return err + } + + // Continue with next page + decision, err = ps.syncEntitlementsForResourceLogic(ctx, resourceID, localState) + if err != nil { + l.Error("failed to sync entitlements for resource on next page", + zap.String("resource_type", action.ResourceTypeID), + zap.String("resource_id", action.ResourceID), + zap.Error(err)) + return err + } + } + + return nil +} + +// syncGrantsForResource processes grants for a specific resource +func (ps *parallelSyncer) syncGrantsForResource(ctx context.Context, action Action) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantsForResource") + defer span.End() + + l := ctxzap.Extract(ctx) + // Create resource ID from action + resourceID := &v2.ResourceId{ + ResourceType: action.ResourceTypeID, + Resource: action.ResourceID, + } + + // Create local state context for this resource + localState := NewLocalStateContext(resourceID) + + // Use existing logic but for single resource + decision, err := ps.syncGrantsForResourceLogic(ctx, resourceID, localState) + if err != nil { + l.Error("failed to sync grants for resource", + zap.String("resource_type", action.ResourceTypeID), + zap.String("resource_id", action.ResourceID), + zap.Error(err)) + return err + } + + // Handle pagination if needed + for decision.ShouldContinue && decision.Action == "next_page" { + // Update the local state with the new page token before continuing + if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { + l.Error("failed to update local state with next page token", + zap.String("resource_type", action.ResourceTypeID), + zap.String("resource_id", action.ResourceID), + zap.String("page_token", decision.NextPageToken), + zap.Error(err)) + return err + } + + // Continue with next page + decision, err = ps.syncGrantsForResourceLogic(ctx, resourceID, localState) + if err != nil { + l.Error("failed to sync grants for resource on next page", + zap.String("resource_type", action.ResourceTypeID), + zap.String("resource_id", action.ResourceID), + zap.Error(err)) + return err + } + } + + return nil +} + +// syncGrantsForResourceType processes grants for all resources of a resource type +func (ps *parallelSyncer) syncGrantsForResourceType(ctx context.Context, action Action) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantsForResourceType") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Get all resources for this resource type + resp, err := ps.syncer.store.ListResources(ctx, &v2.ResourcesServiceListResourcesRequest{ + ResourceTypeId: action.ResourceTypeID, + PageToken: action.PageToken, + }) + if err != nil { + l.Error("failed to list resources for grants", zap.Error(err)) + return err + } + + // Process each resource's grants sequentially + for _, r := range resp.List { + // Check if we should skip grants for this resource + shouldSkip, err := ps.shouldSkipEntitlementsAndGrants(ctx, r) + if err != nil { + return err + } + if shouldSkip { + continue + } + + // Create local state context for this resource + localState := NewLocalStateContext(r.Id) + + // Use our state-agnostic method to sync grants for this specific resource + decision, err := ps.syncGrantsForResourceLogic(ctx, r.Id, localState) + if err != nil { + l.Error("failed to sync grants for resource", + zap.String("resource_type", r.Id.ResourceType), + zap.String("resource_id", r.Id.Resource), + zap.Error(err)) + return err + } + + // Handle pagination if needed + for decision.ShouldContinue && decision.Action == "next_page" { + // Update the local state with the new page token before continuing + if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { + l.Error("failed to update local state with next page token", + zap.String("resource_type", r.Id.ResourceType), + zap.String("resource_id", r.Id.Resource), + zap.String("page_token", decision.NextPageToken), + zap.Error(err)) + return err + } + + // Continue with next page + decision, err = ps.syncGrantsForResourceLogic(ctx, r.Id, localState) + if err != nil { + l.Error("failed to sync grants for resource on next page", + zap.String("resource_type", r.Id.ResourceType), + zap.String("resource_id", r.Id.Resource), + zap.Error(err)) + return err + } + } + } + + return nil +} + +// syncGrantsForResourceLogic contains the core logic for syncing grants for a resource +// This method is state-agnostic and returns an ActionDecision for the caller to handle +func (ps *parallelSyncer) syncGrantsForResourceLogic(ctx context.Context, resourceID *v2.ResourceId, state StateInterface) (*ActionDecision, error) { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantsForResourceLogic") + defer span.End() + + l := ctxzap.Extract(ctx) + + // Get the resource from the store + resourceResponse, err := ps.syncer.store.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ + ResourceId: resourceID, + }) + if err != nil { + return nil, fmt.Errorf("error fetching resource '%s': %w", resourceID.Resource, err) + } + + resource := resourceResponse.Resource + + var prevSyncID string + var prevEtag *v2.ETag + var etagMatch bool + var grants []*v2.Grant + + resourceAnnos := annotations.Annotations(resource.GetAnnotations()) + pageToken := state.PageToken(ctx) + + prevSyncID, prevEtag, err = ps.syncer.fetchResourceForPreviousSync(ctx, resourceID) + if err != nil { + return nil, err + } + resourceAnnos.Update(prevEtag) + resource.Annotations = resourceAnnos + + resp, err := ps.syncer.connector.ListGrants(ctx, &v2.GrantsServiceListGrantsRequest{Resource: resource, PageToken: pageToken}) + if err != nil { + return nil, err + } + + // Fetch any etagged grants for this resource + var etaggedGrants []*v2.Grant + etaggedGrants, etagMatch, err = ps.syncer.fetchEtaggedGrantsForResource(ctx, resource, prevEtag, prevSyncID, resp) + if err != nil { + return nil, err + } + grants = append(grants, etaggedGrants...) + + // We want to process any grants from the previous sync first so that if there is a conflict, the newer data takes precedence + grants = append(grants, resp.List...) + + // Process grants and collect state information + needsExpansion := false + hasExternalResources := false + shouldFetchRelated := state.ShouldFetchRelatedResources() + + for _, grant := range grants { + grantAnnos := annotations.Annotations(grant.GetAnnotations()) + if grantAnnos.Contains(&v2.GrantExpandable{}) { + needsExpansion = true + state.SetNeedsExpansion() + } + if grantAnnos.ContainsAny(&v2.ExternalResourceMatchAll{}, &v2.ExternalResourceMatch{}, &v2.ExternalResourceMatchID{}) { + hasExternalResources = true + state.SetHasExternalResourcesGrants() + } + + if !shouldFetchRelated { + continue + } + // Some connectors emit grants for other resources. If we're doing a partial sync, check if it exists and queue a fetch if not. + entitlementResource := grant.GetEntitlement().GetResource() + _, err := ps.syncer.store.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ + ResourceId: entitlementResource.GetId(), + }) + if err != nil { + if !errors.Is(err, sql.ErrNoRows) { + return nil, err + } + + erId := entitlementResource.GetId() + prId := entitlementResource.GetParentResourceId() + resource, err := ps.syncer.getResourceFromConnector(ctx, erId, prId) + if err != nil { + l.Error("error fetching entitlement resource", zap.Error(err)) + return nil, err + } + if resource == nil { + continue + } + if err := ps.syncer.store.PutResources(ctx, resource); err != nil { + return nil, err + } + } + } + + // Store the grants + err = ps.syncer.store.PutGrants(ctx, grants...) + if err != nil { + return nil, err + } + + // Update progress counts + ps.syncer.counts.AddGrantsProgress(resourceID.ResourceType, 1) + ps.syncer.counts.LogGrantsProgress(ctx, resourceID.ResourceType) + + // We may want to update the etag on the resource. If we matched a previous etag, then we should use that. + // Otherwise, we should use the etag from the response if provided. + var updatedETag *v2.ETag + + if etagMatch { + updatedETag = prevEtag + } else { + newETag := &v2.ETag{} + respAnnos := annotations.Annotations(resp.GetAnnotations()) + ok, err := respAnnos.Pick(newETag) + if err != nil { + return nil, err + } + if ok { + updatedETag = newETag + } + } + + if updatedETag != nil { + resourceAnnos.Update(updatedETag) + resource.Annotations = resourceAnnos + err = ps.syncer.store.PutResources(ctx, resource) + if err != nil { + return nil, err + } + } + + // Check if we need to continue with pagination + if resp.NextPageToken != "" { + return &ActionDecision{ + ShouldContinue: true, + NextPageToken: resp.NextPageToken, + Action: "next_page", + NeedsExpansion: needsExpansion, + HasExternalResources: hasExternalResources, + ShouldFetchRelated: shouldFetchRelated, + }, nil + } + + // No more pages, action is complete + return &ActionDecision{ + ShouldContinue: false, + Action: "finish", + NeedsExpansion: needsExpansion, + HasExternalResources: hasExternalResources, + ShouldFetchRelated: shouldFetchRelated, + }, nil +} + +// syncEntitlementsForResourceLogic contains the core logic for syncing entitlements for a resource +// This method is state-agnostic and returns an ActionDecision for the caller to handle +func (ps *parallelSyncer) syncEntitlementsForResourceLogic(ctx context.Context, resourceID *v2.ResourceId, state StateInterface) (*ActionDecision, error) { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncEntitlementsForResourceLogic") + defer span.End() + + // Get the resource from the store + resourceResponse, err := ps.syncer.store.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ + ResourceId: resourceID, + }) + if err != nil { + return nil, fmt.Errorf("error fetching resource '%s': %w", resourceID.Resource, err) + } + + resource := resourceResponse.Resource + pageToken := state.PageToken(ctx) + + // Call the connector to list entitlements for this resource + resp, err := ps.syncer.connector.ListEntitlements(ctx, &v2.EntitlementsServiceListEntitlementsRequest{ + Resource: resource, + PageToken: pageToken, + }) + if err != nil { + return nil, err + } + + // Store the entitlements + err = ps.syncer.store.PutEntitlements(ctx, resp.List...) + if err != nil { + return nil, err + } + + // Update progress counts + ps.syncer.counts.AddEntitlementsProgress(resourceID.ResourceType, 1) + ps.syncer.counts.LogEntitlementsProgress(ctx, resourceID.ResourceType) + + // Check if we need to continue with pagination + if resp.NextPageToken != "" { + return &ActionDecision{ + ShouldContinue: true, + NextPageToken: resp.NextPageToken, + Action: "next_page", + }, nil + } + + // No more pages, action is complete + return &ActionDecision{ + ShouldContinue: false, + Action: "finish", + }, nil +} + +// getSubResources fetches the sub resource types from a resources' annotations (replicating original logic) +func (ps *parallelSyncer) getSubResources(ctx context.Context, parent *v2.Resource) error { + ctx, span := parallelTracer.Start(ctx, "parallelSyncer.getSubResources") + defer span.End() + + for _, a := range parent.Annotations { + if a.MessageIs((*v2.ChildResourceType)(nil)) { + crt := &v2.ChildResourceType{} + err := a.UnmarshalTo(crt) + if err != nil { + return err + } + + // Create task for child resource type + childTask := &task{ + Action: Action{ + Op: SyncResourcesOp, + ResourceTypeID: crt.ResourceTypeId, + ParentResourceID: parent.Id.Resource, + ParentResourceTypeID: parent.Id.ResourceType, + }, + Priority: 1, + } + + if err := ps.addTaskWithRetry(ctx, childTask, taskRetryLimit); err != nil { + return fmt.Errorf("failed to add child resource task: %w", err) + } + } + } + + return nil +} + +// shouldSkipEntitlementsAndGrants checks if entitlements and grants should be skipped for a resource +func (ps *parallelSyncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r *v2.Resource) (bool, error) { + // This replicates the logic from the original shouldSkipEntitlementsAndGrants method + // Check if the resource has the SkipEntitlementsAndGrants annotation + + for _, a := range r.Annotations { + if a.MessageIs((*v2.SkipEntitlementsAndGrants)(nil)) { + return true, nil + } + } + + return false, nil +} + +// Close implements the Syncer interface +func (ps *parallelSyncer) Close(ctx context.Context) error { + // Stop all workers + ps.stopWorkers() + + // Close the task queue + if ps.taskQueue != nil { + ps.taskQueue.Close() + } + + // Call the base syncer's Close method + return ps.syncer.Close(ctx) +} + +// GetBucketStats returns statistics about all buckets +func (ps *parallelSyncer) GetBucketStats() map[string]int { + if ps.taskQueue == nil { + return make(map[string]int) + } + return ps.taskQueue.GetBucketStats() +} + +// GetWorkerStatus returns the status of all workers +func (ps *parallelSyncer) GetWorkerStatus() []map[string]interface{} { + ps.mu.RLock() + defer ps.mu.RUnlock() + + status := make([]map[string]interface{}, len(ps.workers)) + for i, worker := range ps.workers { + status[i] = map[string]interface{}{ + "worker_id": worker.id, + "rate_limited": worker.rateLimited.Load(), + } + } + return status +} + +// NewParallelSyncerFromSyncer creates a parallel syncer from an existing syncer +func NewParallelSyncerFromSyncer(s Syncer, config *ParallelSyncConfig) (*parallelSyncer, error) { + // Try to cast to the concrete syncer type + if baseSyncer, ok := s.(*SequentialSyncer); ok { + return NewParallelSyncer(baseSyncer, config), nil + } + + return nil, fmt.Errorf("cannot create parallel syncer from syncer type: %T", s) +} + +// syncGrantsForResourceSequential is the refactored version that returns ActionDecision +// This can be called by the sequential syncer to get the same behavior but with explicit control +func (ps *parallelSyncer) syncGrantsForResourceSequential(ctx context.Context, resourceID *v2.ResourceId) (*ActionDecision, error) { + // Create a state interface that delegates to the base syncer's state + stateWrapper := &sequentialStateWrapper{syncer: ps.syncer} + return ps.syncGrantsForResourceLogic(ctx, resourceID, stateWrapper) +} + +// syncEntitlementsForResourceSequential is the refactored version that returns ActionDecision +// This can be called by the sequential syncer to get the same behavior but with explicit control +func (ps *parallelSyncer) syncEntitlementsForResourceSequential(ctx context.Context, resourceID *v2.ResourceId) (*ActionDecision, error) { + // Create a state interface that delegates to the base syncer's state + stateWrapper := &sequentialStateWrapper{syncer: ps.syncer} + return ps.syncEntitlementsForResourceLogic(ctx, resourceID, stateWrapper) +} + +// sequentialStateWrapper implements StateInterface by delegating to the base syncer's state +// This allows the sequential syncer to use the refactored methods while maintaining its state machine +type sequentialStateWrapper struct { + syncer *SequentialSyncer +} + +func (sw *sequentialStateWrapper) PageToken(ctx context.Context) string { + return sw.syncer.state.PageToken(ctx) +} + +func (sw *sequentialStateWrapper) NextPage(ctx context.Context, pageToken string) error { + return sw.syncer.state.NextPage(ctx, pageToken) +} + +func (sw *sequentialStateWrapper) SetNeedsExpansion() { + sw.syncer.state.SetNeedsExpansion() +} + +func (sw *sequentialStateWrapper) SetHasExternalResourcesGrants() { + sw.syncer.state.SetHasExternalResourcesGrants() +} + +func (sw *sequentialStateWrapper) ShouldFetchRelatedResources() bool { + return sw.syncer.state.ShouldFetchRelatedResources() +} diff --git a/pkg/sync/state.go b/pkg/sync/state.go index 71e14911b..184c3b096 100644 --- a/pkg/sync/state.go +++ b/pkg/sync/state.go @@ -66,6 +66,8 @@ func (s ActionOp) String() string { return "targeted-resource-sync" case SyncStaticEntitlementsOp: return "list-static-entitlements" + case CollectEntitlementsAndGrantsTasksOp: + return "collect-entitlements-and-grants-tasks" default: return "unknown" } @@ -113,6 +115,8 @@ func newActionOp(str string) ActionOp { return SyncStaticEntitlementsOp case ListResourcesForEntitlementsOp.String(): return ListResourcesForEntitlementsOp + case CollectEntitlementsAndGrantsTasksOp.String(): + return CollectEntitlementsAndGrantsTasksOp default: return UnknownOp } @@ -133,6 +137,7 @@ const ( SyncGrantExpansionOp SyncTargetedResourceOp SyncStaticEntitlementsOp + CollectEntitlementsAndGrantsTasksOp ) // Action stores the current operation, page token, and optional fields for which resource is being worked with. diff --git a/pkg/sync/syncer.go b/pkg/sync/syncer.go index 48fb33b74..40f8f5a84 100644 --- a/pkg/sync/syncer.go +++ b/pkg/sync/syncer.go @@ -12,6 +12,7 @@ import ( "slices" "strconv" "strings" + "sync" "time" "github.com/Masterminds/semver/v3" @@ -63,6 +64,8 @@ type ProgressCounts struct { GrantsProgress map[string]int LastGrantLog map[string]time.Time LastActionLog time.Time + mu sync.RWMutex // Protect concurrent access to maps + sequentialMode bool // Disable mutex protection for sequential sync } const maxLogFrequency = 10 * time.Second @@ -76,6 +79,7 @@ func NewProgressCounts() *ProgressCounts { GrantsProgress: make(map[string]int), LastGrantLog: make(map[string]time.Time), LastActionLog: time.Time{}, + sequentialMode: true, // Default to sequential mode for backward compatibility } } @@ -85,24 +89,50 @@ func (p *ProgressCounts) LogResourceTypesProgress(ctx context.Context) { } func (p *ProgressCounts) LogResourcesProgress(ctx context.Context, resourceType string) { + var resources int + if p.sequentialMode { + resources = p.Resources[resourceType] + } else { + p.mu.RLock() + resources = p.Resources[resourceType] + p.mu.RUnlock() + } + l := ctxzap.Extract(ctx) - resources := p.Resources[resourceType] l.Info("Synced resources", zap.String("resource_type_id", resourceType), zap.Int("count", resources)) } func (p *ProgressCounts) LogEntitlementsProgress(ctx context.Context, resourceType string) { - entitlementsProgress := p.EntitlementsProgress[resourceType] - resources := p.Resources[resourceType] + var entitlementsProgress, resources int + var lastLogTime time.Time + + if p.sequentialMode { + entitlementsProgress = p.EntitlementsProgress[resourceType] + resources = p.Resources[resourceType] + lastLogTime = p.LastEntitlementLog[resourceType] + } else { + p.mu.RLock() + entitlementsProgress = p.EntitlementsProgress[resourceType] + resources = p.Resources[resourceType] + lastLogTime = p.LastEntitlementLog[resourceType] + p.mu.RUnlock() + } l := ctxzap.Extract(ctx) if resources == 0 { // if resuming sync, resource counts will be zero, so don't calculate percentage. just log every 10 seconds. - if time.Since(p.LastEntitlementLog[resourceType]) > maxLogFrequency { + if time.Since(lastLogTime) > maxLogFrequency { l.Info("Syncing entitlements", zap.String("resource_type_id", resourceType), zap.Int("synced", entitlementsProgress), ) - p.LastEntitlementLog[resourceType] = time.Now() + if !p.sequentialMode { + p.mu.Lock() + p.LastEntitlementLog[resourceType] = time.Now() + p.mu.Unlock() + } else { + p.LastEntitlementLog[resourceType] = time.Now() + } } return } @@ -116,8 +146,14 @@ func (p *ProgressCounts) LogEntitlementsProgress(ctx context.Context, resourceTy zap.Int("count", entitlementsProgress), zap.Int("total", resources), ) - p.LastEntitlementLog[resourceType] = time.Time{} - case time.Since(p.LastEntitlementLog[resourceType]) > maxLogFrequency: + if !p.sequentialMode { + p.mu.Lock() + p.LastEntitlementLog[resourceType] = time.Time{} + p.mu.Unlock() + } else { + p.LastEntitlementLog[resourceType] = time.Time{} + } + case time.Since(lastLogTime) > maxLogFrequency: if entitlementsProgress > resources { l.Warn("more entitlement resources than resources", zap.String("resource_type_id", resourceType), @@ -132,23 +168,47 @@ func (p *ProgressCounts) LogEntitlementsProgress(ctx context.Context, resourceTy zap.Int("percent_complete", percentComplete), ) } - p.LastEntitlementLog[resourceType] = time.Now() + if !p.sequentialMode { + p.mu.Lock() + p.LastEntitlementLog[resourceType] = time.Now() + p.mu.Unlock() + } else { + p.LastEntitlementLog[resourceType] = time.Now() + } } } func (p *ProgressCounts) LogGrantsProgress(ctx context.Context, resourceType string) { - grantsProgress := p.GrantsProgress[resourceType] - resources := p.Resources[resourceType] + var grantsProgress, resources int + var lastLogTime time.Time + + if p.sequentialMode { + grantsProgress = p.GrantsProgress[resourceType] + resources = p.Resources[resourceType] + lastLogTime = p.LastGrantLog[resourceType] + } else { + p.mu.RLock() + grantsProgress = p.GrantsProgress[resourceType] + resources = p.Resources[resourceType] + lastLogTime = p.LastGrantLog[resourceType] + p.mu.RUnlock() + } l := ctxzap.Extract(ctx) if resources == 0 { // if resuming sync, resource counts will be zero, so don't calculate percentage. just log every 10 seconds. - if time.Since(p.LastGrantLog[resourceType]) > maxLogFrequency { + if time.Since(lastLogTime) > maxLogFrequency { l.Info("Syncing grants", zap.String("resource_type_id", resourceType), zap.Int("synced", grantsProgress), ) - p.LastGrantLog[resourceType] = time.Now() + if !p.sequentialMode { + p.mu.Lock() + p.LastGrantLog[resourceType] = time.Now() + p.mu.Unlock() + } else { + p.LastGrantLog[resourceType] = time.Now() + } } return } @@ -162,8 +222,14 @@ func (p *ProgressCounts) LogGrantsProgress(ctx context.Context, resourceType str zap.Int("count", grantsProgress), zap.Int("total", resources), ) - p.LastGrantLog[resourceType] = time.Time{} - case time.Since(p.LastGrantLog[resourceType]) > maxLogFrequency: + if !p.sequentialMode { + p.mu.Lock() + p.LastGrantLog[resourceType] = time.Time{} + p.mu.Unlock() + } else { + p.LastGrantLog[resourceType] = time.Time{} + } + case time.Since(lastLogTime) > maxLogFrequency: if grantsProgress > resources { l.Warn("more grant resources than resources", zap.String("resource_type_id", resourceType), @@ -178,23 +244,75 @@ func (p *ProgressCounts) LogGrantsProgress(ctx context.Context, resourceType str zap.Int("percent_complete", percentComplete), ) } - p.LastGrantLog[resourceType] = time.Now() + if !p.sequentialMode { + p.mu.Lock() + p.LastGrantLog[resourceType] = time.Now() + p.mu.Unlock() + } else { + p.LastGrantLog[resourceType] = time.Now() + } } } func (p *ProgressCounts) LogExpandProgress(ctx context.Context, actions []*expand.EntitlementGraphAction) { actionsLen := len(actions) - if time.Since(p.LastActionLog) < maxLogFrequency { - return + + if p.sequentialMode { + if time.Since(p.LastActionLog) < maxLogFrequency { + return + } + p.LastActionLog = time.Now() + } else { + p.mu.Lock() + if time.Since(p.LastActionLog) < maxLogFrequency { + p.mu.Unlock() + return + } + p.LastActionLog = time.Now() + p.mu.Unlock() } - p.LastActionLog = time.Now() l := ctxzap.Extract(ctx) l.Info("Expanding grants", zap.Int("actions_remaining", actionsLen)) } -// syncer orchestrates a connector sync and stores the results using the provided datasource.Writer. -type syncer struct { +// Thread-safe methods for parallel syncer + +// AddResourceTypes safely adds to the resource types count +func (p *ProgressCounts) AddResourceTypes(count int) { + p.mu.Lock() + defer p.mu.Unlock() + p.ResourceTypes += count +} + +// AddResources safely adds to the resources count for a specific resource type +func (p *ProgressCounts) AddResources(resourceType string, count int) { + p.mu.Lock() + defer p.mu.Unlock() + p.Resources[resourceType] += count +} + +// AddEntitlementsProgress safely adds to the entitlements progress count for a specific resource type +func (p *ProgressCounts) AddEntitlementsProgress(resourceType string, count int) { + p.mu.Lock() + defer p.mu.Unlock() + p.EntitlementsProgress[resourceType] += count +} + +// AddGrantsProgress safely adds to the grants progress count for a specific resource type +func (p *ProgressCounts) AddGrantsProgress(resourceType string, count int) { + p.mu.Lock() + defer p.mu.Unlock() + p.GrantsProgress[resourceType] += count +} + +// SetSequentialMode enables/disables mutex protection for sequential sync +func (p *ProgressCounts) SetSequentialMode(sequential bool) { + p.sequentialMode = sequential +} + +// SequentialSyncer orchestrates a connector sync and stores the results using the provided datasource.Writer. +type SequentialSyncer struct { c1zManager manager.Manager c1zPath string externalResourceC1ZPath string @@ -222,12 +340,13 @@ type syncer struct { injectSyncIDAnnotation bool setSessionStore sessions.SetSessionStore syncResourceTypes []string + enableWALCheckpoint bool } const minCheckpointInterval = 10 * time.Second // Checkpoint marshals the current state and stores it. -func (s *syncer) Checkpoint(ctx context.Context, force bool) error { +func (s *SequentialSyncer) Checkpoint(ctx context.Context, force bool) error { if !force && !s.lastCheckPointTime.IsZero() && time.Since(s.lastCheckPointTime) < minCheckpointInterval { return nil } @@ -247,13 +366,13 @@ func (s *syncer) Checkpoint(ctx context.Context, force bool) error { return nil } -func (s *syncer) handleInitialActionForStep(ctx context.Context, a Action) { +func (s *SequentialSyncer) handleInitialActionForStep(ctx context.Context, a Action) { if s.transitionHandler != nil { s.transitionHandler(a) } } -func (s *syncer) handleProgress(ctx context.Context, a *Action, c int) { +func (s *SequentialSyncer) handleProgress(ctx context.Context, a *Action, c int) { if s.progressHandler != nil { //nolint:gosec // No risk of overflow because `c` is a slice length. count := uint32(c) @@ -273,7 +392,7 @@ func isWarning(ctx context.Context, err error) bool { return false } -func (s *syncer) startOrResumeSync(ctx context.Context) (string, bool, error) { +func (s *SequentialSyncer) startOrResumeSync(ctx context.Context) (string, bool, error) { // Sync resuming logic: // If we know our sync ID, set it as the current sync and return (resuming that sync). // If targetedSyncResourceIDs is not set, find the most recent unfinished sync of our desired sync type & resume it (regardless of partial or full). @@ -320,7 +439,7 @@ func (s *syncer) startOrResumeSync(ctx context.Context) (string, bool, error) { return syncID, newSync, nil } -func (s *syncer) getActiveSyncID() string { +func (s *SequentialSyncer) getActiveSyncID() string { if s.injectSyncIDAnnotation { return s.syncID } @@ -331,7 +450,7 @@ func (s *syncer) getActiveSyncID() string { // For each page of data that is required to be fetched from the connector, a new action is pushed on to the stack. Once // an action is completed, it is popped off of the queue. Before processing each action, we checkpoint the state object // into the datasource. This allows for graceful resumes if a sync is interrupted. -func (s *syncer) Sync(ctx context.Context) error { +func (s *SequentialSyncer) Sync(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.Sync") defer span.End() @@ -689,7 +808,7 @@ func (s *syncer) Sync(ctx context.Context) error { return nil } -func (s *syncer) SkipSync(ctx context.Context) error { +func (s *SequentialSyncer) SkipSync(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SkipSync") defer span.End() @@ -733,7 +852,7 @@ func (s *syncer) SkipSync(ctx context.Context) error { return nil } -func (s *syncer) listAllResourceTypes(ctx context.Context) iter.Seq2[[]*v2.ResourceType, error] { +func (s *SequentialSyncer) listAllResourceTypes(ctx context.Context) iter.Seq2[[]*v2.ResourceType, error] { return func(yield func([]*v2.ResourceType, error) bool) { pageToken := "" for { @@ -757,7 +876,7 @@ func (s *syncer) listAllResourceTypes(ctx context.Context) iter.Seq2[[]*v2.Resou } // SyncResourceTypes calls the ListResourceType() connector endpoint and persists the results in to the datasource. -func (s *syncer) SyncResourceTypes(ctx context.Context) error { +func (s *SequentialSyncer) SyncResourceTypes(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncResourceTypes") defer span.End() @@ -844,7 +963,7 @@ func validateSyncResourceTypesFilter(resourceTypesFilter []string, validResource } // getSubResources fetches the sub resource types from a resources' annotations. -func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error { +func (s *SequentialSyncer) getSubResources(ctx context.Context, parent *v2.Resource) error { ctx, span := tracer.Start(ctx, "syncer.getSubResources") defer span.End() @@ -869,7 +988,7 @@ func (s *syncer) getSubResources(ctx context.Context, parent *v2.Resource) error return nil } -func (s *syncer) getResourceFromConnector(ctx context.Context, resourceID *v2.ResourceId, parentResourceID *v2.ResourceId) (*v2.Resource, error) { +func (s *SequentialSyncer) getResourceFromConnector(ctx context.Context, resourceID *v2.ResourceId, parentResourceID *v2.ResourceId) (*v2.Resource, error) { ctx, span := tracer.Start(ctx, "syncer.getResource") defer span.End() @@ -895,7 +1014,7 @@ func (s *syncer) getResourceFromConnector(ctx context.Context, resourceID *v2.Re return nil, err } -func (s *syncer) SyncTargetedResource(ctx context.Context) error { +func (s *SequentialSyncer) SyncTargetedResource(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncTargetedResource") defer span.End() @@ -973,7 +1092,7 @@ func (s *syncer) SyncTargetedResource(ctx context.Context) error { // SyncResources handles fetching all of the resources from the connector given the provided resource types. For each // resource, we gather any child resource types it may emit, and traverse the resource tree. -func (s *syncer) SyncResources(ctx context.Context) error { +func (s *SequentialSyncer) SyncResources(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncResources") defer span.End() @@ -1017,7 +1136,7 @@ func (s *syncer) SyncResources(ctx context.Context) error { } // syncResources fetches a given resource from the connector, and returns a slice of new child resources to fetch. -func (s *syncer) syncResources(ctx context.Context) error { +func (s *SequentialSyncer) syncResources(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.syncResources") defer span.End() @@ -1093,7 +1212,7 @@ func (s *syncer) syncResources(ctx context.Context) error { return nil } -func (s *syncer) validateResourceTraits(ctx context.Context, r *v2.Resource) error { +func (s *SequentialSyncer) validateResourceTraits(ctx context.Context, r *v2.Resource) error { ctx, span := tracer.Start(ctx, "syncer.validateResourceTraits") defer span.End() @@ -1144,7 +1263,7 @@ func (s *syncer) validateResourceTraits(ctx context.Context, r *v2.Resource) err // shouldSkipEntitlementsAndGrants determines if we should sync entitlements for a given resource. We cache the // result of this function for each resource type to avoid constant lookups in the database. -func (s *syncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r *v2.Resource) (bool, error) { +func (s *SequentialSyncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r *v2.Resource) (bool, error) { ctx, span := tracer.Start(ctx, "syncer.shouldSkipEntitlementsAndGrants") defer span.End() @@ -1177,7 +1296,7 @@ func (s *syncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r *v2.Reso return skipEntitlements, nil } -func (s *syncer) shouldSkipGrants(ctx context.Context, r *v2.Resource) (bool, error) { +func (s *SequentialSyncer) shouldSkipGrants(ctx context.Context, r *v2.Resource) (bool, error) { annos := annotations.Annotations(r.GetAnnotations()) if annos.Contains(&v2.SkipGrants{}) { return true, nil @@ -1192,7 +1311,7 @@ func (s *syncer) shouldSkipGrants(ctx context.Context, r *v2.Resource) (bool, er // SyncEntitlements fetches the entitlements from the connector. It first lists each resource from the datastore, // and pushes an action to fetch the entitlements for each resource. -func (s *syncer) SyncEntitlements(ctx context.Context) error { +func (s *SequentialSyncer) SyncEntitlements(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncEntitlements") defer span.End() @@ -1245,7 +1364,7 @@ func (s *syncer) SyncEntitlements(ctx context.Context) error { } // syncEntitlementsForResource fetches the entitlements for a specific resource from the connector. -func (s *syncer) syncEntitlementsForResource(ctx context.Context, resourceID *v2.ResourceId) error { +func (s *SequentialSyncer) syncEntitlementsForResource(ctx context.Context, resourceID *v2.ResourceId) error { ctx, span := tracer.Start(ctx, "syncer.syncEntitlementsForResource") defer span.End() @@ -1281,7 +1400,13 @@ func (s *syncer) syncEntitlementsForResource(ctx context.Context, resourceID *v2 return err } } else { - s.counts.EntitlementsProgress[resourceID.GetResourceType()] += 1 + if s.counts.sequentialMode { + s.counts.EntitlementsProgress[resourceID.ResourceType] += 1 + } else { + s.counts.mu.Lock() + s.counts.EntitlementsProgress[resourceID.ResourceType] += 1 + s.counts.mu.Unlock() + } s.counts.LogEntitlementsProgress(ctx, resourceID.GetResourceType()) s.state.FinishAction(ctx) @@ -1290,7 +1415,7 @@ func (s *syncer) syncEntitlementsForResource(ctx context.Context, resourceID *v2 return nil } -func (s *syncer) SyncStaticEntitlements(ctx context.Context) error { +func (s *SequentialSyncer) SyncStaticEntitlements(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncStaticEntitlements") defer span.End() @@ -1315,7 +1440,7 @@ func (s *syncer) SyncStaticEntitlements(ctx context.Context) error { return nil } -func (s *syncer) syncStaticEntitlementsForResourceType(ctx context.Context, resourceTypeID string) error { +func (s *SequentialSyncer) syncStaticEntitlementsForResourceType(ctx context.Context, resourceTypeID string) error { ctx, span := tracer.Start(ctx, "syncer.syncStaticEntitlementsForResource") defer span.End() @@ -1396,7 +1521,7 @@ func (s *syncer) syncStaticEntitlementsForResourceType(ctx context.Context, reso // syncAssetsForResource looks up a resource given the input ID. From there it looks to see if there are any traits that // include references to an asset. For each AssetRef, we then call GetAsset on the connector and stream the asset from the connector. // Once we have the entire asset, we put it in the database. -func (s *syncer) syncAssetsForResource(ctx context.Context, resourceID *v2.ResourceId) error { +func (s *SequentialSyncer) syncAssetsForResource(ctx context.Context, resourceID *v2.ResourceId) error { ctx, span := tracer.Start(ctx, "syncer.syncAssetsForResource") defer span.End() @@ -1504,7 +1629,7 @@ func (s *syncer) syncAssetsForResource(ctx context.Context, resourceID *v2.Resou } // SyncAssets iterates each resource in the data store, and adds an action to fetch all of the assets for that resource. -func (s *syncer) SyncAssets(ctx context.Context) error { +func (s *SequentialSyncer) SyncAssets(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncAssets") defer span.End() @@ -1551,7 +1676,7 @@ func (s *syncer) SyncAssets(ctx context.Context) error { } // SyncGrantExpansion documentation pending. -func (s *syncer) SyncGrantExpansion(ctx context.Context) error { +func (s *SequentialSyncer) SyncGrantExpansion(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncGrantExpansion") defer span.End() @@ -1687,7 +1812,7 @@ func (s *syncer) SyncGrantExpansion(ctx context.Context) error { // SyncGrants fetches the grants for each resource from the connector. It iterates each resource // from the datastore, and pushes a new action to sync the grants for each individual resource. -func (s *syncer) SyncGrants(ctx context.Context) error { +func (s *SequentialSyncer) SyncGrants(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncGrants") defer span.End() @@ -1743,7 +1868,7 @@ type latestSyncFetcher interface { LatestFinishedSync(ctx context.Context, syncType connectorstore.SyncType) (string, error) } -func (s *syncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v2.ResourceId) (string, *v2.ETag, error) { +func (s *SequentialSyncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v2.ResourceId) (string, *v2.ETag, error) { ctx, span := tracer.Start(ctx, "syncer.fetchResourceForPreviousSync") defer span.End() @@ -1797,7 +1922,7 @@ func (s *syncer) fetchResourceForPreviousSync(ctx context.Context, resourceID *v return previousSyncID, nil, nil } -func (s *syncer) fetchEtaggedGrantsForResource( +func (s *SequentialSyncer) fetchEtaggedGrantsForResource( ctx context.Context, resource *v2.Resource, prevEtag *v2.ETag, @@ -1864,7 +1989,7 @@ func (s *syncer) fetchEtaggedGrantsForResource( } // syncGrantsForResource fetches the grants for a specific resource from the connector. -func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.ResourceId) error { +func (s *SequentialSyncer) syncGrantsForResource(ctx context.Context, resourceID *v2.ResourceId) error { ctx, span := tracer.Start(ctx, "syncer.syncGrantsForResource") defer span.End() @@ -2024,7 +2149,7 @@ func (s *syncer) syncGrantsForResource(ctx context.Context, resourceID *v2.Resou return nil } -func (s *syncer) SyncExternalResources(ctx context.Context) error { +func (s *SequentialSyncer) SyncExternalResources(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncExternalResources") defer span.End() @@ -2038,7 +2163,7 @@ func (s *syncer) SyncExternalResources(ctx context.Context) error { } } -func (s *syncer) SyncExternalResourcesWithGrantToEntitlement(ctx context.Context, entitlementId string) error { +func (s *SequentialSyncer) SyncExternalResourcesWithGrantToEntitlement(ctx context.Context, entitlementId string) error { ctx, span := tracer.Start(ctx, "syncer.SyncExternalResourcesWithGrantToEntitlement") defer span.End() @@ -2175,7 +2300,7 @@ func (s *syncer) SyncExternalResourcesWithGrantToEntitlement(ctx context.Context return nil } -func (s *syncer) SyncExternalResourcesUsersAndGroups(ctx context.Context) error { +func (s *SequentialSyncer) SyncExternalResourcesUsersAndGroups(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.SyncExternalResourcesUsersAndGroups") defer span.End() @@ -2289,7 +2414,7 @@ func (s *syncer) SyncExternalResourcesUsersAndGroups(ctx context.Context) error return nil } -func (s *syncer) listExternalResourcesForResourceType(ctx context.Context, resourceTypeId string) ([]*v2.Resource, error) { +func (s *SequentialSyncer) listExternalResourcesForResourceType(ctx context.Context, resourceTypeId string) ([]*v2.Resource, error) { resources := make([]*v2.Resource, 0) pageToken := "" for { @@ -2309,7 +2434,7 @@ func (s *syncer) listExternalResourcesForResourceType(ctx context.Context, resou return resources, nil } -func (s *syncer) listExternalEntitlementsForResource(ctx context.Context, resource *v2.Resource) ([]*v2.Entitlement, error) { +func (s *SequentialSyncer) listExternalEntitlementsForResource(ctx context.Context, resource *v2.Resource) ([]*v2.Entitlement, error) { ents := make([]*v2.Entitlement, 0) entitlementToken := "" @@ -2330,7 +2455,7 @@ func (s *syncer) listExternalEntitlementsForResource(ctx context.Context, resour return ents, nil } -func (s *syncer) listExternalGrantsForEntitlement(ctx context.Context, ent *v2.Entitlement) iter.Seq2[[]*v2.Grant, error] { +func (s *SequentialSyncer) listExternalGrantsForEntitlement(ctx context.Context, ent *v2.Entitlement) iter.Seq2[[]*v2.Grant, error] { return func(yield func([]*v2.Grant, error) bool) { pageToken := "" for { @@ -2356,7 +2481,7 @@ func (s *syncer) listExternalGrantsForEntitlement(ctx context.Context, ent *v2.E } } -func (s *syncer) listExternalResourceTypes(ctx context.Context) ([]*v2.ResourceType, error) { +func (s *SequentialSyncer) listExternalResourceTypes(ctx context.Context) ([]*v2.ResourceType, error) { resourceTypes := make([]*v2.ResourceType, 0) rtPageToken := "" for { @@ -2375,7 +2500,7 @@ func (s *syncer) listExternalResourceTypes(ctx context.Context) ([]*v2.ResourceT return resourceTypes, nil } -func (s *syncer) listAllGrants(ctx context.Context) iter.Seq2[[]*v2.Grant, error] { +func (s *SequentialSyncer) listAllGrants(ctx context.Context) iter.Seq2[[]*v2.Grant, error] { return func(yield func([]*v2.Grant, error) bool) { pageToken := "" for { @@ -2400,7 +2525,7 @@ func (s *syncer) listAllGrants(ctx context.Context) iter.Seq2[[]*v2.Grant, error } } -func (s *syncer) processGrantsWithExternalPrincipals(ctx context.Context, principals []*v2.Resource) error { +func (s *SequentialSyncer) processGrantsWithExternalPrincipals(ctx context.Context, principals []*v2.Resource) error { ctx, span := tracer.Start(ctx, "processGrantsWithExternalPrincipals") defer span.End() @@ -2707,7 +2832,7 @@ func GetExpandableAnnotation(annos annotations.Annotations) (*v2.GrantExpandable return expandableAnno, nil } -func (s *syncer) runGrantExpandActions(ctx context.Context) (bool, error) { +func (s *SequentialSyncer) runGrantExpandActions(ctx context.Context) (bool, error) { ctx, span := tracer.Start(ctx, "syncer.runGrantExpandActions") defer span.End() @@ -2862,7 +2987,7 @@ func (s *syncer) runGrantExpandActions(ctx context.Context) (bool, error) { return false, nil } -func (s *syncer) newExpandedGrant(_ context.Context, descEntitlement *v2.Entitlement, principal *v2.Resource) (*v2.Grant, error) { +func (s *SequentialSyncer) newExpandedGrant(_ context.Context, descEntitlement *v2.Entitlement, principal *v2.Resource) (*v2.Grant, error) { enResource := descEntitlement.GetResource() if enResource == nil { return nil, fmt.Errorf("newExpandedGrant: entitlement has no resource") @@ -2887,7 +3012,7 @@ func (s *syncer) newExpandedGrant(_ context.Context, descEntitlement *v2.Entitle } // expandGrantsForEntitlements expands grants for the given entitlement. -func (s *syncer) expandGrantsForEntitlements(ctx context.Context) error { +func (s *SequentialSyncer) expandGrantsForEntitlements(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.expandGrantsForEntitlements") defer span.End() @@ -2971,7 +3096,7 @@ func (s *syncer) expandGrantsForEntitlements(ctx context.Context) error { return nil } -func (s *syncer) loadStore(ctx context.Context) error { +func (s *SequentialSyncer) loadStore(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.loadStore") defer span.End() @@ -2980,7 +3105,12 @@ func (s *syncer) loadStore(ctx context.Context) error { } if s.c1zManager == nil { - m, err := manager.New(ctx, s.c1zPath, manager.WithTmpDir(s.tmpDir)) + opts := []manager.ManagerOption{manager.WithTmpDir(s.tmpDir)} + // Enable WAL checkpointing for parallel sync to prevent checkpoint failures under high concurrency + if s.enableWALCheckpoint { + opts = append(opts, manager.WithWALCheckpoint(true)) + } + m, err := manager.New(ctx, s.c1zPath, opts...) if err != nil { return err } @@ -3001,7 +3131,7 @@ func (s *syncer) loadStore(ctx context.Context) error { } // Close closes the datastorage to ensure it is updated on disk. -func (s *syncer) Close(ctx context.Context) error { +func (s *SequentialSyncer) Close(ctx context.Context) error { ctx, span := tracer.Start(ctx, "syncer.Close") defer span.End() @@ -3035,12 +3165,12 @@ func (s *syncer) Close(ctx context.Context) error { return nil } -type SyncOpt func(s *syncer) +type SyncOpt func(s *SequentialSyncer) // WithRunDuration sets a `time.Duration` for `NewSyncer` Options. // `d` represents a duration. The elapsed time between two instants as an int64 nanosecond count. func WithRunDuration(d time.Duration) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { if d > 0 { s.runDuration = d } @@ -3049,7 +3179,7 @@ func WithRunDuration(d time.Duration) SyncOpt { // WithTransitionHandler sets a `transitionHandler` for `NewSyncer` Options. func WithTransitionHandler(f func(s Action)) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { if f != nil { s.transitionHandler = f } @@ -3058,7 +3188,7 @@ func WithTransitionHandler(f func(s Action)) SyncOpt { // WithProgress sets a `progressHandler` for `NewSyncer` Options. func WithProgressHandler(f func(s *Progress)) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { if f != nil { s.progressHandler = f } @@ -3066,43 +3196,43 @@ func WithProgressHandler(f func(s *Progress)) SyncOpt { } func WithConnectorStore(store connectorstore.Writer) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.store = store } } func WithC1ZPath(path string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.c1zPath = path } } func WithTmpDir(path string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.tmpDir = path } } func WithSkipFullSync() SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.skipFullSync = true } } func WithExternalResourceC1ZPath(path string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.externalResourceC1ZPath = path } } func WithExternalResourceEntitlementIdFilter(entitlementId string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.externalResourceEntitlementIdFilter = entitlementId } } func WithTargetedSyncResourceIDs(resourceIDs []string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.targetedSyncResourceIDs = resourceIDs if len(resourceIDs) > 0 { s.syncType = connectorstore.SyncTypePartial @@ -3114,36 +3244,36 @@ func WithTargetedSyncResourceIDs(resourceIDs []string) SyncOpt { } func WithSessionStore(sessionStore sessions.SetSessionStore) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.setSessionStore = sessionStore } } func WithSyncResourceTypes(resourceTypeIDs []string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.syncResourceTypes = resourceTypeIDs } } func WithOnlyExpandGrants() SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.onlyExpandGrants = true } } func WithDontExpandGrants() SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.dontExpandGrants = true } } func WithSyncID(syncID string) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.syncID = syncID } } func WithSkipEntitlementsAndGrants(skip bool) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.skipEntitlementsAndGrants = skip // Partial syncs can skip entitlements and grants, so don't update the sync type in that case. if s.syncType == connectorstore.SyncTypePartial { @@ -3158,14 +3288,14 @@ func WithSkipEntitlementsAndGrants(skip bool) SyncOpt { } func WithSkipGrants(skip bool) SyncOpt { - return func(s *syncer) { + return func(s *SequentialSyncer) { s.skipGrants = skip } } // NewSyncer returns a new syncer object. -func NewSyncer(ctx context.Context, c types.ConnectorClient, opts ...SyncOpt) (Syncer, error) { - s := &syncer{ +func NewSyncer(ctx context.Context, c types.ConnectorClient, opts ...SyncOpt) (*SequentialSyncer, error) { + s := &SequentialSyncer{ connector: c, skipEGForResourceType: make(map[string]bool), resourceTypeTraits: make(map[string][]v2.ResourceType_Trait), diff --git a/pkg/tasks/c1api/full_sync.go b/pkg/tasks/c1api/full_sync.go index 24266a6f7..8cd81e2dd 100644 --- a/pkg/tasks/c1api/full_sync.go +++ b/pkg/tasks/c1api/full_sync.go @@ -35,6 +35,7 @@ type fullSyncTaskHandler struct { externalResourceEntitlementIdFilter string targetedSyncResourceIDs []string syncResourceTypeIDs []string + parallelSync bool } func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { @@ -87,12 +88,20 @@ func (c *fullSyncTaskHandler) sync(ctx context.Context, c1zPath string) error { syncOpts = append(syncOpts, sdkSync.WithSessionStore(setSessionStore)) } - syncer, err := sdkSync.NewSyncer(ctx, cc, syncOpts...) + var syncer sdkSync.Syncer + baseSyncer, err := sdkSync.NewSyncer(ctx, c.helpers.ConnectorClient(), syncOpts...) if err != nil { l.Error("failed to create syncer", zap.Error(err)) return err } + if c.parallelSync { + config := sdkSync.DefaultParallelSyncConfig().WithWorkerCount(10) + syncer = sdkSync.NewParallelSyncer(baseSyncer, config) + } else { + syncer = baseSyncer + } + // TODO(jirwin): Should we attempt to retry at all before failing the task? err = syncer.Sync(ctx) if err != nil { @@ -194,6 +203,7 @@ func newFullSyncTaskHandler( externalResourceEntitlementIdFilter string, targetedSyncResourceIDs []string, syncResourceTypeIDs []string, + parallelSync bool, ) tasks.TaskHandler { return &fullSyncTaskHandler{ task: task, @@ -203,6 +213,7 @@ func newFullSyncTaskHandler( externalResourceEntitlementIdFilter: externalResourceEntitlementIdFilter, targetedSyncResourceIDs: targetedSyncResourceIDs, syncResourceTypeIDs: syncResourceTypeIDs, + parallelSync: parallelSync, } } diff --git a/pkg/tasks/c1api/manager.go b/pkg/tasks/c1api/manager.go index 97a036a13..0ba8d02d0 100644 --- a/pkg/tasks/c1api/manager.go +++ b/pkg/tasks/c1api/manager.go @@ -54,6 +54,7 @@ type c1ApiTaskManager struct { externalResourceEntitlementIdFilter string targetedSyncResourceIDs []string syncResourceTypeIDs []string + parallelSync bool } // getHeartbeatInterval returns an appropriate heartbeat interval. If the interval is 0, it will return the default heartbeat interval. @@ -250,6 +251,7 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. c.externalResourceEntitlementIdFilter, c.targetedSyncResourceIDs, c.syncResourceTypeIDs, + c.parallelSync, ) case taskTypes.HelloType: handler = newHelloTaskHandler(task, tHelpers) @@ -299,9 +301,16 @@ func (c *c1ApiTaskManager) Process(ctx context.Context, task *v1.Task, cc types. } func NewC1TaskManager( - ctx context.Context, clientID string, clientSecret string, tempDir string, skipFullSync bool, - externalC1Z string, externalResourceEntitlementIdFilter string, targetedSyncResourceIDs []string, + ctx context.Context, + clientID string, + clientSecret string, + tempDir string, + skipFullSync bool, + externalC1Z string, + externalResourceEntitlementIdFilter string, + targetedSyncResourceIDs []string, syncResourceTypeIDs []string, + parallelSync bool, ) (tasks.Manager, error) { serviceClient, err := newServiceClient(ctx, clientID, clientSecret) if err != nil { @@ -316,5 +325,6 @@ func NewC1TaskManager( externalResourceEntitlementIdFilter: externalResourceEntitlementIdFilter, targetedSyncResourceIDs: targetedSyncResourceIDs, syncResourceTypeIDs: syncResourceTypeIDs, + parallelSync: parallelSync, }, nil } diff --git a/pkg/tasks/local/syncer.go b/pkg/tasks/local/syncer.go index 15148c48c..39cc58bb9 100644 --- a/pkg/tasks/local/syncer.go +++ b/pkg/tasks/local/syncer.go @@ -25,6 +25,7 @@ type localSyncer struct { skipEntitlementsAndGrants bool skipGrants bool syncResourceTypeIDs []string + parallelSync bool } type Option func(*localSyncer) @@ -71,6 +72,12 @@ func WithSkipGrants(skip bool) Option { } } +func WithParallelSyncEnabled(parallel bool) Option { + return func(m *localSyncer) { + m.parallelSync = parallel + } +} + func (m *localSyncer) GetTempDir() string { return "" } @@ -97,7 +104,9 @@ func (m *localSyncer) Process(ctx context.Context, task *v1.Task, cc types.Conne if ssetSessionStore, ok := cc.(session.SetSessionStore); ok { setSessionStore = ssetSessionStore } - syncer, err := sdkSync.NewSyncer(ctx, cc, + + var syncer sdkSync.Syncer + baseSyncer, err := sdkSync.NewSyncer(ctx, cc, sdkSync.WithC1ZPath(m.dbPath), sdkSync.WithTmpDir(m.tmpDir), sdkSync.WithExternalResourceC1ZPath(m.externalResourceC1Z), @@ -112,6 +121,14 @@ func (m *localSyncer) Process(ctx context.Context, task *v1.Task, cc types.Conne return err } + if m.parallelSync { + config := sdkSync.DefaultParallelSyncConfig() + config.WithWorkerCount(10) + syncer = sdkSync.NewParallelSyncer(baseSyncer, config) + } else { + syncer = baseSyncer + } + err = syncer.Sync(ctx) if err != nil { if closeErr := syncer.Close(ctx); closeErr != nil { diff --git a/proto/c1/connector/v2/resource.proto b/proto/c1/connector/v2/resource.proto index 2528030a4..754c8b96a 100644 --- a/proto/c1/connector/v2/resource.proto +++ b/proto/c1/connector/v2/resource.proto @@ -44,6 +44,12 @@ message ResourceType { ignore_empty: true }]; bool sourced_externally = 6; + + // Sync bucketing configuration for parallel processing + // Resource types with the same bucket name will be processed sequentially within that bucket + // Resource types with different bucket names can be processed in parallel + // If not specified, the default bucket from ParallelSyncConfig will be used + string sync_bucket = 7; } message ResourceTypesServiceListResourceTypesRequest { From e0f6291e7d4c0d57a9fe2eada73afb9510a25dfa Mon Sep 17 00:00:00 2001 From: Justin Gallardo Date: Mon, 20 Oct 2025 10:56:05 -0700 Subject: [PATCH 2/3] make protogen after rebase. update type for WithSessionStore Don't check the bucket name when looking to see if tasks are complete. Check context when sleeping. Check context when sleeping. Lint fixes More lint fixes. Various review feedback fixes. --- pb/c1/connector/v2/resource.pb.go | 2906 ++++++++++++----- pb/c1/connector/v2/resource_protoopaque.pb.go | 24 +- pkg/dotc1z/c1file.go | 25 +- pkg/dotc1z/sql_helpers.go | 18 +- pkg/sync/parallel_syncer.go | 496 +-- pkg/sync/syncer.go | 10 +- pkg/tasks/local/syncer.go | 3 +- 7 files changed, 2290 insertions(+), 1192 deletions(-) diff --git a/pb/c1/connector/v2/resource.pb.go b/pb/c1/connector/v2/resource.pb.go index 34606533a..277f2129f 100644 --- a/pb/c1/connector/v2/resource.pb.go +++ b/pb/c1/connector/v2/resource.pb.go @@ -1,9 +1,11 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.4 +// protoc-gen-go v1.36.10 // protoc (unknown) // source: c1/connector/v2/resource.proto +//go:build !protoopaque + package v2 import ( @@ -13,7 +15,6 @@ import ( anypb "google.golang.org/protobuf/types/known/anypb" structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" - sync "sync" unsafe "unsafe" ) @@ -77,11 +78,6 @@ func (x ResourceType_Trait) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use ResourceType_Trait.Descriptor instead. -func (ResourceType_Trait) EnumDescriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{0, 0} -} - // FIXME(mstanbCO): call this something else? Should it just be a bool? Possibly just use an annotation? type Resource_CreationSource int32 @@ -127,13 +123,8 @@ func (x Resource_CreationSource) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use Resource_CreationSource.Descriptor instead. -func (Resource_CreationSource) EnumDescriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21, 0} -} - type ResourceType struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` Traits []ResourceType_Trait `protobuf:"varint,3,rep,packed,name=traits,proto3,enum=c1.connector.v2.ResourceType_Trait" json:"traits,omitempty"` @@ -174,11 +165,6 @@ func (x *ResourceType) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ResourceType.ProtoReflect.Descriptor instead. -func (*ResourceType) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{0} -} - func (x *ResourceType) GetId() string { if x != nil { return x.Id @@ -228,8 +214,66 @@ func (x *ResourceType) GetSyncBucket() string { return "" } +func (x *ResourceType) SetId(v string) { + x.Id = v +} + +func (x *ResourceType) SetDisplayName(v string) { + x.DisplayName = v +} + +func (x *ResourceType) SetTraits(v []ResourceType_Trait) { + x.Traits = v +} + +func (x *ResourceType) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *ResourceType) SetDescription(v string) { + x.Description = v +} + +func (x *ResourceType) SetSourcedExternally(v bool) { + x.SourcedExternally = v +} + +func (x *ResourceType) SetSyncBucket(v string) { + x.SyncBucket = v +} + +type ResourceType_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string + DisplayName string + Traits []ResourceType_Trait + Annotations []*anypb.Any + Description string + SourcedExternally bool + // Sync bucketing configuration for parallel processing + // Resource types with the same bucket name will be processed sequentially within that bucket + // Resource types with different bucket names can be processed in parallel + // If not specified, the default bucket from ParallelSyncConfig will be used + SyncBucket string +} + +func (b0 ResourceType_builder) Build() *ResourceType { + m0 := &ResourceType{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.DisplayName = b.DisplayName + x.Traits = b.Traits + x.Annotations = b.Annotations + x.Description = b.Description + x.SourcedExternally = b.SourcedExternally + x.SyncBucket = b.SyncBucket + return m0 +} + type ResourceTypesServiceListResourceTypesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Parent *Resource `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` @@ -264,11 +308,6 @@ func (x *ResourceTypesServiceListResourceTypesRequest) ProtoReflect() protorefle return mi.MessageOf(x) } -// Deprecated: Use ResourceTypesServiceListResourceTypesRequest.ProtoReflect.Descriptor instead. -func (*ResourceTypesServiceListResourceTypesRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{1} -} - func (x *ResourceTypesServiceListResourceTypesRequest) GetParent() *Resource { if x != nil { return x.Parent @@ -304,8 +343,61 @@ func (x *ResourceTypesServiceListResourceTypesRequest) GetActiveSyncId() string return "" } +func (x *ResourceTypesServiceListResourceTypesRequest) SetParent(v *Resource) { + x.Parent = v +} + +func (x *ResourceTypesServiceListResourceTypesRequest) SetPageSize(v uint32) { + x.PageSize = v +} + +func (x *ResourceTypesServiceListResourceTypesRequest) SetPageToken(v string) { + x.PageToken = v +} + +func (x *ResourceTypesServiceListResourceTypesRequest) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *ResourceTypesServiceListResourceTypesRequest) SetActiveSyncId(v string) { + x.ActiveSyncId = v +} + +func (x *ResourceTypesServiceListResourceTypesRequest) HasParent() bool { + if x == nil { + return false + } + return x.Parent != nil +} + +func (x *ResourceTypesServiceListResourceTypesRequest) ClearParent() { + x.Parent = nil +} + +type ResourceTypesServiceListResourceTypesRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Parent *Resource + PageSize uint32 + PageToken string + Annotations []*anypb.Any + ActiveSyncId string +} + +func (b0 ResourceTypesServiceListResourceTypesRequest_builder) Build() *ResourceTypesServiceListResourceTypesRequest { + m0 := &ResourceTypesServiceListResourceTypesRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Parent = b.Parent + x.PageSize = b.PageSize + x.PageToken = b.PageToken + x.Annotations = b.Annotations + x.ActiveSyncId = b.ActiveSyncId + return m0 +} + type ResourceTypesServiceListResourceTypesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` List []*ResourceType `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -338,11 +430,6 @@ func (x *ResourceTypesServiceListResourceTypesResponse) ProtoReflect() protorefl return mi.MessageOf(x) } -// Deprecated: Use ResourceTypesServiceListResourceTypesResponse.ProtoReflect.Descriptor instead. -func (*ResourceTypesServiceListResourceTypesResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{2} -} - func (x *ResourceTypesServiceListResourceTypesResponse) GetList() []*ResourceType { if x != nil { return x.List @@ -364,8 +451,38 @@ func (x *ResourceTypesServiceListResourceTypesResponse) GetAnnotations() []*anyp return nil } +func (x *ResourceTypesServiceListResourceTypesResponse) SetList(v []*ResourceType) { + x.List = v +} + +func (x *ResourceTypesServiceListResourceTypesResponse) SetNextPageToken(v string) { + x.NextPageToken = v +} + +func (x *ResourceTypesServiceListResourceTypesResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +type ResourceTypesServiceListResourceTypesResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + List []*ResourceType + NextPageToken string + Annotations []*anypb.Any +} + +func (b0 ResourceTypesServiceListResourceTypesResponse_builder) Build() *ResourceTypesServiceListResourceTypesResponse { + m0 := &ResourceTypesServiceListResourceTypesResponse{} + b, x := &b0, m0 + _, _ = b, x + x.List = b.List + x.NextPageToken = b.NextPageToken + x.Annotations = b.Annotations + return m0 +} + type CreateResourceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -396,11 +513,6 @@ func (x *CreateResourceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateResourceRequest.ProtoReflect.Descriptor instead. -func (*CreateResourceRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{3} -} - func (x *CreateResourceRequest) GetResource() *Resource { if x != nil { return x.Resource @@ -408,8 +520,37 @@ func (x *CreateResourceRequest) GetResource() *Resource { return nil } +func (x *CreateResourceRequest) SetResource(v *Resource) { + x.Resource = v +} + +func (x *CreateResourceRequest) HasResource() bool { + if x == nil { + return false + } + return x.Resource != nil +} + +func (x *CreateResourceRequest) ClearResource() { + x.Resource = nil +} + +type CreateResourceRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Resource *Resource +} + +func (b0 CreateResourceRequest_builder) Build() *CreateResourceRequest { + m0 := &CreateResourceRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Resource = b.Resource + return m0 +} + type CreateResourceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Created *Resource `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields @@ -441,11 +582,6 @@ func (x *CreateResourceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateResourceResponse.ProtoReflect.Descriptor instead. -func (*CreateResourceResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{4} -} - func (x *CreateResourceResponse) GetCreated() *Resource { if x != nil { return x.Created @@ -460,8 +596,43 @@ func (x *CreateResourceResponse) GetAnnotations() []*anypb.Any { return nil } +func (x *CreateResourceResponse) SetCreated(v *Resource) { + x.Created = v +} + +func (x *CreateResourceResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *CreateResourceResponse) HasCreated() bool { + if x == nil { + return false + } + return x.Created != nil +} + +func (x *CreateResourceResponse) ClearCreated() { + x.Created = nil +} + +type CreateResourceResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Created *Resource + Annotations []*anypb.Any +} + +func (b0 CreateResourceResponse_builder) Build() *CreateResourceResponse { + m0 := &CreateResourceResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Created = b.Created + x.Annotations = b.Annotations + return m0 +} + type DeleteResourceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` unknownFields protoimpl.UnknownFields @@ -493,11 +664,6 @@ func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead. -func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{5} -} - func (x *DeleteResourceRequest) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -512,8 +678,54 @@ func (x *DeleteResourceRequest) GetParentResourceId() *ResourceId { return nil } +func (x *DeleteResourceRequest) SetResourceId(v *ResourceId) { + x.ResourceId = v +} + +func (x *DeleteResourceRequest) SetParentResourceId(v *ResourceId) { + x.ParentResourceId = v +} + +func (x *DeleteResourceRequest) HasResourceId() bool { + if x == nil { + return false + } + return x.ResourceId != nil +} + +func (x *DeleteResourceRequest) HasParentResourceId() bool { + if x == nil { + return false + } + return x.ParentResourceId != nil +} + +func (x *DeleteResourceRequest) ClearResourceId() { + x.ResourceId = nil +} + +func (x *DeleteResourceRequest) ClearParentResourceId() { + x.ParentResourceId = nil +} + +type DeleteResourceRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceId *ResourceId + ParentResourceId *ResourceId +} + +func (b0 DeleteResourceRequest_builder) Build() *DeleteResourceRequest { + m0 := &DeleteResourceRequest{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceId = b.ResourceId + x.ParentResourceId = b.ParentResourceId + return m0 +} + type DeleteResourceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -544,11 +756,6 @@ func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteResourceResponse.ProtoReflect.Descriptor instead. -func (*DeleteResourceResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{6} -} - func (x *DeleteResourceResponse) GetAnnotations() []*anypb.Any { if x != nil { return x.Annotations @@ -556,8 +763,26 @@ func (x *DeleteResourceResponse) GetAnnotations() []*anypb.Any { return nil } +func (x *DeleteResourceResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +type DeleteResourceResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Annotations []*anypb.Any +} + +func (b0 DeleteResourceResponse_builder) Build() *DeleteResourceResponse { + m0 := &DeleteResourceResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Annotations = b.Annotations + return m0 +} + type DeleteResourceV2Request struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` unknownFields protoimpl.UnknownFields @@ -589,11 +814,6 @@ func (x *DeleteResourceV2Request) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteResourceV2Request.ProtoReflect.Descriptor instead. -func (*DeleteResourceV2Request) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{7} -} - func (x *DeleteResourceV2Request) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -608,8 +828,54 @@ func (x *DeleteResourceV2Request) GetParentResourceId() *ResourceId { return nil } +func (x *DeleteResourceV2Request) SetResourceId(v *ResourceId) { + x.ResourceId = v +} + +func (x *DeleteResourceV2Request) SetParentResourceId(v *ResourceId) { + x.ParentResourceId = v +} + +func (x *DeleteResourceV2Request) HasResourceId() bool { + if x == nil { + return false + } + return x.ResourceId != nil +} + +func (x *DeleteResourceV2Request) HasParentResourceId() bool { + if x == nil { + return false + } + return x.ParentResourceId != nil +} + +func (x *DeleteResourceV2Request) ClearResourceId() { + x.ResourceId = nil +} + +func (x *DeleteResourceV2Request) ClearParentResourceId() { + x.ParentResourceId = nil +} + +type DeleteResourceV2Request_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceId *ResourceId + ParentResourceId *ResourceId +} + +func (b0 DeleteResourceV2Request_builder) Build() *DeleteResourceV2Request { + m0 := &DeleteResourceV2Request{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceId = b.ResourceId + x.ParentResourceId = b.ParentResourceId + return m0 +} + type DeleteResourceV2Response struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Annotations []*anypb.Any `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -640,11 +906,6 @@ func (x *DeleteResourceV2Response) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteResourceV2Response.ProtoReflect.Descriptor instead. -func (*DeleteResourceV2Response) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{8} -} - func (x *DeleteResourceV2Response) GetAnnotations() []*anypb.Any { if x != nil { return x.Annotations @@ -652,8 +913,26 @@ func (x *DeleteResourceV2Response) GetAnnotations() []*anypb.Any { return nil } +func (x *DeleteResourceV2Response) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +type DeleteResourceV2Response_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Annotations []*anypb.Any +} + +func (b0 DeleteResourceV2Response_builder) Build() *DeleteResourceV2Response { + m0 := &DeleteResourceV2Response{} + b, x := &b0, m0 + _, _ = b, x + x.Annotations = b.Annotations + return m0 +} + type RotateCredentialRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` @@ -686,11 +965,6 @@ func (x *RotateCredentialRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RotateCredentialRequest.ProtoReflect.Descriptor instead. -func (*RotateCredentialRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{9} -} - func (x *RotateCredentialRequest) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -712,8 +986,60 @@ func (x *RotateCredentialRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } +func (x *RotateCredentialRequest) SetResourceId(v *ResourceId) { + x.ResourceId = v +} + +func (x *RotateCredentialRequest) SetCredentialOptions(v *CredentialOptions) { + x.CredentialOptions = v +} + +func (x *RotateCredentialRequest) SetEncryptionConfigs(v []*EncryptionConfig) { + x.EncryptionConfigs = v +} + +func (x *RotateCredentialRequest) HasResourceId() bool { + if x == nil { + return false + } + return x.ResourceId != nil +} + +func (x *RotateCredentialRequest) HasCredentialOptions() bool { + if x == nil { + return false + } + return x.CredentialOptions != nil +} + +func (x *RotateCredentialRequest) ClearResourceId() { + x.ResourceId = nil +} + +func (x *RotateCredentialRequest) ClearCredentialOptions() { + x.CredentialOptions = nil +} + +type RotateCredentialRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceId *ResourceId + CredentialOptions *CredentialOptions + EncryptionConfigs []*EncryptionConfig +} + +func (b0 RotateCredentialRequest_builder) Build() *RotateCredentialRequest { + m0 := &RotateCredentialRequest{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceId = b.ResourceId + x.CredentialOptions = b.CredentialOptions + x.EncryptionConfigs = b.EncryptionConfigs + return m0 +} + type RotateCredentialResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` EncryptedData []*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` ResourceId *ResourceId `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -746,11 +1072,6 @@ func (x *RotateCredentialResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RotateCredentialResponse.ProtoReflect.Descriptor instead. -func (*RotateCredentialResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{10} -} - func (x *RotateCredentialResponse) GetEncryptedData() []*EncryptedData { if x != nil { return x.EncryptedData @@ -772,8 +1093,49 @@ func (x *RotateCredentialResponse) GetAnnotations() []*anypb.Any { return nil } +func (x *RotateCredentialResponse) SetEncryptedData(v []*EncryptedData) { + x.EncryptedData = v +} + +func (x *RotateCredentialResponse) SetResourceId(v *ResourceId) { + x.ResourceId = v +} + +func (x *RotateCredentialResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *RotateCredentialResponse) HasResourceId() bool { + if x == nil { + return false + } + return x.ResourceId != nil +} + +func (x *RotateCredentialResponse) ClearResourceId() { + x.ResourceId = nil +} + +type RotateCredentialResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + EncryptedData []*EncryptedData + ResourceId *ResourceId + Annotations []*anypb.Any +} + +func (b0 RotateCredentialResponse_builder) Build() *RotateCredentialResponse { + m0 := &RotateCredentialResponse{} + b, x := &b0, m0 + _, _ = b, x + x.EncryptedData = b.EncryptedData + x.ResourceId = b.ResourceId + x.Annotations = b.Annotations + return m0 +} + type AccountInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Emails []*AccountInfo_Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` // The user's login Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` @@ -809,11 +1171,6 @@ func (x *AccountInfo) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AccountInfo.ProtoReflect.Descriptor instead. -func (*AccountInfo) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{11} -} - func (x *AccountInfo) GetEmails() []*AccountInfo_Email { if x != nil { return x.Emails @@ -842,8 +1199,57 @@ func (x *AccountInfo) GetProfile() *structpb.Struct { return nil } +func (x *AccountInfo) SetEmails(v []*AccountInfo_Email) { + x.Emails = v +} + +func (x *AccountInfo) SetLogin(v string) { + x.Login = v +} + +func (x *AccountInfo) SetLoginAliases(v []string) { + x.LoginAliases = v +} + +func (x *AccountInfo) SetProfile(v *structpb.Struct) { + x.Profile = v +} + +func (x *AccountInfo) HasProfile() bool { + if x == nil { + return false + } + return x.Profile != nil +} + +func (x *AccountInfo) ClearProfile() { + x.Profile = nil +} + +type AccountInfo_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Emails []*AccountInfo_Email + // The user's login + Login string + // Any additional login aliases for the user + LoginAliases []string + Profile *structpb.Struct +} + +func (b0 AccountInfo_builder) Build() *AccountInfo { + m0 := &AccountInfo{} + b, x := &b0, m0 + _, _ = b, x + x.Emails = b.Emails + x.Login = b.Login + x.LoginAliases = b.LoginAliases + x.Profile = b.Profile + return m0 +} + type CredentialOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` // Types that are valid to be assigned to Options: // // *CredentialOptions_RandomPassword_ @@ -881,11 +1287,6 @@ func (x *CredentialOptions) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CredentialOptions.ProtoReflect.Descriptor instead. -func (*CredentialOptions) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12} -} - func (x *CredentialOptions) GetOptions() isCredentialOptions_Options { if x != nil { return x.Options @@ -936,41 +1337,210 @@ func (x *CredentialOptions) GetForceChangeAtNextLogin() bool { return false } -type isCredentialOptions_Options interface { - isCredentialOptions_Options() +func (x *CredentialOptions) SetRandomPassword(v *CredentialOptions_RandomPassword) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialOptions_RandomPassword_{v} } -type CredentialOptions_RandomPassword_ struct { - RandomPassword *CredentialOptions_RandomPassword `protobuf:"bytes,100,opt,name=random_password,json=randomPassword,proto3,oneof"` +func (x *CredentialOptions) SetNoPassword(v *CredentialOptions_NoPassword) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialOptions_NoPassword_{v} } -type CredentialOptions_NoPassword_ struct { - NoPassword *CredentialOptions_NoPassword `protobuf:"bytes,101,opt,name=no_password,json=noPassword,proto3,oneof"` +func (x *CredentialOptions) SetSso(v *CredentialOptions_SSO) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialOptions_Sso{v} } -type CredentialOptions_Sso struct { - Sso *CredentialOptions_SSO `protobuf:"bytes,102,opt,name=sso,proto3,oneof"` +func (x *CredentialOptions) SetEncryptedPassword(v *CredentialOptions_EncryptedPassword) { + if v == nil { + x.Options = nil + return + } + x.Options = &CredentialOptions_EncryptedPassword_{v} } -type CredentialOptions_EncryptedPassword_ struct { - EncryptedPassword *CredentialOptions_EncryptedPassword `protobuf:"bytes,103,opt,name=encrypted_password,json=encryptedPassword,proto3,oneof"` +func (x *CredentialOptions) SetForceChangeAtNextLogin(v bool) { + x.ForceChangeAtNextLogin = v } -func (*CredentialOptions_RandomPassword_) isCredentialOptions_Options() {} +func (x *CredentialOptions) HasOptions() bool { + if x == nil { + return false + } + return x.Options != nil +} -func (*CredentialOptions_NoPassword_) isCredentialOptions_Options() {} +func (x *CredentialOptions) HasRandomPassword() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialOptions_RandomPassword_) + return ok +} -func (*CredentialOptions_Sso) isCredentialOptions_Options() {} +func (x *CredentialOptions) HasNoPassword() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialOptions_NoPassword_) + return ok +} -func (*CredentialOptions_EncryptedPassword_) isCredentialOptions_Options() {} +func (x *CredentialOptions) HasSso() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialOptions_Sso) + return ok +} -// Do not use this in any RPC or any message that is in an RPC. -type LocalCredentialOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Options: - // - // *LocalCredentialOptions_RandomPassword_ - // *LocalCredentialOptions_NoPassword_ +func (x *CredentialOptions) HasEncryptedPassword() bool { + if x == nil { + return false + } + _, ok := x.Options.(*CredentialOptions_EncryptedPassword_) + return ok +} + +func (x *CredentialOptions) ClearOptions() { + x.Options = nil +} + +func (x *CredentialOptions) ClearRandomPassword() { + if _, ok := x.Options.(*CredentialOptions_RandomPassword_); ok { + x.Options = nil + } +} + +func (x *CredentialOptions) ClearNoPassword() { + if _, ok := x.Options.(*CredentialOptions_NoPassword_); ok { + x.Options = nil + } +} + +func (x *CredentialOptions) ClearSso() { + if _, ok := x.Options.(*CredentialOptions_Sso); ok { + x.Options = nil + } +} + +func (x *CredentialOptions) ClearEncryptedPassword() { + if _, ok := x.Options.(*CredentialOptions_EncryptedPassword_); ok { + x.Options = nil + } +} + +const CredentialOptions_Options_not_set_case case_CredentialOptions_Options = 0 +const CredentialOptions_RandomPassword_case case_CredentialOptions_Options = 100 +const CredentialOptions_NoPassword_case case_CredentialOptions_Options = 101 +const CredentialOptions_Sso_case case_CredentialOptions_Options = 102 +const CredentialOptions_EncryptedPassword_case case_CredentialOptions_Options = 103 + +func (x *CredentialOptions) WhichOptions() case_CredentialOptions_Options { + if x == nil { + return CredentialOptions_Options_not_set_case + } + switch x.Options.(type) { + case *CredentialOptions_RandomPassword_: + return CredentialOptions_RandomPassword_case + case *CredentialOptions_NoPassword_: + return CredentialOptions_NoPassword_case + case *CredentialOptions_Sso: + return CredentialOptions_Sso_case + case *CredentialOptions_EncryptedPassword_: + return CredentialOptions_EncryptedPassword_case + default: + return CredentialOptions_Options_not_set_case + } +} + +type CredentialOptions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Fields of oneof Options: + RandomPassword *CredentialOptions_RandomPassword + NoPassword *CredentialOptions_NoPassword + Sso *CredentialOptions_SSO + EncryptedPassword *CredentialOptions_EncryptedPassword + // -- end of Options + ForceChangeAtNextLogin bool +} + +func (b0 CredentialOptions_builder) Build() *CredentialOptions { + m0 := &CredentialOptions{} + b, x := &b0, m0 + _, _ = b, x + if b.RandomPassword != nil { + x.Options = &CredentialOptions_RandomPassword_{b.RandomPassword} + } + if b.NoPassword != nil { + x.Options = &CredentialOptions_NoPassword_{b.NoPassword} + } + if b.Sso != nil { + x.Options = &CredentialOptions_Sso{b.Sso} + } + if b.EncryptedPassword != nil { + x.Options = &CredentialOptions_EncryptedPassword_{b.EncryptedPassword} + } + x.ForceChangeAtNextLogin = b.ForceChangeAtNextLogin + return m0 +} + +type case_CredentialOptions_Options protoreflect.FieldNumber + +func (x case_CredentialOptions_Options) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[12].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isCredentialOptions_Options interface { + isCredentialOptions_Options() +} + +type CredentialOptions_RandomPassword_ struct { + RandomPassword *CredentialOptions_RandomPassword `protobuf:"bytes,100,opt,name=random_password,json=randomPassword,proto3,oneof"` +} + +type CredentialOptions_NoPassword_ struct { + NoPassword *CredentialOptions_NoPassword `protobuf:"bytes,101,opt,name=no_password,json=noPassword,proto3,oneof"` +} + +type CredentialOptions_Sso struct { + Sso *CredentialOptions_SSO `protobuf:"bytes,102,opt,name=sso,proto3,oneof"` +} + +type CredentialOptions_EncryptedPassword_ struct { + EncryptedPassword *CredentialOptions_EncryptedPassword `protobuf:"bytes,103,opt,name=encrypted_password,json=encryptedPassword,proto3,oneof"` +} + +func (*CredentialOptions_RandomPassword_) isCredentialOptions_Options() {} + +func (*CredentialOptions_NoPassword_) isCredentialOptions_Options() {} + +func (*CredentialOptions_Sso) isCredentialOptions_Options() {} + +func (*CredentialOptions_EncryptedPassword_) isCredentialOptions_Options() {} + +// Do not use this in any RPC or any message that is in an RPC. +type LocalCredentialOptions struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Types that are valid to be assigned to Options: + // + // *LocalCredentialOptions_RandomPassword_ + // *LocalCredentialOptions_NoPassword_ // *LocalCredentialOptions_Sso // *LocalCredentialOptions_PlaintextPassword_ Options isLocalCredentialOptions_Options `protobuf_oneof:"options"` @@ -1004,11 +1574,6 @@ func (x *LocalCredentialOptions) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LocalCredentialOptions.ProtoReflect.Descriptor instead. -func (*LocalCredentialOptions) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13} -} - func (x *LocalCredentialOptions) GetOptions() isLocalCredentialOptions_Options { if x != nil { return x.Options @@ -1059,6 +1624,175 @@ func (x *LocalCredentialOptions) GetForceChangeAtNextLogin() bool { return false } +func (x *LocalCredentialOptions) SetRandomPassword(v *LocalCredentialOptions_RandomPassword) { + if v == nil { + x.Options = nil + return + } + x.Options = &LocalCredentialOptions_RandomPassword_{v} +} + +func (x *LocalCredentialOptions) SetNoPassword(v *LocalCredentialOptions_NoPassword) { + if v == nil { + x.Options = nil + return + } + x.Options = &LocalCredentialOptions_NoPassword_{v} +} + +func (x *LocalCredentialOptions) SetSso(v *LocalCredentialOptions_SSO) { + if v == nil { + x.Options = nil + return + } + x.Options = &LocalCredentialOptions_Sso{v} +} + +func (x *LocalCredentialOptions) SetPlaintextPassword(v *LocalCredentialOptions_PlaintextPassword) { + if v == nil { + x.Options = nil + return + } + x.Options = &LocalCredentialOptions_PlaintextPassword_{v} +} + +func (x *LocalCredentialOptions) SetForceChangeAtNextLogin(v bool) { + x.ForceChangeAtNextLogin = v +} + +func (x *LocalCredentialOptions) HasOptions() bool { + if x == nil { + return false + } + return x.Options != nil +} + +func (x *LocalCredentialOptions) HasRandomPassword() bool { + if x == nil { + return false + } + _, ok := x.Options.(*LocalCredentialOptions_RandomPassword_) + return ok +} + +func (x *LocalCredentialOptions) HasNoPassword() bool { + if x == nil { + return false + } + _, ok := x.Options.(*LocalCredentialOptions_NoPassword_) + return ok +} + +func (x *LocalCredentialOptions) HasSso() bool { + if x == nil { + return false + } + _, ok := x.Options.(*LocalCredentialOptions_Sso) + return ok +} + +func (x *LocalCredentialOptions) HasPlaintextPassword() bool { + if x == nil { + return false + } + _, ok := x.Options.(*LocalCredentialOptions_PlaintextPassword_) + return ok +} + +func (x *LocalCredentialOptions) ClearOptions() { + x.Options = nil +} + +func (x *LocalCredentialOptions) ClearRandomPassword() { + if _, ok := x.Options.(*LocalCredentialOptions_RandomPassword_); ok { + x.Options = nil + } +} + +func (x *LocalCredentialOptions) ClearNoPassword() { + if _, ok := x.Options.(*LocalCredentialOptions_NoPassword_); ok { + x.Options = nil + } +} + +func (x *LocalCredentialOptions) ClearSso() { + if _, ok := x.Options.(*LocalCredentialOptions_Sso); ok { + x.Options = nil + } +} + +func (x *LocalCredentialOptions) ClearPlaintextPassword() { + if _, ok := x.Options.(*LocalCredentialOptions_PlaintextPassword_); ok { + x.Options = nil + } +} + +const LocalCredentialOptions_Options_not_set_case case_LocalCredentialOptions_Options = 0 +const LocalCredentialOptions_RandomPassword_case case_LocalCredentialOptions_Options = 100 +const LocalCredentialOptions_NoPassword_case case_LocalCredentialOptions_Options = 101 +const LocalCredentialOptions_Sso_case case_LocalCredentialOptions_Options = 102 +const LocalCredentialOptions_PlaintextPassword_case case_LocalCredentialOptions_Options = 103 + +func (x *LocalCredentialOptions) WhichOptions() case_LocalCredentialOptions_Options { + if x == nil { + return LocalCredentialOptions_Options_not_set_case + } + switch x.Options.(type) { + case *LocalCredentialOptions_RandomPassword_: + return LocalCredentialOptions_RandomPassword_case + case *LocalCredentialOptions_NoPassword_: + return LocalCredentialOptions_NoPassword_case + case *LocalCredentialOptions_Sso: + return LocalCredentialOptions_Sso_case + case *LocalCredentialOptions_PlaintextPassword_: + return LocalCredentialOptions_PlaintextPassword_case + default: + return LocalCredentialOptions_Options_not_set_case + } +} + +type LocalCredentialOptions_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Fields of oneof Options: + RandomPassword *LocalCredentialOptions_RandomPassword + NoPassword *LocalCredentialOptions_NoPassword + Sso *LocalCredentialOptions_SSO + PlaintextPassword *LocalCredentialOptions_PlaintextPassword + // -- end of Options + ForceChangeAtNextLogin bool +} + +func (b0 LocalCredentialOptions_builder) Build() *LocalCredentialOptions { + m0 := &LocalCredentialOptions{} + b, x := &b0, m0 + _, _ = b, x + if b.RandomPassword != nil { + x.Options = &LocalCredentialOptions_RandomPassword_{b.RandomPassword} + } + if b.NoPassword != nil { + x.Options = &LocalCredentialOptions_NoPassword_{b.NoPassword} + } + if b.Sso != nil { + x.Options = &LocalCredentialOptions_Sso{b.Sso} + } + if b.PlaintextPassword != nil { + x.Options = &LocalCredentialOptions_PlaintextPassword_{b.PlaintextPassword} + } + x.ForceChangeAtNextLogin = b.ForceChangeAtNextLogin + return m0 +} + +type case_LocalCredentialOptions_Options protoreflect.FieldNumber + +func (x case_LocalCredentialOptions_Options) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[13].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + type isLocalCredentialOptions_Options interface { isLocalCredentialOptions_Options() } @@ -1088,7 +1822,7 @@ func (*LocalCredentialOptions_Sso) isLocalCredentialOptions_Options() {} func (*LocalCredentialOptions_PlaintextPassword_) isLocalCredentialOptions_Options() {} type PasswordConstraint struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` CharSet string `protobuf:"bytes,1,opt,name=char_set,json=charSet,proto3" json:"char_set,omitempty"` MinCount uint32 `protobuf:"varint,2,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"` unknownFields protoimpl.UnknownFields @@ -1120,11 +1854,6 @@ func (x *PasswordConstraint) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PasswordConstraint.ProtoReflect.Descriptor instead. -func (*PasswordConstraint) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{14} -} - func (x *PasswordConstraint) GetCharSet() string { if x != nil { return x.CharSet @@ -1139,8 +1868,32 @@ func (x *PasswordConstraint) GetMinCount() uint32 { return 0 } +func (x *PasswordConstraint) SetCharSet(v string) { + x.CharSet = v +} + +func (x *PasswordConstraint) SetMinCount(v uint32) { + x.MinCount = v +} + +type PasswordConstraint_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + CharSet string + MinCount uint32 +} + +func (b0 PasswordConstraint_builder) Build() *PasswordConstraint { + m0 := &PasswordConstraint{} + b, x := &b0, m0 + _, _ = b, x + x.CharSet = b.CharSet + x.MinCount = b.MinCount + return m0 +} + type CreateAccountRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` AccountInfo *AccountInfo `protobuf:"bytes,1,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` CredentialOptions *CredentialOptions `protobuf:"bytes,2,opt,name=credential_options,json=credentialOptions,proto3" json:"credential_options,omitempty"` EncryptionConfigs []*EncryptionConfig `protobuf:"bytes,3,rep,name=encryption_configs,json=encryptionConfigs,proto3" json:"encryption_configs,omitempty"` @@ -1173,11 +1926,6 @@ func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateAccountRequest.ProtoReflect.Descriptor instead. -func (*CreateAccountRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{15} -} - func (x *CreateAccountRequest) GetAccountInfo() *AccountInfo { if x != nil { return x.AccountInfo @@ -1199,8 +1947,60 @@ func (x *CreateAccountRequest) GetEncryptionConfigs() []*EncryptionConfig { return nil } +func (x *CreateAccountRequest) SetAccountInfo(v *AccountInfo) { + x.AccountInfo = v +} + +func (x *CreateAccountRequest) SetCredentialOptions(v *CredentialOptions) { + x.CredentialOptions = v +} + +func (x *CreateAccountRequest) SetEncryptionConfigs(v []*EncryptionConfig) { + x.EncryptionConfigs = v +} + +func (x *CreateAccountRequest) HasAccountInfo() bool { + if x == nil { + return false + } + return x.AccountInfo != nil +} + +func (x *CreateAccountRequest) HasCredentialOptions() bool { + if x == nil { + return false + } + return x.CredentialOptions != nil +} + +func (x *CreateAccountRequest) ClearAccountInfo() { + x.AccountInfo = nil +} + +func (x *CreateAccountRequest) ClearCredentialOptions() { + x.CredentialOptions = nil +} + +type CreateAccountRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + AccountInfo *AccountInfo + CredentialOptions *CredentialOptions + EncryptionConfigs []*EncryptionConfig +} + +func (b0 CreateAccountRequest_builder) Build() *CreateAccountRequest { + m0 := &CreateAccountRequest{} + b, x := &b0, m0 + _, _ = b, x + x.AccountInfo = b.AccountInfo + x.CredentialOptions = b.CredentialOptions + x.EncryptionConfigs = b.EncryptionConfigs + return m0 +} + type CreateAccountResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` // Types that are valid to be assigned to Result: // // *CreateAccountResponse_Success @@ -1237,11 +2037,6 @@ func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateAccountResponse.ProtoReflect.Descriptor instead. -func (*CreateAccountResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16} -} - func (x *CreateAccountResponse) GetResult() isCreateAccountResponse_Result { if x != nil { return x.Result @@ -1281,6 +2076,123 @@ func (x *CreateAccountResponse) GetAnnotations() []*anypb.Any { return nil } +func (x *CreateAccountResponse) SetSuccess(v *CreateAccountResponse_SuccessResult) { + if v == nil { + x.Result = nil + return + } + x.Result = &CreateAccountResponse_Success{v} +} + +func (x *CreateAccountResponse) SetActionRequired(v *CreateAccountResponse_ActionRequiredResult) { + if v == nil { + x.Result = nil + return + } + x.Result = &CreateAccountResponse_ActionRequired{v} +} + +func (x *CreateAccountResponse) SetEncryptedData(v []*EncryptedData) { + x.EncryptedData = v +} + +func (x *CreateAccountResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *CreateAccountResponse) HasResult() bool { + if x == nil { + return false + } + return x.Result != nil +} + +func (x *CreateAccountResponse) HasSuccess() bool { + if x == nil { + return false + } + _, ok := x.Result.(*CreateAccountResponse_Success) + return ok +} + +func (x *CreateAccountResponse) HasActionRequired() bool { + if x == nil { + return false + } + _, ok := x.Result.(*CreateAccountResponse_ActionRequired) + return ok +} + +func (x *CreateAccountResponse) ClearResult() { + x.Result = nil +} + +func (x *CreateAccountResponse) ClearSuccess() { + if _, ok := x.Result.(*CreateAccountResponse_Success); ok { + x.Result = nil + } +} + +func (x *CreateAccountResponse) ClearActionRequired() { + if _, ok := x.Result.(*CreateAccountResponse_ActionRequired); ok { + x.Result = nil + } +} + +const CreateAccountResponse_Result_not_set_case case_CreateAccountResponse_Result = 0 +const CreateAccountResponse_Success_case case_CreateAccountResponse_Result = 100 +const CreateAccountResponse_ActionRequired_case case_CreateAccountResponse_Result = 101 + +func (x *CreateAccountResponse) WhichResult() case_CreateAccountResponse_Result { + if x == nil { + return CreateAccountResponse_Result_not_set_case + } + switch x.Result.(type) { + case *CreateAccountResponse_Success: + return CreateAccountResponse_Success_case + case *CreateAccountResponse_ActionRequired: + return CreateAccountResponse_ActionRequired_case + default: + return CreateAccountResponse_Result_not_set_case + } +} + +type CreateAccountResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Fields of oneof Result: + Success *CreateAccountResponse_SuccessResult + ActionRequired *CreateAccountResponse_ActionRequiredResult + // -- end of Result + EncryptedData []*EncryptedData + Annotations []*anypb.Any +} + +func (b0 CreateAccountResponse_builder) Build() *CreateAccountResponse { + m0 := &CreateAccountResponse{} + b, x := &b0, m0 + _, _ = b, x + if b.Success != nil { + x.Result = &CreateAccountResponse_Success{b.Success} + } + if b.ActionRequired != nil { + x.Result = &CreateAccountResponse_ActionRequired{b.ActionRequired} + } + x.EncryptedData = b.EncryptedData + x.Annotations = b.Annotations + return m0 +} + +type case_CreateAccountResponse_Result protoreflect.FieldNumber + +func (x case_CreateAccountResponse_Result) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[16].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + type isCreateAccountResponse_Result interface { isCreateAccountResponse_Result() } @@ -1298,7 +2210,7 @@ func (*CreateAccountResponse_Success) isCreateAccountResponse_Result() {} func (*CreateAccountResponse_ActionRequired) isCreateAccountResponse_Result() {} type EncryptedData struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` @@ -1336,11 +2248,6 @@ func (x *EncryptedData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EncryptedData.ProtoReflect.Descriptor instead. -func (*EncryptedData) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{17} -} - func (x *EncryptedData) GetProvider() string { if x != nil { return x.Provider @@ -1391,8 +2298,67 @@ func (x *EncryptedData) GetKeyIds() []string { return nil } +func (x *EncryptedData) SetProvider(v string) { + x.Provider = v +} + +// Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. +func (x *EncryptedData) SetKeyId(v string) { + x.KeyId = v +} + +func (x *EncryptedData) SetName(v string) { + x.Name = v +} + +func (x *EncryptedData) SetDescription(v string) { + x.Description = v +} + +func (x *EncryptedData) SetSchema(v string) { + x.Schema = v +} + +func (x *EncryptedData) SetEncryptedBytes(v []byte) { + if v == nil { + v = []byte{} + } + x.EncryptedBytes = v +} + +func (x *EncryptedData) SetKeyIds(v []string) { + x.KeyIds = v +} + +type EncryptedData_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Provider string + // Deprecated: Marked as deprecated in c1/connector/v2/resource.proto. + KeyId string + Name string + Description string + Schema string + EncryptedBytes []byte + KeyIds []string +} + +func (b0 EncryptedData_builder) Build() *EncryptedData { + m0 := &EncryptedData{} + b, x := &b0, m0 + _, _ = b, x + x.Provider = b.Provider + x.KeyId = b.KeyId + x.Name = b.Name + x.Description = b.Description + x.Schema = b.Schema + x.EncryptedBytes = b.EncryptedBytes + x.KeyIds = b.KeyIds + return m0 +} + type PlaintextData struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` Schema string `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` // optional @@ -1426,11 +2392,6 @@ func (x *PlaintextData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PlaintextData.ProtoReflect.Descriptor instead. -func (*PlaintextData) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{18} -} - func (x *PlaintextData) GetName() string { if x != nil { return x.Name @@ -1459,8 +2420,47 @@ func (x *PlaintextData) GetBytes() []byte { return nil } +func (x *PlaintextData) SetName(v string) { + x.Name = v +} + +func (x *PlaintextData) SetDescription(v string) { + x.Description = v +} + +func (x *PlaintextData) SetSchema(v string) { + x.Schema = v +} + +func (x *PlaintextData) SetBytes(v []byte) { + if v == nil { + v = []byte{} + } + x.Bytes = v +} + +type PlaintextData_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Name string + Description string + Schema string + Bytes []byte +} + +func (b0 PlaintextData_builder) Build() *PlaintextData { + m0 := &PlaintextData{} + b, x := &b0, m0 + _, _ = b, x + x.Name = b.Name + x.Description = b.Description + x.Schema = b.Schema + x.Bytes = b.Bytes + return m0 +} + type EncryptionConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Principal *Resource `protobuf:"bytes,1,opt,name=principal,proto3" json:"principal,omitempty"` Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` @@ -1497,11 +2497,6 @@ func (x *EncryptionConfig) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EncryptionConfig.ProtoReflect.Descriptor instead. -func (*EncryptionConfig) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19} -} - func (x *EncryptionConfig) GetPrincipal() *Resource { if x != nil { return x.Principal @@ -1539,6 +2534,111 @@ func (x *EncryptionConfig) GetJwkPublicKeyConfig() *EncryptionConfig_JWKPublicKe return nil } +func (x *EncryptionConfig) SetPrincipal(v *Resource) { + x.Principal = v +} + +func (x *EncryptionConfig) SetProvider(v string) { + x.Provider = v +} + +func (x *EncryptionConfig) SetKeyId(v string) { + x.KeyId = v +} + +func (x *EncryptionConfig) SetJwkPublicKeyConfig(v *EncryptionConfig_JWKPublicKeyConfig) { + if v == nil { + x.Config = nil + return + } + x.Config = &EncryptionConfig_JwkPublicKeyConfig{v} +} + +func (x *EncryptionConfig) HasPrincipal() bool { + if x == nil { + return false + } + return x.Principal != nil +} + +func (x *EncryptionConfig) HasConfig() bool { + if x == nil { + return false + } + return x.Config != nil +} + +func (x *EncryptionConfig) HasJwkPublicKeyConfig() bool { + if x == nil { + return false + } + _, ok := x.Config.(*EncryptionConfig_JwkPublicKeyConfig) + return ok +} + +func (x *EncryptionConfig) ClearPrincipal() { + x.Principal = nil +} + +func (x *EncryptionConfig) ClearConfig() { + x.Config = nil +} + +func (x *EncryptionConfig) ClearJwkPublicKeyConfig() { + if _, ok := x.Config.(*EncryptionConfig_JwkPublicKeyConfig); ok { + x.Config = nil + } +} + +const EncryptionConfig_Config_not_set_case case_EncryptionConfig_Config = 0 +const EncryptionConfig_JwkPublicKeyConfig_case case_EncryptionConfig_Config = 100 + +func (x *EncryptionConfig) WhichConfig() case_EncryptionConfig_Config { + if x == nil { + return EncryptionConfig_Config_not_set_case + } + switch x.Config.(type) { + case *EncryptionConfig_JwkPublicKeyConfig: + return EncryptionConfig_JwkPublicKeyConfig_case + default: + return EncryptionConfig_Config_not_set_case + } +} + +type EncryptionConfig_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Principal *Resource + Provider string + KeyId string + // Fields of oneof Config: + JwkPublicKeyConfig *EncryptionConfig_JWKPublicKeyConfig + // -- end of Config +} + +func (b0 EncryptionConfig_builder) Build() *EncryptionConfig { + m0 := &EncryptionConfig{} + b, x := &b0, m0 + _, _ = b, x + x.Principal = b.Principal + x.Provider = b.Provider + x.KeyId = b.KeyId + if b.JwkPublicKeyConfig != nil { + x.Config = &EncryptionConfig_JwkPublicKeyConfig{b.JwkPublicKeyConfig} + } + return m0 +} + +type case_EncryptionConfig_Config protoreflect.FieldNumber + +func (x case_EncryptionConfig_Config) String() string { + md := file_c1_connector_v2_resource_proto_msgTypes[19].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + type isEncryptionConfig_Config interface { isEncryptionConfig_Config() } @@ -1550,7 +2650,7 @@ type EncryptionConfig_JwkPublicKeyConfig struct { func (*EncryptionConfig_JwkPublicKeyConfig) isEncryptionConfig_Config() {} type ResourceId struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` BatonResource bool `protobuf:"varint,3,opt,name=baton_resource,json=batonResource,proto3" json:"baton_resource,omitempty"` @@ -1583,11 +2683,6 @@ func (x *ResourceId) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ResourceId.ProtoReflect.Descriptor instead. -func (*ResourceId) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{20} -} - func (x *ResourceId) GetResourceType() string { if x != nil { return x.ResourceType @@ -1602,15 +2697,45 @@ func (x *ResourceId) GetResource() string { return "" } -func (x *ResourceId) GetBatonResource() bool { - if x != nil { - return x.BatonResource - } - return false +func (x *ResourceId) GetBatonResource() bool { + if x != nil { + return x.BatonResource + } + return false +} + +func (x *ResourceId) SetResourceType(v string) { + x.ResourceType = v +} + +func (x *ResourceId) SetResource(v string) { + x.Resource = v +} + +func (x *ResourceId) SetBatonResource(v bool) { + x.BatonResource = v +} + +type ResourceId_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceType string + Resource string + BatonResource bool +} + +func (b0 ResourceId_builder) Build() *ResourceId { + m0 := &ResourceId{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceType = b.ResourceType + x.Resource = b.Resource + x.BatonResource = b.BatonResource + return m0 } type Resource struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Id *ResourceId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` @@ -1648,11 +2773,6 @@ func (x *Resource) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Resource.ProtoReflect.Descriptor instead. -func (*Resource) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{21} -} - func (x *Resource) GetId() *ResourceId { if x != nil { return x.Id @@ -1709,8 +2829,101 @@ func (x *Resource) GetCreationSource() Resource_CreationSource { return Resource_CREATION_SOURCE_UNSPECIFIED } +func (x *Resource) SetId(v *ResourceId) { + x.Id = v +} + +func (x *Resource) SetParentResourceId(v *ResourceId) { + x.ParentResourceId = v +} + +func (x *Resource) SetDisplayName(v string) { + x.DisplayName = v +} + +func (x *Resource) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *Resource) SetDescription(v string) { + x.Description = v +} + +func (x *Resource) SetBatonResource(v bool) { + x.BatonResource = v +} + +func (x *Resource) SetExternalId(v *ExternalId) { + x.ExternalId = v +} + +func (x *Resource) SetCreationSource(v Resource_CreationSource) { + x.CreationSource = v +} + +func (x *Resource) HasId() bool { + if x == nil { + return false + } + return x.Id != nil +} + +func (x *Resource) HasParentResourceId() bool { + if x == nil { + return false + } + return x.ParentResourceId != nil +} + +func (x *Resource) HasExternalId() bool { + if x == nil { + return false + } + return x.ExternalId != nil +} + +func (x *Resource) ClearId() { + x.Id = nil +} + +func (x *Resource) ClearParentResourceId() { + x.ParentResourceId = nil +} + +func (x *Resource) ClearExternalId() { + x.ExternalId = nil +} + +type Resource_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id *ResourceId + ParentResourceId *ResourceId + DisplayName string + Annotations []*anypb.Any + Description string + BatonResource bool + ExternalId *ExternalId + CreationSource Resource_CreationSource +} + +func (b0 Resource_builder) Build() *Resource { + m0 := &Resource{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.ParentResourceId = b.ParentResourceId + x.DisplayName = b.DisplayName + x.Annotations = b.Annotations + x.Description = b.Description + x.BatonResource = b.BatonResource + x.ExternalId = b.ExternalId + x.CreationSource = b.CreationSource + return m0 +} + type ResourcesServiceListResourcesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceTypeId string `protobuf:"bytes,1,opt,name=resource_type_id,json=resourceTypeId,proto3" json:"resource_type_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` @@ -1746,11 +2959,6 @@ func (x *ResourcesServiceListResourcesRequest) ProtoReflect() protoreflect.Messa return mi.MessageOf(x) } -// Deprecated: Use ResourcesServiceListResourcesRequest.ProtoReflect.Descriptor instead. -func (*ResourcesServiceListResourcesRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{22} -} - func (x *ResourcesServiceListResourcesRequest) GetResourceTypeId() string { if x != nil { return x.ResourceTypeId @@ -1793,8 +3001,67 @@ func (x *ResourcesServiceListResourcesRequest) GetActiveSyncId() string { return "" } +func (x *ResourcesServiceListResourcesRequest) SetResourceTypeId(v string) { + x.ResourceTypeId = v +} + +func (x *ResourcesServiceListResourcesRequest) SetParentResourceId(v *ResourceId) { + x.ParentResourceId = v +} + +func (x *ResourcesServiceListResourcesRequest) SetPageSize(v uint32) { + x.PageSize = v +} + +func (x *ResourcesServiceListResourcesRequest) SetPageToken(v string) { + x.PageToken = v +} + +func (x *ResourcesServiceListResourcesRequest) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *ResourcesServiceListResourcesRequest) SetActiveSyncId(v string) { + x.ActiveSyncId = v +} + +func (x *ResourcesServiceListResourcesRequest) HasParentResourceId() bool { + if x == nil { + return false + } + return x.ParentResourceId != nil +} + +func (x *ResourcesServiceListResourcesRequest) ClearParentResourceId() { + x.ParentResourceId = nil +} + +type ResourcesServiceListResourcesRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceTypeId string + ParentResourceId *ResourceId + PageSize uint32 + PageToken string + Annotations []*anypb.Any + ActiveSyncId string +} + +func (b0 ResourcesServiceListResourcesRequest_builder) Build() *ResourcesServiceListResourcesRequest { + m0 := &ResourcesServiceListResourcesRequest{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceTypeId = b.ResourceTypeId + x.ParentResourceId = b.ParentResourceId + x.PageSize = b.PageSize + x.PageToken = b.PageToken + x.Annotations = b.Annotations + x.ActiveSyncId = b.ActiveSyncId + return m0 +} + type ResourcesServiceListResourcesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` List []*Resource `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -1827,11 +3094,6 @@ func (x *ResourcesServiceListResourcesResponse) ProtoReflect() protoreflect.Mess return mi.MessageOf(x) } -// Deprecated: Use ResourcesServiceListResourcesResponse.ProtoReflect.Descriptor instead. -func (*ResourcesServiceListResourcesResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{23} -} - func (x *ResourcesServiceListResourcesResponse) GetList() []*Resource { if x != nil { return x.List @@ -1853,8 +3115,38 @@ func (x *ResourcesServiceListResourcesResponse) GetAnnotations() []*anypb.Any { return nil } +func (x *ResourcesServiceListResourcesResponse) SetList(v []*Resource) { + x.List = v +} + +func (x *ResourcesServiceListResourcesResponse) SetNextPageToken(v string) { + x.NextPageToken = v +} + +func (x *ResourcesServiceListResourcesResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +type ResourcesServiceListResourcesResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + List []*Resource + NextPageToken string + Annotations []*anypb.Any +} + +func (b0 ResourcesServiceListResourcesResponse_builder) Build() *ResourcesServiceListResourcesResponse { + m0 := &ResourcesServiceListResourcesResponse{} + b, x := &b0, m0 + _, _ = b, x + x.List = b.List + x.NextPageToken = b.NextPageToken + x.Annotations = b.Annotations + return m0 +} + type ResourceGetterServiceGetResourceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` ResourceId *ResourceId `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ParentResourceId *ResourceId `protobuf:"bytes,2,opt,name=parent_resource_id,json=parentResourceId,proto3" json:"parent_resource_id,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty"` @@ -1888,11 +3180,6 @@ func (x *ResourceGetterServiceGetResourceRequest) ProtoReflect() protoreflect.Me return mi.MessageOf(x) } -// Deprecated: Use ResourceGetterServiceGetResourceRequest.ProtoReflect.Descriptor instead. -func (*ResourceGetterServiceGetResourceRequest) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{24} -} - func (x *ResourceGetterServiceGetResourceRequest) GetResourceId() *ResourceId { if x != nil { return x.ResourceId @@ -1921,8 +3208,66 @@ func (x *ResourceGetterServiceGetResourceRequest) GetActiveSyncId() string { return "" } +func (x *ResourceGetterServiceGetResourceRequest) SetResourceId(v *ResourceId) { + x.ResourceId = v +} + +func (x *ResourceGetterServiceGetResourceRequest) SetParentResourceId(v *ResourceId) { + x.ParentResourceId = v +} + +func (x *ResourceGetterServiceGetResourceRequest) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *ResourceGetterServiceGetResourceRequest) SetActiveSyncId(v string) { + x.ActiveSyncId = v +} + +func (x *ResourceGetterServiceGetResourceRequest) HasResourceId() bool { + if x == nil { + return false + } + return x.ResourceId != nil +} + +func (x *ResourceGetterServiceGetResourceRequest) HasParentResourceId() bool { + if x == nil { + return false + } + return x.ParentResourceId != nil +} + +func (x *ResourceGetterServiceGetResourceRequest) ClearResourceId() { + x.ResourceId = nil +} + +func (x *ResourceGetterServiceGetResourceRequest) ClearParentResourceId() { + x.ParentResourceId = nil +} + +type ResourceGetterServiceGetResourceRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + ResourceId *ResourceId + ParentResourceId *ResourceId + Annotations []*anypb.Any + ActiveSyncId string +} + +func (b0 ResourceGetterServiceGetResourceRequest_builder) Build() *ResourceGetterServiceGetResourceRequest { + m0 := &ResourceGetterServiceGetResourceRequest{} + b, x := &b0, m0 + _, _ = b, x + x.ResourceId = b.ResourceId + x.ParentResourceId = b.ParentResourceId + x.Annotations = b.Annotations + x.ActiveSyncId = b.ActiveSyncId + return m0 +} + type ResourceGetterServiceGetResourceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` Annotations []*anypb.Any `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty"` unknownFields protoimpl.UnknownFields @@ -1954,11 +3299,6 @@ func (x *ResourceGetterServiceGetResourceResponse) ProtoReflect() protoreflect.M return mi.MessageOf(x) } -// Deprecated: Use ResourceGetterServiceGetResourceResponse.ProtoReflect.Descriptor instead. -func (*ResourceGetterServiceGetResourceResponse) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{25} -} - func (x *ResourceGetterServiceGetResourceResponse) GetResource() *Resource { if x != nil { return x.Resource @@ -1973,8 +3313,43 @@ func (x *ResourceGetterServiceGetResourceResponse) GetAnnotations() []*anypb.Any return nil } +func (x *ResourceGetterServiceGetResourceResponse) SetResource(v *Resource) { + x.Resource = v +} + +func (x *ResourceGetterServiceGetResourceResponse) SetAnnotations(v []*anypb.Any) { + x.Annotations = v +} + +func (x *ResourceGetterServiceGetResourceResponse) HasResource() bool { + if x == nil { + return false + } + return x.Resource != nil +} + +func (x *ResourceGetterServiceGetResourceResponse) ClearResource() { + x.Resource = nil +} + +type ResourceGetterServiceGetResourceResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Resource *Resource + Annotations []*anypb.Any +} + +func (b0 ResourceGetterServiceGetResourceResponse_builder) Build() *ResourceGetterServiceGetResourceResponse { + m0 := &ResourceGetterServiceGetResourceResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Resource = b.Resource + x.Annotations = b.Annotations + return m0 +} + type ExternalId struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Link string `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` @@ -2007,11 +3382,6 @@ func (x *ExternalId) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExternalId.ProtoReflect.Descriptor instead. -func (*ExternalId) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{26} -} - func (x *ExternalId) GetId() string { if x != nil { return x.Id @@ -2033,8 +3403,38 @@ func (x *ExternalId) GetDescription() string { return "" } +func (x *ExternalId) SetId(v string) { + x.Id = v +} + +func (x *ExternalId) SetLink(v string) { + x.Link = v +} + +func (x *ExternalId) SetDescription(v string) { + x.Description = v +} + +type ExternalId_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Id string + Link string + Description string +} + +func (b0 ExternalId_builder) Build() *ExternalId { + m0 := &ExternalId{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.Link = b.Link + x.Description = b.Description + return m0 +} + type AccountInfo_Email struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // Indicates if this is the user's primary email. Only one entry can be marked as primary. IsPrimary bool `protobuf:"varint,2,opt,name=is_primary,json=isPrimary,proto3" json:"is_primary,omitempty"` @@ -2067,11 +3467,6 @@ func (x *AccountInfo_Email) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AccountInfo_Email.ProtoReflect.Descriptor instead. -func (*AccountInfo_Email) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{11, 0} -} - func (x *AccountInfo_Email) GetAddress() string { if x != nil { return x.Address @@ -2086,8 +3481,33 @@ func (x *AccountInfo_Email) GetIsPrimary() bool { return false } +func (x *AccountInfo_Email) SetAddress(v string) { + x.Address = v +} + +func (x *AccountInfo_Email) SetIsPrimary(v bool) { + x.IsPrimary = v +} + +type AccountInfo_Email_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Address string + // Indicates if this is the user's primary email. Only one entry can be marked as primary. + IsPrimary bool +} + +func (b0 AccountInfo_Email_builder) Build() *AccountInfo_Email { + m0 := &AccountInfo_Email{} + b, x := &b0, m0 + _, _ = b, x + x.Address = b.Address + x.IsPrimary = b.IsPrimary + return m0 +} + type CredentialOptions_RandomPassword struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` Constraints []*PasswordConstraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"` unknownFields protoimpl.UnknownFields @@ -2119,11 +3539,6 @@ func (x *CredentialOptions_RandomPassword) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CredentialOptions_RandomPassword.ProtoReflect.Descriptor instead. -func (*CredentialOptions_RandomPassword) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 0} -} - func (x *CredentialOptions_RandomPassword) GetLength() int64 { if x != nil { return x.Length @@ -2138,8 +3553,32 @@ func (x *CredentialOptions_RandomPassword) GetConstraints() []*PasswordConstrain return nil } +func (x *CredentialOptions_RandomPassword) SetLength(v int64) { + x.Length = v +} + +func (x *CredentialOptions_RandomPassword) SetConstraints(v []*PasswordConstraint) { + x.Constraints = v +} + +type CredentialOptions_RandomPassword_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Length int64 + Constraints []*PasswordConstraint +} + +func (b0 CredentialOptions_RandomPassword_builder) Build() *CredentialOptions_RandomPassword { + m0 := &CredentialOptions_RandomPassword{} + b, x := &b0, m0 + _, _ = b, x + x.Length = b.Length + x.Constraints = b.Constraints + return m0 +} + type CredentialOptions_NoPassword struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2169,13 +3608,20 @@ func (x *CredentialOptions_NoPassword) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CredentialOptions_NoPassword.ProtoReflect.Descriptor instead. -func (*CredentialOptions_NoPassword) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 1} +type CredentialOptions_NoPassword_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 CredentialOptions_NoPassword_builder) Build() *CredentialOptions_NoPassword { + m0 := &CredentialOptions_NoPassword{} + b, x := &b0, m0 + _, _ = b, x + return m0 } type CredentialOptions_SSO struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` SsoProvider string `protobuf:"bytes,1,opt,name=sso_provider,json=ssoProvider,proto3" json:"sso_provider,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -2206,11 +3652,6 @@ func (x *CredentialOptions_SSO) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CredentialOptions_SSO.ProtoReflect.Descriptor instead. -func (*CredentialOptions_SSO) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 2} -} - func (x *CredentialOptions_SSO) GetSsoProvider() string { if x != nil { return x.SsoProvider @@ -2218,8 +3659,26 @@ func (x *CredentialOptions_SSO) GetSsoProvider() string { return "" } +func (x *CredentialOptions_SSO) SetSsoProvider(v string) { + x.SsoProvider = v +} + +type CredentialOptions_SSO_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + SsoProvider string +} + +func (b0 CredentialOptions_SSO_builder) Build() *CredentialOptions_SSO { + m0 := &CredentialOptions_SSO{} + b, x := &b0, m0 + _, _ = b, x + x.SsoProvider = b.SsoProvider + return m0 +} + type CredentialOptions_EncryptedPassword struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` EncryptedPasswords []*EncryptedData `protobuf:"bytes,1,rep,name=encrypted_passwords,json=encryptedPasswords,proto3" json:"encrypted_passwords,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -2250,11 +3709,6 @@ func (x *CredentialOptions_EncryptedPassword) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } -// Deprecated: Use CredentialOptions_EncryptedPassword.ProtoReflect.Descriptor instead. -func (*CredentialOptions_EncryptedPassword) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{12, 3} -} - func (x *CredentialOptions_EncryptedPassword) GetEncryptedPasswords() []*EncryptedData { if x != nil { return x.EncryptedPasswords @@ -2262,8 +3716,26 @@ func (x *CredentialOptions_EncryptedPassword) GetEncryptedPasswords() []*Encrypt return nil } +func (x *CredentialOptions_EncryptedPassword) SetEncryptedPasswords(v []*EncryptedData) { + x.EncryptedPasswords = v +} + +type CredentialOptions_EncryptedPassword_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + EncryptedPasswords []*EncryptedData +} + +func (b0 CredentialOptions_EncryptedPassword_builder) Build() *CredentialOptions_EncryptedPassword { + m0 := &CredentialOptions_EncryptedPassword{} + b, x := &b0, m0 + _, _ = b, x + x.EncryptedPasswords = b.EncryptedPasswords + return m0 +} + type LocalCredentialOptions_RandomPassword struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` Constraints []*PasswordConstraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"` unknownFields protoimpl.UnknownFields @@ -2295,11 +3767,6 @@ func (x *LocalCredentialOptions_RandomPassword) ProtoReflect() protoreflect.Mess return mi.MessageOf(x) } -// Deprecated: Use LocalCredentialOptions_RandomPassword.ProtoReflect.Descriptor instead. -func (*LocalCredentialOptions_RandomPassword) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 0} -} - func (x *LocalCredentialOptions_RandomPassword) GetLength() int64 { if x != nil { return x.Length @@ -2314,8 +3781,32 @@ func (x *LocalCredentialOptions_RandomPassword) GetConstraints() []*PasswordCons return nil } +func (x *LocalCredentialOptions_RandomPassword) SetLength(v int64) { + x.Length = v +} + +func (x *LocalCredentialOptions_RandomPassword) SetConstraints(v []*PasswordConstraint) { + x.Constraints = v +} + +type LocalCredentialOptions_RandomPassword_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Length int64 + Constraints []*PasswordConstraint +} + +func (b0 LocalCredentialOptions_RandomPassword_builder) Build() *LocalCredentialOptions_RandomPassword { + m0 := &LocalCredentialOptions_RandomPassword{} + b, x := &b0, m0 + _, _ = b, x + x.Length = b.Length + x.Constraints = b.Constraints + return m0 +} + type LocalCredentialOptions_NoPassword struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2345,13 +3836,20 @@ func (x *LocalCredentialOptions_NoPassword) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -// Deprecated: Use LocalCredentialOptions_NoPassword.ProtoReflect.Descriptor instead. -func (*LocalCredentialOptions_NoPassword) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 1} +type LocalCredentialOptions_NoPassword_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 LocalCredentialOptions_NoPassword_builder) Build() *LocalCredentialOptions_NoPassword { + m0 := &LocalCredentialOptions_NoPassword{} + b, x := &b0, m0 + _, _ = b, x + return m0 } type LocalCredentialOptions_SSO struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` SsoProvider string `protobuf:"bytes,1,opt,name=sso_provider,json=ssoProvider,proto3" json:"sso_provider,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -2382,11 +3880,6 @@ func (x *LocalCredentialOptions_SSO) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LocalCredentialOptions_SSO.ProtoReflect.Descriptor instead. -func (*LocalCredentialOptions_SSO) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 2} -} - func (x *LocalCredentialOptions_SSO) GetSsoProvider() string { if x != nil { return x.SsoProvider @@ -2394,8 +3887,26 @@ func (x *LocalCredentialOptions_SSO) GetSsoProvider() string { return "" } +func (x *LocalCredentialOptions_SSO) SetSsoProvider(v string) { + x.SsoProvider = v +} + +type LocalCredentialOptions_SSO_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + SsoProvider string +} + +func (b0 LocalCredentialOptions_SSO_builder) Build() *LocalCredentialOptions_SSO { + m0 := &LocalCredentialOptions_SSO{} + b, x := &b0, m0 + _, _ = b, x + x.SsoProvider = b.SsoProvider + return m0 +} + type LocalCredentialOptions_PlaintextPassword struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` PlaintextPassword string `protobuf:"bytes,1,opt,name=plaintext_password,json=plaintextPassword,proto3" json:"plaintext_password,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -2426,11 +3937,6 @@ func (x *LocalCredentialOptions_PlaintextPassword) ProtoReflect() protoreflect.M return mi.MessageOf(x) } -// Deprecated: Use LocalCredentialOptions_PlaintextPassword.ProtoReflect.Descriptor instead. -func (*LocalCredentialOptions_PlaintextPassword) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{13, 3} -} - func (x *LocalCredentialOptions_PlaintextPassword) GetPlaintextPassword() string { if x != nil { return x.PlaintextPassword @@ -2438,8 +3944,26 @@ func (x *LocalCredentialOptions_PlaintextPassword) GetPlaintextPassword() string return "" } +func (x *LocalCredentialOptions_PlaintextPassword) SetPlaintextPassword(v string) { + x.PlaintextPassword = v +} + +type LocalCredentialOptions_PlaintextPassword_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + PlaintextPassword string +} + +func (b0 LocalCredentialOptions_PlaintextPassword_builder) Build() *LocalCredentialOptions_PlaintextPassword { + m0 := &LocalCredentialOptions_PlaintextPassword{} + b, x := &b0, m0 + _, _ = b, x + x.PlaintextPassword = b.PlaintextPassword + return m0 +} + type CreateAccountResponse_SuccessResult struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` IsCreateAccountResult bool `protobuf:"varint,2,opt,name=is_create_account_result,json=isCreateAccountResult,proto3" json:"is_create_account_result,omitempty"` unknownFields protoimpl.UnknownFields @@ -2471,11 +3995,6 @@ func (x *CreateAccountResponse_SuccessResult) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } -// Deprecated: Use CreateAccountResponse_SuccessResult.ProtoReflect.Descriptor instead. -func (*CreateAccountResponse_SuccessResult) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16, 0} -} - func (x *CreateAccountResponse_SuccessResult) GetResource() *Resource { if x != nil { return x.Resource @@ -2490,8 +4009,43 @@ func (x *CreateAccountResponse_SuccessResult) GetIsCreateAccountResult() bool { return false } +func (x *CreateAccountResponse_SuccessResult) SetResource(v *Resource) { + x.Resource = v +} + +func (x *CreateAccountResponse_SuccessResult) SetIsCreateAccountResult(v bool) { + x.IsCreateAccountResult = v +} + +func (x *CreateAccountResponse_SuccessResult) HasResource() bool { + if x == nil { + return false + } + return x.Resource != nil +} + +func (x *CreateAccountResponse_SuccessResult) ClearResource() { + x.Resource = nil +} + +type CreateAccountResponse_SuccessResult_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Resource *Resource + IsCreateAccountResult bool +} + +func (b0 CreateAccountResponse_SuccessResult_builder) Build() *CreateAccountResponse_SuccessResult { + m0 := &CreateAccountResponse_SuccessResult{} + b, x := &b0, m0 + _, _ = b, x + x.Resource = b.Resource + x.IsCreateAccountResult = b.IsCreateAccountResult + return m0 +} + type CreateAccountResponse_ActionRequiredResult struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` IsCreateAccountResult bool `protobuf:"varint,3,opt,name=is_create_account_result,json=isCreateAccountResult,proto3" json:"is_create_account_result,omitempty"` @@ -2524,11 +4078,6 @@ func (x *CreateAccountResponse_ActionRequiredResult) ProtoReflect() protoreflect return mi.MessageOf(x) } -// Deprecated: Use CreateAccountResponse_ActionRequiredResult.ProtoReflect.Descriptor instead. -func (*CreateAccountResponse_ActionRequiredResult) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{16, 1} -} - func (x *CreateAccountResponse_ActionRequiredResult) GetResource() *Resource { if x != nil { return x.Resource @@ -2550,8 +4099,49 @@ func (x *CreateAccountResponse_ActionRequiredResult) GetIsCreateAccountResult() return false } +func (x *CreateAccountResponse_ActionRequiredResult) SetResource(v *Resource) { + x.Resource = v +} + +func (x *CreateAccountResponse_ActionRequiredResult) SetMessage(v string) { + x.Message = v +} + +func (x *CreateAccountResponse_ActionRequiredResult) SetIsCreateAccountResult(v bool) { + x.IsCreateAccountResult = v +} + +func (x *CreateAccountResponse_ActionRequiredResult) HasResource() bool { + if x == nil { + return false + } + return x.Resource != nil +} + +func (x *CreateAccountResponse_ActionRequiredResult) ClearResource() { + x.Resource = nil +} + +type CreateAccountResponse_ActionRequiredResult_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Resource *Resource + Message string + IsCreateAccountResult bool +} + +func (b0 CreateAccountResponse_ActionRequiredResult_builder) Build() *CreateAccountResponse_ActionRequiredResult { + m0 := &CreateAccountResponse_ActionRequiredResult{} + b, x := &b0, m0 + _, _ = b, x + x.Resource = b.Resource + x.Message = b.Message + x.IsCreateAccountResult = b.IsCreateAccountResult + return m0 +} + type EncryptionConfig_JWKPublicKeyConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"hybrid.v1"` PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -2582,11 +4172,6 @@ func (x *EncryptionConfig_JWKPublicKeyConfig) ProtoReflect() protoreflect.Messag return mi.MessageOf(x) } -// Deprecated: Use EncryptionConfig_JWKPublicKeyConfig.ProtoReflect.Descriptor instead. -func (*EncryptionConfig_JWKPublicKeyConfig) Descriptor() ([]byte, []int) { - return file_c1_connector_v2_resource_proto_rawDescGZIP(), []int{19, 0} -} - func (x *EncryptionConfig_JWKPublicKeyConfig) GetPubKey() []byte { if x != nil { return x.PubKey @@ -2594,563 +4179,246 @@ func (x *EncryptionConfig_JWKPublicKeyConfig) GetPubKey() []byte { return nil } -var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor +func (x *EncryptionConfig_JWKPublicKeyConfig) SetPubKey(v []byte) { + if v == nil { + v = []byte{} + } + x.PubKey = v +} -var file_c1_connector_v2_resource_proto_rawDesc = string([]byte{ - 0x0a, 0x1e, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, - 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0f, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x03, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x20, 0x01, 0x28, 0x80, 0x08, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x30, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, - 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x42, 0x0f, 0xfa, 0x42, 0x0c, 0x92, 0x01, 0x09, 0x18, - 0x01, 0x22, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, - 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, - 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x20, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x64, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x79, 0x6e, 0x63, - 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x79, 0x6e, 0x63, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x70, 0x0a, 0x05, 0x54, 0x72, 0x61, - 0x69, 0x74, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x52, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x52, 0x41, - 0x49, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x52, 0x41, - 0x49, 0x54, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x52, - 0x41, 0x49, 0x54, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x52, - 0x41, 0x49, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x52, 0x41, - 0x49, 0x54, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x10, 0x05, 0x22, 0xa6, 0x02, 0x0a, 0x2c, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, - 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x2a, 0x05, 0x18, 0xfa, 0x01, 0x40, 0x01, 0x52, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, - 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, 0x80, 0x80, 0x40, 0xd0, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x33, 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, - 0x28, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, - 0x6e, 0x63, 0x49, 0x64, 0x22, 0xd2, 0x01, 0x0a, 0x2d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0f, 0x6e, 0x65, 0x78, - 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, 0x80, 0x80, 0x40, 0xd0, - 0x01, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x4e, 0x0a, 0x15, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x16, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x12, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x64, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x22, 0x50, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, - 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, - 0x12, 0x49, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0x52, 0x0a, 0x18, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x32, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0xfc, 0x01, 0x0a, 0x17, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x12, - 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0xd7, - 0x01, 0x0a, 0x18, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0e, 0x65, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x0d, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, - 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x0b, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3a, 0x0a, 0x06, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x06, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, - 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, - 0x31, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x1a, 0x49, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, - 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x22, 0xd1, 0x05, - 0x0a, 0x11, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x5c, 0x0a, 0x0f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5f, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, - 0x00, 0x52, 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x50, 0x0a, 0x0b, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x03, 0x73, 0x73, 0x6f, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x53, 0x4f, 0x48, 0x00, 0x52, 0x03, 0x73, 0x73, 0x6f, 0x12, - 0x65, 0x0a, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x48, 0x00, 0x52, 0x11, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, - 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x1a, 0x7a, 0x0a, 0x0e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x22, 0x04, 0x18, 0x40, 0x28, 0x08, 0x52, - 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, - 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, - 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, - 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x1a, 0x0c, - 0x0a, 0x0a, 0x4e, 0x6f, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x28, 0x0a, 0x03, - 0x53, 0x53, 0x4f, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x73, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x73, 0x6f, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x1a, 0x6e, 0x0a, 0x11, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x59, 0x0a, 0x13, 0x65, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, - 0x08, 0x01, 0x52, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0xbe, 0x05, 0x0a, 0x16, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x61, 0x0a, 0x0f, - 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, - 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, - 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x55, 0x0a, 0x0b, 0x6e, 0x6f, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x65, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3f, 0x0a, 0x03, 0x73, 0x73, 0x6f, 0x18, 0x66, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x53, 0x4f, - 0x48, 0x00, 0x52, 0x03, 0x73, 0x73, 0x6f, 0x12, 0x6a, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x69, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x67, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x50, 0x6c, 0x61, - 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x48, 0x00, - 0x52, 0x11, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x41, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x1a, - 0x7a, 0x0a, 0x0e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x21, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x22, 0x04, 0x18, 0x40, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x31, 0x2e, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, - 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x1a, 0x0c, 0x0a, 0x0a, 0x4e, - 0x6f, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x28, 0x0a, 0x03, 0x53, 0x53, 0x4f, - 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x73, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x73, 0x6f, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x1a, 0x42, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x69, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x4c, 0x0a, 0x12, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x43, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x72, - 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, - 0x53, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x22, 0xfc, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x32, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x51, 0x0a, 0x12, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x63, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, - 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x31, 0x2e, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x65, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, - 0xfe, 0x04, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x66, 0x0a, 0x0f, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x65, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x0e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x65, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x1a, 0x7f, 0x0a, 0x0d, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x73, - 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x73, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x1a, 0xa0, 0x01, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x35, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x37, 0x0a, - 0x18, 0x69, 0x73, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x15, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0xd6, 0x01, 0x0a, 0x0d, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x19, - 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 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, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0e, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x17, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x22, 0x73, 0x0a, 0x0d, 0x50, 0x6c, 0x61, - 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 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, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xa2, - 0x02, 0x0a, 0x10, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, - 0x69, 0x0a, 0x15, 0x6a, 0x77, 0x6b, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, - 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x4a, 0x57, 0x4b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x12, 0x6a, 0x77, 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x2d, 0x0a, 0x12, 0x4a, 0x57, - 0x4b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x22, 0x8c, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, - 0x20, 0x01, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x20, 0x01, 0x28, 0x80, - 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x62, - 0x61, 0x74, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x22, 0xf0, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x2b, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x49, 0x0a, 0x12, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, - 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, - 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x69, - 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, - 0x80, 0x10, 0xd0, 0x01, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x52, 0x0a, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x0e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, - 0x1b, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, - 0x0a, 0x28, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, - 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, 0x49, 0x53, 0x54, - 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x53, 0x10, 0x01, 0x12, 0x37, 0x0a, 0x33, - 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, - 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x47, - 0x52, 0x41, 0x4e, 0x54, 0x53, 0x5f, 0x50, 0x52, 0x49, 0x4e, 0x43, 0x49, 0x50, 0x41, 0x4c, 0x5f, - 0x4a, 0x49, 0x54, 0x10, 0x02, 0x22, 0xf6, 0x02, 0x0a, 0x24, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, - 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x20, - 0x01, 0x28, 0x80, 0x08, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x49, 0x64, 0x12, 0x53, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, - 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x00, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x09, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x0a, 0xfa, 0x42, - 0x07, 0x2a, 0x05, 0x18, 0xfa, 0x01, 0x40, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, - 0x80, 0x80, 0x40, 0xd0, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x0e, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, 0x80, 0x08, 0xd0, 0x01, 0x01, - 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x64, 0x22, 0xc6, - 0x01, 0x0a, 0x25, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x20, 0x01, 0x28, 0x80, 0x80, 0x40, 0xd0, 0x01, 0x01, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x27, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x64, 0x12, 0x53, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, - 0x01, 0x02, 0x10, 0x00, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, - 0x0a, 0x0e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x20, 0x01, 0x28, - 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x79, 0x6e, - 0x63, 0x49, 0x64, 0x22, 0x99, 0x01, 0x0a, 0x28, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x52, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, - 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x32, 0xab, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, - 0x11, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x12, 0x3d, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3e, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0x92, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, - 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9c, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x38, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xde, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x61, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x81, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x67, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x56, 0x32, 0x12, 0x28, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x29, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x56, 0x32, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x83, 0x01, 0x0a, 0x18, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x10, 0x52, 0x6f, 0x74, 0x61, 0x74, - 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x28, 0x2e, 0x63, 0x31, - 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, - 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0x77, 0x0a, 0x15, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x0d, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x63, 0x31, 0x2e, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x63, 0x74, 0x6f, - 0x72, 0x6f, 0x6e, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x6f, 0x6e, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x70, - 0x62, 0x2f, 0x63, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x76, - 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) +type EncryptionConfig_JWKPublicKeyConfig_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. -var ( - file_c1_connector_v2_resource_proto_rawDescOnce sync.Once - file_c1_connector_v2_resource_proto_rawDescData []byte -) + PubKey []byte +} -func file_c1_connector_v2_resource_proto_rawDescGZIP() []byte { - file_c1_connector_v2_resource_proto_rawDescOnce.Do(func() { - file_c1_connector_v2_resource_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_c1_connector_v2_resource_proto_rawDesc), len(file_c1_connector_v2_resource_proto_rawDesc))) - }) - return file_c1_connector_v2_resource_proto_rawDescData +func (b0 EncryptionConfig_JWKPublicKeyConfig_builder) Build() *EncryptionConfig_JWKPublicKeyConfig { + m0 := &EncryptionConfig_JWKPublicKeyConfig{} + b, x := &b0, m0 + _, _ = b, x + x.PubKey = b.PubKey + return m0 } +var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor + +const file_c1_connector_v2_resource_proto_rawDesc = "" + + "\n" + + "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xd5\x03\n" + + "\fResourceType\x12\x1a\n" + + "\x02id\x18\x01 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + + "\fdisplay_name\x18\x02 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\vdisplayName\x12L\n" + + "\x06traits\x18\x03 \x03(\x0e2#.c1.connector.v2.ResourceType.TraitB\x0f\xfaB\f\x92\x01\t\x18\x01\"\x05\x82\x01\x02\x10\x01R\x06traits\x126\n" + + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + + "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\x12\x1f\n" + + "\vsync_bucket\x18\a \x01(\tR\n" + + "syncBucket\"p\n" + + "\x05Trait\x12\x15\n" + + "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + + "\n" + + "TRAIT_USER\x10\x01\x12\x0f\n" + + "\vTRAIT_GROUP\x10\x02\x12\x0e\n" + + "\n" + + "TRAIT_ROLE\x10\x03\x12\r\n" + + "\tTRAIT_APP\x10\x04\x12\x10\n" + + "\fTRAIT_SECRET\x10\x05\"\xa6\x02\n" + + ",ResourceTypesServiceListResourceTypesRequest\x121\n" + + "\x06parent\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\x06parent\x12'\n" + + "\tpage_size\x18\x02 \x01(\rB\n" + + "\xfaB\a*\x05\x18\xfa\x01@\x01R\bpageSize\x12-\n" + + "\n" + + "page_token\x18\x03 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\tpageToken\x126\n" + + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + + "\x0eactive_sync_id\x18\x05 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\factiveSyncId\"\xd2\x01\n" + + "-ResourceTypesServiceListResourceTypesResponse\x121\n" + + "\x04list\x18\x01 \x03(\v2\x1d.c1.connector.v2.ResourceTypeR\x04list\x126\n" + + "\x0fnext_page_token\x18\x02 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\rnextPageToken\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"N\n" + + "\x15CreateResourceRequest\x125\n" + + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\"\x85\x01\n" + + "\x16CreateResourceResponse\x123\n" + + "\acreated\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\acreated\x126\n" + + "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xa0\x01\n" + + "\x15DeleteResourceRequest\x12<\n" + + "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "resourceId\x12I\n" + + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\"P\n" + + "\x16DeleteResourceResponse\x126\n" + + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xa2\x01\n" + + "\x17DeleteResourceV2Request\x12<\n" + + "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "resourceId\x12I\n" + + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\"R\n" + + "\x18DeleteResourceV2Response\x126\n" + + "\vannotations\x18\x01 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xfc\x01\n" + + "\x17RotateCredentialRequest\x12<\n" + + "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "resourceId\x12Q\n" + + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xd7\x01\n" + + "\x18RotateCredentialResponse\x12E\n" + + "\x0eencrypted_data\x18\x01 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x12<\n" + + "\vresource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "resourceId\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\x82\x02\n" + + "\vAccountInfo\x12:\n" + + "\x06emails\x18\x01 \x03(\v2\".c1.connector.v2.AccountInfo.EmailR\x06emails\x12\x14\n" + + "\x05login\x18\x02 \x01(\tR\x05login\x12#\n" + + "\rlogin_aliases\x18\x03 \x03(\tR\floginAliases\x121\n" + + "\aprofile\x18\x04 \x01(\v2\x17.google.protobuf.StructR\aprofile\x1aI\n" + + "\x05Email\x12!\n" + + "\aaddress\x18\x01 \x01(\tB\a\xfaB\x04r\x02`\x01R\aaddress\x12\x1d\n" + + "\n" + + "is_primary\x18\x02 \x01(\bR\tisPrimary\"\xd1\x05\n" + + "\x11CredentialOptions\x12\\\n" + + "\x0frandom_password\x18d \x01(\v21.c1.connector.v2.CredentialOptions.RandomPasswordH\x00R\x0erandomPassword\x12P\n" + + "\vno_password\x18e \x01(\v2-.c1.connector.v2.CredentialOptions.NoPasswordH\x00R\n" + + "noPassword\x12:\n" + + "\x03sso\x18f \x01(\v2&.c1.connector.v2.CredentialOptions.SSOH\x00R\x03sso\x12e\n" + + "\x12encrypted_password\x18g \x01(\v24.c1.connector.v2.CredentialOptions.EncryptedPasswordH\x00R\x11encryptedPassword\x12:\n" + + "\x1aforce_change_at_next_login\x18\x01 \x01(\bR\x16forceChangeAtNextLogin\x1az\n" + + "\x0eRandomPassword\x12!\n" + + "\x06length\x18\x01 \x01(\x03B\t\xfaB\x06\"\x04\x18@(\bR\x06length\x12E\n" + + "\vconstraints\x18\x02 \x03(\v2#.c1.connector.v2.PasswordConstraintR\vconstraints\x1a\f\n" + + "\n" + + "NoPassword\x1a(\n" + + "\x03SSO\x12!\n" + + "\fsso_provider\x18\x01 \x01(\tR\vssoProvider\x1an\n" + + "\x11EncryptedPassword\x12Y\n" + + "\x13encrypted_passwords\x18\x01 \x03(\v2\x1e.c1.connector.v2.EncryptedDataB\b\xfaB\x05\x92\x01\x02\b\x01R\x12encryptedPasswordsB\t\n" + + "\aoptions\"\xbe\x05\n" + + "\x16LocalCredentialOptions\x12a\n" + + "\x0frandom_password\x18d \x01(\v26.c1.connector.v2.LocalCredentialOptions.RandomPasswordH\x00R\x0erandomPassword\x12U\n" + + "\vno_password\x18e \x01(\v22.c1.connector.v2.LocalCredentialOptions.NoPasswordH\x00R\n" + + "noPassword\x12?\n" + + "\x03sso\x18f \x01(\v2+.c1.connector.v2.LocalCredentialOptions.SSOH\x00R\x03sso\x12j\n" + + "\x12plaintext_password\x18g \x01(\v29.c1.connector.v2.LocalCredentialOptions.PlaintextPasswordH\x00R\x11plaintextPassword\x12:\n" + + "\x1aforce_change_at_next_login\x18\x01 \x01(\bR\x16forceChangeAtNextLogin\x1az\n" + + "\x0eRandomPassword\x12!\n" + + "\x06length\x18\x01 \x01(\x03B\t\xfaB\x06\"\x04\x18@(\bR\x06length\x12E\n" + + "\vconstraints\x18\x02 \x03(\v2#.c1.connector.v2.PasswordConstraintR\vconstraints\x1a\f\n" + + "\n" + + "NoPassword\x1a(\n" + + "\x03SSO\x12!\n" + + "\fsso_provider\x18\x01 \x01(\tR\vssoProvider\x1aB\n" + + "\x11PlaintextPassword\x12-\n" + + "\x12plaintext_password\x18\x01 \x01(\tR\x11plaintextPasswordB\t\n" + + "\aoptions\"L\n" + + "\x12PasswordConstraint\x12\x19\n" + + "\bchar_set\x18\x01 \x01(\tR\acharSet\x12\x1b\n" + + "\tmin_count\x18\x02 \x01(\rR\bminCount\"\xfc\x01\n" + + "\x14CreateAccountRequest\x12?\n" + + "\faccount_info\x18\x01 \x01(\v2\x1c.c1.connector.v2.AccountInfoR\vaccountInfo\x12Q\n" + + "\x12credential_options\x18\x02 \x01(\v2\".c1.connector.v2.CredentialOptionsR\x11credentialOptions\x12P\n" + + "\x12encryption_configs\x18\x03 \x03(\v2!.c1.connector.v2.EncryptionConfigR\x11encryptionConfigs\"\xfe\x04\n" + + "\x15CreateAccountResponse\x12P\n" + + "\asuccess\x18d \x01(\v24.c1.connector.v2.CreateAccountResponse.SuccessResultH\x00R\asuccess\x12f\n" + + "\x0faction_required\x18e \x01(\v2;.c1.connector.v2.CreateAccountResponse.ActionRequiredResultH\x00R\x0eactionRequired\x12E\n" + + "\x0eencrypted_data\x18\x02 \x03(\v2\x1e.c1.connector.v2.EncryptedDataR\rencryptedData\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x1a\x7f\n" + + "\rSuccessResult\x125\n" + + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x127\n" + + "\x18is_create_account_result\x18\x02 \x01(\bR\x15isCreateAccountResult\x1a\xa0\x01\n" + + "\x14ActionRequiredResult\x125\n" + + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x127\n" + + "\x18is_create_account_result\x18\x03 \x01(\bR\x15isCreateAccountResultB\b\n" + + "\x06result\"\xd6\x01\n" + + "\rEncryptedData\x12\x1a\n" + + "\bprovider\x18\x01 \x01(\tR\bprovider\x12\x19\n" + + "\x06key_id\x18\x02 \x01(\tB\x02\x18\x01R\x05keyId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x16\n" + + "\x06schema\x18\x05 \x01(\tR\x06schema\x12'\n" + + "\x0fencrypted_bytes\x18\x06 \x01(\fR\x0eencryptedBytes\x12\x17\n" + + "\akey_ids\x18\a \x03(\tR\x06keyIds\"s\n" + + "\rPlaintextData\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" + + "\x06schema\x18\x03 \x01(\tR\x06schema\x12\x14\n" + + "\x05bytes\x18\x04 \x01(\fR\x05bytes\"\xa2\x02\n" + + "\x10EncryptionConfig\x127\n" + + "\tprincipal\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\tprincipal\x12\x1a\n" + + "\bprovider\x18\x02 \x01(\tR\bprovider\x12\x15\n" + + "\x06key_id\x18\x03 \x01(\tR\x05keyId\x12i\n" + + "\x15jwk_public_key_config\x18d \x01(\v24.c1.connector.v2.EncryptionConfig.JWKPublicKeyConfigH\x00R\x12jwkPublicKeyConfig\x1a-\n" + + "\x12JWKPublicKeyConfig\x12\x17\n" + + "\apub_key\x18\x01 \x01(\fR\x06pubKeyB\b\n" + + "\x06config\"\x8c\x01\n" + + "\n" + + "ResourceId\x12/\n" + + "\rresource_type\x18\x01 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\fresourceType\x12&\n" + + "\bresource\x18\x02 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\bresource\x12%\n" + + "\x0ebaton_resource\x18\x03 \x01(\bR\rbatonResource\"\xf0\x04\n" + + "\bResource\x12+\n" + + "\x02id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x02id\x12I\n" + + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\x10parentResourceId\x120\n" + + "\fdisplay_name\x18\x03 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\vdisplayName\x126\n" + + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\x10\xd0\x01\x01R\vdescription\x12%\n" + + "\x0ebaton_resource\x18\x06 \x01(\bR\rbatonResource\x12<\n" + + "\vexternal_id\x18\a \x01(\v2\x1b.c1.connector.v2.ExternalIdR\n" + + "externalId\x12Q\n" + + "\x0fcreation_source\x18\b \x01(\x0e2(.c1.connector.v2.Resource.CreationSourceR\x0ecreationSource\"\x98\x01\n" + + "\x0eCreationSource\x12\x1f\n" + + "\x1bCREATION_SOURCE_UNSPECIFIED\x10\x00\x12,\n" + + "(CREATION_SOURCE_CONNECTOR_LIST_RESOURCES\x10\x01\x127\n" + + "3CREATION_SOURCE_CONNECTOR_LIST_GRANTS_PRINCIPAL_JIT\x10\x02\"\xf6\x02\n" + + "$ResourcesServiceListResourcesRequest\x124\n" + + "\x10resource_type_id\x18\x01 \x01(\tB\n" + + "\xfaB\ar\x05 \x01(\x80\bR\x0eresourceTypeId\x12S\n" + + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x00R\x10parentResourceId\x12'\n" + + "\tpage_size\x18\x03 \x01(\rB\n" + + "\xfaB\a*\x05\x18\xfa\x01@\x01R\bpageSize\x12-\n" + + "\n" + + "page_token\x18\x04 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\tpageToken\x126\n" + + "\vannotations\x18\x05 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + + "\x0eactive_sync_id\x18\x06 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\factiveSyncId\"\xc6\x01\n" + + "%ResourcesServiceListResourcesResponse\x12-\n" + + "\x04list\x18\x01 \x03(\v2\x19.c1.connector.v2.ResourceR\x04list\x126\n" + + "\x0fnext_page_token\x18\x02 \x01(\tB\x0e\xfaB\vr\t \x01(\x80\x80@\xd0\x01\x01R\rnextPageToken\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"\xa9\x02\n" + + "'ResourceGetterServiceGetResourceRequest\x12<\n" + + "\vresource_id\x18\x01 \x01(\v2\x1b.c1.connector.v2.ResourceIdR\n" + + "resourceId\x12S\n" + + "\x12parent_resource_id\x18\x02 \x01(\v2\x1b.c1.connector.v2.ResourceIdB\b\xfaB\x05\x8a\x01\x02\x10\x00R\x10parentResourceId\x126\n" + + "\vannotations\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x123\n" + + "\x0eactive_sync_id\x18\x04 \x01(\tB\r\xfaB\n" + + "r\b \x01(\x80\b\xd0\x01\x01R\factiveSyncId\"\x99\x01\n" + + "(ResourceGetterServiceGetResourceResponse\x125\n" + + "\bresource\x18\x01 \x01(\v2\x19.c1.connector.v2.ResourceR\bresource\x126\n" + + "\vannotations\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\vannotations\"R\n" + + "\n" + + "ExternalId\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04link\x18\x02 \x01(\tR\x04link\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription2\xab\x01\n" + + "\x14ResourceTypesService\x12\x92\x01\n" + + "\x11ListResourceTypes\x12=.c1.connector.v2.ResourceTypesServiceListResourceTypesRequest\x1a>.c1.connector.v2.ResourceTypesServiceListResourceTypesResponse2\x92\x01\n" + + "\x10ResourcesService\x12~\n" + + "\rListResources\x125.c1.connector.v2.ResourcesServiceListResourcesRequest\x1a6.c1.connector.v2.ResourcesServiceListResourcesResponse2\x9c\x01\n" + + "\x15ResourceGetterService\x12\x82\x01\n" + + "\vGetResource\x128.c1.connector.v2.ResourceGetterServiceGetResourceRequest\x1a9.c1.connector.v2.ResourceGetterServiceGetResourceResponse2\xde\x01\n" + + "\x16ResourceManagerService\x12a\n" + + "\x0eCreateResource\x12&.c1.connector.v2.CreateResourceRequest\x1a'.c1.connector.v2.CreateResourceResponse\x12a\n" + + "\x0eDeleteResource\x12&.c1.connector.v2.DeleteResourceRequest\x1a'.c1.connector.v2.DeleteResourceResponse2\x81\x01\n" + + "\x16ResourceDeleterService\x12g\n" + + "\x10DeleteResourceV2\x12(.c1.connector.v2.DeleteResourceV2Request\x1a).c1.connector.v2.DeleteResourceV2Response2\x83\x01\n" + + "\x18CredentialManagerService\x12g\n" + + "\x10RotateCredential\x12(.c1.connector.v2.RotateCredentialRequest\x1a).c1.connector.v2.RotateCredentialResponse2w\n" + + "\x15AccountManagerService\x12^\n" + + "\rCreateAccount\x12%.c1.connector.v2.CreateAccountRequest\x1a&.c1.connector.v2.CreateAccountResponseB6Z4github.com/conductorone/baton-sdk/pb/c1/connector/v2b\x06proto3" + var file_c1_connector_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_c1_connector_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_c1_connector_v2_resource_proto_goTypes = []any{ diff --git a/pb/c1/connector/v2/resource_protoopaque.pb.go b/pb/c1/connector/v2/resource_protoopaque.pb.go index f02851454..a5279d686 100644 --- a/pb/c1/connector/v2/resource_protoopaque.pb.go +++ b/pb/c1/connector/v2/resource_protoopaque.pb.go @@ -131,6 +131,7 @@ type ResourceType struct { xxx_hidden_Annotations *[]*anypb.Any `protobuf:"bytes,4,rep,name=annotations,proto3"` xxx_hidden_Description string `protobuf:"bytes,5,opt,name=description,proto3"` xxx_hidden_SourcedExternally bool `protobuf:"varint,6,opt,name=sourced_externally,json=sourcedExternally,proto3"` + xxx_hidden_SyncBucket string `protobuf:"bytes,7,opt,name=sync_bucket,json=syncBucket,proto3"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -204,6 +205,13 @@ func (x *ResourceType) GetSourcedExternally() bool { return false } +func (x *ResourceType) GetSyncBucket() string { + if x != nil { + return x.xxx_hidden_SyncBucket + } + return "" +} + func (x *ResourceType) SetId(v string) { x.xxx_hidden_Id = v } @@ -228,6 +236,10 @@ func (x *ResourceType) SetSourcedExternally(v bool) { x.xxx_hidden_SourcedExternally = v } +func (x *ResourceType) SetSyncBucket(v string) { + x.xxx_hidden_SyncBucket = v +} + type ResourceType_builder struct { _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. @@ -237,6 +249,11 @@ type ResourceType_builder struct { Annotations []*anypb.Any Description string SourcedExternally bool + // Sync bucketing configuration for parallel processing + // Resource types with the same bucket name will be processed sequentially within that bucket + // Resource types with different bucket names can be processed in parallel + // If not specified, the default bucket from ParallelSyncConfig will be used + SyncBucket string } func (b0 ResourceType_builder) Build() *ResourceType { @@ -249,6 +266,7 @@ func (b0 ResourceType_builder) Build() *ResourceType { x.xxx_hidden_Annotations = &b.Annotations x.xxx_hidden_Description = b.Description x.xxx_hidden_SourcedExternally = b.SourcedExternally + x.xxx_hidden_SyncBucket = b.SyncBucket return m0 } @@ -4177,7 +4195,7 @@ var File_c1_connector_v2_resource_proto protoreflect.FileDescriptor const file_c1_connector_v2_resource_proto_rawDesc = "" + "\n" + - "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xb4\x03\n" + + "\x1ec1/connector/v2/resource.proto\x12\x0fc1.connector.v2\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17validate/validate.proto\"\xd5\x03\n" + "\fResourceType\x12\x1a\n" + "\x02id\x18\x01 \x01(\tB\n" + "\xfaB\ar\x05 \x01(\x80\bR\x02id\x120\n" + @@ -4187,7 +4205,9 @@ const file_c1_connector_v2_resource_proto_rawDesc = "" + "\vannotations\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\vannotations\x12/\n" + "\vdescription\x18\x05 \x01(\tB\r\xfaB\n" + "r\b \x01(\x80 \xd0\x01\x01R\vdescription\x12-\n" + - "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\"p\n" + + "\x12sourced_externally\x18\x06 \x01(\bR\x11sourcedExternally\x12\x1f\n" + + "\vsync_bucket\x18\a \x01(\tR\n" + + "syncBucket\"p\n" + "\x05Trait\x12\x15\n" + "\x11TRAIT_UNSPECIFIED\x10\x00\x12\x0e\n" + "\n" + diff --git a/pkg/dotc1z/c1file.go b/pkg/dotc1z/c1file.go index bbf717fd0..5484495a8 100644 --- a/pkg/dotc1z/c1file.go +++ b/pkg/dotc1z/c1file.go @@ -7,10 +7,13 @@ import ( "fmt" "os" "path/filepath" + "strings" "sync" "time" "github.com/doug-martin/goqu/v9" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" + "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -453,17 +456,23 @@ func (c *C1File) GrantStats(ctx context.Context, syncType connectorstore.SyncTyp return stats, nil } -// isWALMode checks if the database is using WAL mode +// isWALMode checks if the database is using WAL mode. func (c *C1File) isWALMode() bool { for _, pragma := range c.pragmas { - if pragma.name == "journal_mode" && pragma.value == "WAL" { + if pragma.name == "journal_mode" && strings.EqualFold(pragma.value, "wall") { return true } } + + var mode string + if err := c.rawDb.QueryRow("PRAGMA journal_mode").Scan(&mode); err == nil { + return strings.EqualFold(mode, "wal") + } + return false } -// startWALCheckpointing starts a background goroutine to perform WAL checkpoints every 5 minutes +// startWALCheckpointing starts a background goroutine to perform WAL checkpoints every 5 minutes. func (c *C1File) startWALCheckpointing() { c.checkpointTicker = time.NewTicker(5 * time.Minute) @@ -480,21 +489,21 @@ func (c *C1File) startWALCheckpointing() { }() } -// acquireCheckpointLock acquires a read lock for database operations +// acquireCheckpointLock acquires a read lock for database operations. func (c *C1File) acquireCheckpointLock() { if c.checkpointEnabled { c.checkpointMu.RLock() } } -// releaseCheckpointLock releases the read lock for database operations +// releaseCheckpointLock releases the read lock for database operations. func (c *C1File) releaseCheckpointLock() { if c.checkpointEnabled { c.checkpointMu.RUnlock() } } -// performWALCheckpoint performs a WAL checkpoint using SQLITE_CHECKPOINT_RESTART or SQLITE_CHECKPOINT_TRUNCATE +// performWALCheckpoint performs a WAL checkpoint using SQLITE_CHECKPOINT_RESTART or SQLITE_CHECKPOINT_TRUNCATE. func (c *C1File) performWALCheckpoint() { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() @@ -509,9 +518,7 @@ func (c *C1File) performWALCheckpoint() { // If TRUNCATE fails, try RESTART _, err = c.rawDb.ExecContext(ctx, "PRAGMA wal_checkpoint(RESTART)") if err != nil { - // Log error but don't fail the operation - // In a real implementation, you might want to use a logger here - fmt.Printf("WAL checkpoint failed: %v\n", err) + ctxzap.Extract(ctx).Error("failed to perform WAL checkpoint", zap.Error(err)) } } } diff --git a/pkg/dotc1z/sql_helpers.go b/pkg/dotc1z/sql_helpers.go index ac5cf262e..f1b447d16 100644 --- a/pkg/dotc1z/sql_helpers.go +++ b/pkg/dotc1z/sql_helpers.go @@ -2,6 +2,7 @@ package dotc1z import ( "context" + "errors" "fmt" "strconv" "strings" @@ -344,7 +345,7 @@ func executeChunkedInsert( return nil } -// executeChunkWithRetry executes a single chunk with retry logic for SQLITE_BUSY errors +// executeChunkWithRetry executes a single chunk with retry logic for SQLITE_BUSY errors. func executeChunkWithRetry( ctx context.Context, c *C1File, @@ -378,7 +379,10 @@ func executeChunkWithRetry( insertDs, err = buildQueryFn(insertDs, chunkedRows) if err != nil { c.releaseCheckpointLock() - tx.Rollback() + rollbackErr := tx.Rollback() + if rollbackErr != nil { + return errors.Join(err, rollbackErr) + } return err } @@ -386,14 +390,20 @@ func executeChunkWithRetry( query, args, err := insertDs.ToSQL() if err != nil { c.releaseCheckpointLock() - tx.Rollback() + rollbackErr := tx.Rollback() + if rollbackErr != nil { + return errors.Join(err, rollbackErr) + } return err } _, err = tx.ExecContext(ctx, query, args...) if err != nil { c.releaseCheckpointLock() - tx.Rollback() + rollbackErr := tx.Rollback() + if rollbackErr != nil { + return errors.Join(err, rollbackErr) + } if isSQLiteBusy(err) && attempt < maxRetries-1 { select { case <-ctx.Done(): diff --git a/pkg/sync/parallel_syncer.go b/pkg/sync/parallel_syncer.go index e335fbb1b..c3a312b2b 100644 --- a/pkg/sync/parallel_syncer.go +++ b/pkg/sync/parallel_syncer.go @@ -28,15 +28,20 @@ var taskRetryLimit = 5 var errTaskQueueFull = errors.New("task queue is full") var parallelTracer = otel.Tracer("baton-sdk/parallel-sync") -// min returns the smaller of two integers -func min(a, b int) int { +const ( + nextPageAction = "next_page" + finishAction = "finish" +) + +// min returns the smaller of two integers. +func minInt(a, b int) int { if a < b { return a } return b } -// addTaskWithRetry adds a task to the queue with retry logic for queue full errors +// addTaskWithRetry adds a task to the queue with retry logic for queue full errors. func (ps *parallelSyncer) addTaskWithRetry(ctx context.Context, task *task, maxRetries int) error { for attempt := 0; attempt <= maxRetries; attempt++ { err := ps.taskQueue.AddTask(ctx, task) @@ -66,8 +71,8 @@ func (ps *parallelSyncer) addTaskWithRetry(ctx context.Context, task *task, maxR return nil // This should never be reached } -// addTasksAfterCompletion safely adds tasks after a worker has completed its current task -func (w *worker) addTasksAfterCompletion(tasks []*task) { +// addTasksAfterCompletion safely adds tasks after a worker has completed its current task. +func (w *worker) addTasksAfterCompletion(tasks []*task) error { l := ctxzap.Extract(w.ctx) l.Debug("adding tasks after completion", zap.Int("task_count", len(tasks))) @@ -77,13 +82,14 @@ func (w *worker) addTasksAfterCompletion(tasks []*task) { l.Error("CRITICAL: failed to add task after completion - this should never happen", zap.String("operation", task.Action.Op.String()), zap.Error(err)) - // This is a critical error - we should panic or handle it differently - panic(fmt.Sprintf("failed to add task after completion: %v", err)) + return fmt.Errorf("failed to add task after completion: %w", err) } } + + return nil } -// addTaskWithGuarantee ensures a task is never lost by trying multiple strategies +// addTaskWithGuarantee ensures a task is never lost by trying multiple strategies. func (w *worker) addTaskWithGuarantee(task *task) error { l := ctxzap.Extract(w.ctx) @@ -108,7 +114,7 @@ func (w *worker) addTaskWithGuarantee(task *task) error { return w.processTaskImmediately(task) } -// processTaskImmediately processes a task directly without going through the queue +// processTaskImmediately processes a task directly without going through the queue. func (w *worker) processTaskImmediately(task *task) error { l := ctxzap.Extract(w.ctx) l.Debug("processing task immediately", @@ -162,9 +168,9 @@ func (w *worker) processTaskImmediately(task *task) error { } } -// StateInterface defines the minimal interface needed by helper methods +// StateInterface defines the minimal interface needed by helper methods. // This allows helper methods to work with either the sequential syncer's state machine -// or the parallel syncer's local state context +// or the parallel syncer's local state context. type StateInterface interface { PageToken(ctx context.Context) string NextPage(ctx context.Context, pageToken string) error @@ -173,8 +179,8 @@ type StateInterface interface { ShouldFetchRelatedResources() bool } -// ActionDecision represents the decision made by a helper method -// This allows the caller to decide how to handle the result +// ActionDecision represents the decision made by a helper method. +// This allows the caller to decide how to handle the result. type ActionDecision struct { ShouldContinue bool // Whether to continue processing (e.g., more pages) NextPageToken string // Page token for next page, if applicable @@ -184,8 +190,8 @@ type ActionDecision struct { ShouldFetchRelated bool // Whether related resources should be fetched } -// LocalStateContext provides local state management for parallel syncer -// This implements StateInterface without sharing the global state machine +// LocalStateContext provides local state management for parallel syncer. +// This implements StateInterface without sharing the global state machine. type LocalStateContext struct { resourceID *v2.ResourceId pageToken string @@ -194,7 +200,7 @@ type LocalStateContext struct { shouldFetchRelated bool } -// NewLocalStateContext creates a new local state context for a resource +// NewLocalStateContext creates a new local state context for a resource. func NewLocalStateContext(resourceID *v2.ResourceId) *LocalStateContext { return &LocalStateContext{ resourceID: resourceID, @@ -205,33 +211,33 @@ func NewLocalStateContext(resourceID *v2.ResourceId) *LocalStateContext { } } -// PageToken returns the current page token for this resource +// PageToken returns the current page token for this resource. func (lsc *LocalStateContext) PageToken(ctx context.Context) string { return lsc.pageToken } -// NextPage updates the page token for the next page +// NextPage updates the page token for the next page. func (lsc *LocalStateContext) NextPage(ctx context.Context, pageToken string) error { lsc.pageToken = pageToken return nil } -// SetNeedsExpansion marks that grant expansion is needed +// SetNeedsExpansion marks that grant expansion is needed. func (lsc *LocalStateContext) SetNeedsExpansion() { lsc.needsExpansion = true } -// SetHasExternalResourcesGrants marks that external resources were found +// SetHasExternalResourcesGrants marks that external resources were found. func (lsc *LocalStateContext) SetHasExternalResourcesGrants() { lsc.hasExternalResources = true } -// ShouldFetchRelatedResources returns whether related resources should be fetched +// ShouldFetchRelatedResources returns whether related resources should be fetched. func (lsc *LocalStateContext) ShouldFetchRelatedResources() bool { return lsc.shouldFetchRelated } -// ParallelSyncConfig holds configuration for parallel sync operations +// ParallelSyncConfig holds configuration for parallel sync operations. type ParallelSyncConfig struct { // Number of worker goroutines to use for parallel processing WorkerCount int @@ -240,7 +246,7 @@ type ParallelSyncConfig struct { DefaultBucket string } -// DefaultParallelSyncConfig returns a default configuration +// DefaultParallelSyncConfig returns a default configuration. func DefaultParallelSyncConfig() *ParallelSyncConfig { return &ParallelSyncConfig{ WorkerCount: 2, @@ -248,7 +254,7 @@ func DefaultParallelSyncConfig() *ParallelSyncConfig { } } -// WithWorkerCount sets the number of worker goroutines +// WithWorkerCount sets the number of worker goroutines. func (c *ParallelSyncConfig) WithWorkerCount(count int) *ParallelSyncConfig { if count > 0 { c.WorkerCount = count @@ -256,27 +262,26 @@ func (c *ParallelSyncConfig) WithWorkerCount(count int) *ParallelSyncConfig { return c } -// WithDefaultBucket sets the default bucket for resource types that don't specify a sync_bucket +// WithDefaultBucket sets the default bucket for resource types that don't specify a sync_bucket. func (c *ParallelSyncConfig) WithDefaultBucket(bucket string) *ParallelSyncConfig { c.DefaultBucket = bucket return c } -// task represents a unit of work for the parallel syncer +// task represents a unit of work for the parallel syncer. type task struct { Action Action ResourceID string - Priority int // Higher priority tasks are processed first ResourceType *v2.ResourceType // The resource type for this task } -// TaskResult contains tasks that should be created after completing a task +// TaskResult contains tasks that should be created after completing a task. type TaskResult struct { Tasks []*task Error error } -// DeferredTaskAdder collects tasks during processing and adds them after completion +// DeferredTaskAdder collects tasks during processing and adds them after completion. type DeferredTaskAdder struct { pendingTasks []*task sync.RWMutex @@ -306,21 +311,21 @@ func (dta *DeferredTaskAdder) Clear() { dta.pendingTasks = dta.pendingTasks[:0] // Reuse slice } -// taskQueue manages the distribution of tasks to workers using dynamic bucketing +// taskQueue manages the distribution of tasks to workers using dynamic bucketing. type taskQueue struct { - bucketQueues map[string]chan *task // Map of bucket name to task channel - config *ParallelSyncConfig - mu sync.RWMutex - closed bool + bucketQueues map[string]chan *task // Map of bucket name to task channel + parallelSyncer *parallelSyncer + mu sync.RWMutex + closed bool } -// newTaskQueue creates a new task queue -func newTaskQueue(config *ParallelSyncConfig) *taskQueue { +// newTaskQueue creates a new task queue. +func newTaskQueue(parallelSyncer *parallelSyncer) *taskQueue { // Initialize with an empty map of bucket queues // Buckets will be created dynamically as tasks are added return &taskQueue{ - bucketQueues: make(map[string]chan *task), - config: config, + bucketQueues: make(map[string]chan *task), + parallelSyncer: parallelSyncer, } } @@ -335,7 +340,7 @@ func (q *taskQueue) getOrCreateBucketChannel(bucket string) (chan *task, error) // Create the bucket queue if it doesn't exist queue, exists := q.bucketQueues[bucket] if !exists { - queueSize := q.config.WorkerCount * 10 + queueSize := q.parallelSyncer.config.WorkerCount * 10 queue = make(chan *task, queueSize) q.bucketQueues[bucket] = queue } @@ -343,7 +348,7 @@ func (q *taskQueue) getOrCreateBucketChannel(bucket string) (chan *task, error) return queue, nil } -// AddTask adds a task to the appropriate queue +// AddTask adds a task to the appropriate queue. func (q *taskQueue) AddTask(ctx context.Context, t *task) error { bucket := q.getBucketForTask(t) queue, err := q.getOrCreateBucketChannel(bucket) @@ -371,7 +376,7 @@ func (q *taskQueue) AddTask(ctx context.Context, t *task) error { } } -// AddTaskWithTimeout adds a task with a custom timeout and dynamic queue expansion +// AddTaskWithTimeout adds a task with a custom timeout and dynamic queue expansion. func (q *taskQueue) AddTaskWithTimeout(ctx context.Context, t *task, timeout time.Duration) error { bucket := q.getBucketForTask(t) queue, err := q.getOrCreateBucketChannel(bucket) @@ -391,7 +396,7 @@ func (q *taskQueue) AddTaskWithTimeout(ctx context.Context, t *task, timeout tim } } -// expandQueueAndRetry attempts to expand the queue and retry adding the task +// expandQueueAndRetry attempts to expand the queue and retry adding the task. func (q *taskQueue) expandQueueAndRetry(bucket string, t *task, timeout time.Duration) error { q.mu.Lock() defer q.mu.Unlock() @@ -413,7 +418,7 @@ func (q *taskQueue) expandQueueAndRetry(bucket string, t *task, timeout time.Dur } // Calculate new size (double it, but cap at reasonable limit) - newSize := min(currentSize*2, 50000) // Cap at 50k tasks per bucket + newSize := minInt(currentSize*2, 50000) // Cap at 50k tasks per bucket if newSize <= currentSize { l.Warn("queue expansion blocked - already at maximum size", @@ -457,7 +462,7 @@ func (q *taskQueue) expandQueueAndRetry(bucket string, t *task, timeout time.Dur } } -// getBucketForTask determines the bucket for a task based on the resource type's sync_bucket +// getBucketForTask determines the bucket for a task based on the resource type's sync_bucket. func (q *taskQueue) getBucketForTask(t *task) string { // If the resource type has an explicit sync_bucket, use it if t.ResourceType != nil && t.ResourceType.SyncBucket != "" { @@ -465,15 +470,15 @@ func (q *taskQueue) getBucketForTask(t *task) string { } // If no explicit bucket and default is empty, create a unique bucket per resource type - if q.config.DefaultBucket == "" { + if q.parallelSyncer.config.DefaultBucket == "" { return fmt.Sprintf("resource-type-%s", t.Action.ResourceTypeID) } // Otherwise use the configured default bucket - return q.config.DefaultBucket + return q.parallelSyncer.config.DefaultBucket } -// GetTask retrieves the next task with intelligent bucket selection +// GetTask retrieves the next task with intelligent bucket selection. func (q *taskQueue) GetTask(ctx context.Context) (*task, error) { q.mu.Lock() // Use write lock to make the operation atomic defer q.mu.Unlock() @@ -531,7 +536,7 @@ func (q *taskQueue) GetTask(ctx context.Context) (*task, error) { return nil, errors.New("no tasks available") } -// getMapKeys returns the keys of a map as a slice +// getMapKeys returns the keys of a map as a slice. func getMapKeys(m map[string]chan *task) []string { keys := make([]string, 0, len(m)) for k := range m { @@ -540,7 +545,7 @@ func getMapKeys(m map[string]chan *task) []string { return keys } -// GetTaskFromBucket retrieves a task from a specific bucket +// GetTaskFromBucket retrieves a task from a specific bucket. func (q *taskQueue) GetTaskFromBucket(bucketName string) (*task, error) { q.mu.Lock() // Use write lock to make the operation atomic defer q.mu.Unlock() @@ -558,7 +563,7 @@ func (q *taskQueue) GetTaskFromBucket(bucketName string) (*task, error) { } } -// GetBucketStats returns statistics about each bucket +// GetBucketStats returns statistics about each bucket. func (q *taskQueue) GetBucketStats() map[string]int { q.mu.RLock() defer q.mu.RUnlock() @@ -570,21 +575,18 @@ func (q *taskQueue) GetBucketStats() map[string]int { return stats } -// Close closes the task queue +// Close closes the task queue. func (q *taskQueue) Close() { q.mu.Lock() defer q.mu.Unlock() - if !q.closed { - // Close all bucket queues - for _, queue := range q.bucketQueues { - close(queue) - } - q.closed = true + for _, w := range q.parallelSyncer.workers { + w.cancel() } + q.closed = true } -// worker represents a worker goroutine that processes tasks +// worker represents a worker goroutine that processes tasks. type worker struct { id int taskQueue *taskQueue @@ -596,7 +598,7 @@ type worker struct { isProcessing atomic.Bool } -// newWorker creates a new worker +// newWorker creates a new worker. func newWorker(id int, taskQueue *taskQueue, syncer *parallelSyncer, ctx context.Context, wg *sync.WaitGroup) *worker { workerCtx, cancel := context.WithCancel(ctx) return &worker{ @@ -609,7 +611,7 @@ func newWorker(id int, taskQueue *taskQueue, syncer *parallelSyncer, ctx context } } -// Start starts the worker with bucket-aware task processing and work-stealing +// Start starts the worker with bucket-aware task processing and work-stealing. func (w *worker) Start() { defer w.wg.Done() @@ -627,13 +629,17 @@ func (w *worker) Start() { l.Debug("worker stopped", zap.Int("worker_id", w.id)) return default: - // Try to get a task, with preference for the current bucket if we're making progress task, err := w.taskQueue.GetTask(w.ctx) if err != nil { // No tasks available, wait a bit l.Debug("no tasks available, waiting", zap.Int("worker_id", w.id), zap.Error(err)) - time.Sleep(100 * time.Millisecond) + select { + case <-w.ctx.Done(): + l.Debug("worker context cancelled, stopping", zap.Int("worker_id", w.id)) + return + case <-time.After(100 * time.Millisecond): + } continue } l.Debug("worker got task", zap.Int("worker_id", w.id), zap.String("task_op", task.Action.Op.String())) @@ -663,10 +669,17 @@ func (w *worker) Start() { // Process the task taskResult, err := w.processTask(task) if err != nil { - // Add pending tasks after task completion (even if failed, they might be valid) if taskResult != nil && len(taskResult.Tasks) > 0 { - w.addTasksAfterCompletion(taskResult.Tasks) + err = w.addTasksAfterCompletion(taskResult.Tasks) + if err != nil { + l.Error("failed to add tasks after completion", + zap.Int("worker_id", w.id), + zap.String("bucket", taskBucket), + zap.Error(err)) + w.taskQueue.Close() + return + } } l.Error("failed to process task", zap.Int("worker_id", w.id), @@ -695,7 +708,11 @@ func (w *worker) Start() { // Wait before retrying with bucket-specific delay delay := w.getBucketRateLimitDelay(taskBucket) - time.Sleep(delay) + select { + case <-w.ctx.Done(): + return + case <-time.After(delay): + } } else { // Non-rate-limit error, reset rate limit flag w.rateLimited.Store(false) @@ -703,7 +720,15 @@ func (w *worker) Start() { } else { // Task succeeded, add any pending tasks after completion if taskResult != nil && len(taskResult.Tasks) > 0 { - w.addTasksAfterCompletion(taskResult.Tasks) + err = w.addTasksAfterCompletion(taskResult.Tasks) + if err != nil { + l.Error("failed to add tasks after completion", + zap.Int("worker_id", w.id), + zap.String("bucket", taskBucket), + zap.Error(err)) + w.taskQueue.Close() + return + } } // Reset failure counters @@ -717,7 +742,7 @@ func (w *worker) Start() { } } -// processTask processes a single task and returns any tasks that should be created after completion +// processTask processes a single task and returns any tasks that should be created after completion. func (w *worker) processTask(t *task) (*TaskResult, error) { ctx, span := parallelTracer.Start(w.ctx, "worker.processTask") defer span.End() @@ -762,7 +787,7 @@ func (w *worker) processTask(t *task) (*TaskResult, error) { } } -// isRateLimitError checks if an error is a rate limit error +// isRateLimitError checks if an error is a rate limit error. func (w *worker) isRateLimitError(err error) bool { // Check for rate limit annotations in the error if err == nil { @@ -771,11 +796,10 @@ func (w *worker) isRateLimitError(err error) bool { // This is a simplified check - in practice, you'd want to check the actual // error type returned by the connector for rate limiting - return status.Code(err) == codes.ResourceExhausted || - errors.Is(err, sql.ErrConnDone) // Placeholder for rate limit detection + return status.Code(err) == codes.ResourceExhausted } -// getBucketRateLimitDelay returns the appropriate delay for a bucket based on rate limiting +// getBucketRateLimitDelay returns the appropriate delay for a bucket based on rate limiting. func (w *worker) getBucketRateLimitDelay(bucket string) time.Duration { // Different buckets can have different rate limit delays // This allows for bucket-specific rate limiting strategies @@ -790,12 +814,12 @@ func (w *worker) getBucketRateLimitDelay(bucket string) time.Duration { } } -// Stop stops the worker +// Stop stops the worker. func (w *worker) Stop() { w.cancel() } -// parallelSyncer extends the base syncer with parallel processing capabilities +// parallelSyncer extends the base syncer with parallel processing capabilities. type parallelSyncer struct { syncer *SequentialSyncer config *ParallelSyncConfig @@ -805,7 +829,7 @@ type parallelSyncer struct { mu sync.RWMutex } -// NewParallelSyncer creates a new parallel syncer +// NewParallelSyncer creates a new parallel syncer. func NewParallelSyncer(baseSyncer *SequentialSyncer, config *ParallelSyncConfig) *parallelSyncer { if config == nil { config = DefaultParallelSyncConfig() @@ -820,7 +844,7 @@ func NewParallelSyncer(baseSyncer *SequentialSyncer, config *ParallelSyncConfig) } } -// Sync implements the Syncer interface using parallel processing +// Sync implements the Syncer interface using parallel processing. func (ps *parallelSyncer) Sync(ctx context.Context) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.Sync") defer span.End() @@ -833,7 +857,7 @@ func (ps *parallelSyncer) Sync(ctx context.Context) error { } // Create task queue - ps.taskQueue = newTaskQueue(ps.config) + ps.taskQueue = newTaskQueue(ps) defer ps.taskQueue.Close() // Start workers @@ -874,7 +898,7 @@ func (ps *parallelSyncer) Sync(ctx context.Context) error { return nil } -// initializeSync performs the initial sync setup +// initializeSync performs the initial sync setup. func (ps *parallelSyncer) initializeSync(ctx context.Context) error { // Load store and validate connector (reuse existing logic) if err := ps.syncer.loadStore(ctx); err != nil { @@ -912,7 +936,7 @@ func (ps *parallelSyncer) initializeSync(ctx context.Context) error { return nil } -// startWorkers starts all worker goroutines +// startWorkers starts all worker goroutines. func (ps *parallelSyncer) startWorkers(ctx context.Context) error { ps.workers = make([]*worker, ps.config.WorkerCount) @@ -926,7 +950,7 @@ func (ps *parallelSyncer) startWorkers(ctx context.Context) error { return nil } -// stopWorkers stops all workers +// stopWorkers stops all workers. func (ps *parallelSyncer) stopWorkers() { for _, worker := range ps.workers { worker.Stop() @@ -934,7 +958,7 @@ func (ps *parallelSyncer) stopWorkers() { ps.workerWg.Wait() } -// areWorkersIdle checks if all workers are currently idle (not processing tasks) +// areWorkersIdle checks if all workers are currently idle (not processing tasks). func (ps *parallelSyncer) areWorkersIdle() bool { ps.mu.RLock() defer ps.mu.RUnlock() @@ -947,7 +971,7 @@ func (ps *parallelSyncer) areWorkersIdle() bool { return true } -// generateInitialTasks creates the initial set of tasks following the original sync workflow +// generateInitialTasks creates the initial set of tasks following the original sync workflow. func (ps *parallelSyncer) generateInitialTasks(ctx context.Context) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.generateInitialTasks") defer span.End() @@ -993,7 +1017,6 @@ func (ps *parallelSyncer) generateInitialTasks(ctx context.Context) error { Op: SyncResourcesOp, ResourceTypeID: rt.Id, }, - Priority: 1, ResourceType: rt, // Include the resource type for bucket determination } @@ -1011,7 +1034,7 @@ func (ps *parallelSyncer) generateInitialTasks(ctx context.Context) error { return nil } -// getBucketForResourceType determines the bucket for a resource type +// getBucketForResourceType determines the bucket for a resource type. func (ps *parallelSyncer) getBucketForResourceType(rt *v2.ResourceType) string { // If the resource type has an explicit sync_bucket, use it if rt.SyncBucket != "" { @@ -1027,7 +1050,7 @@ func (ps *parallelSyncer) getBucketForResourceType(rt *v2.ResourceType) string { return ps.config.DefaultBucket } -// waitForCompletion waits for all tasks to complete with bucket-aware monitoring +// waitForCompletion waits for all tasks to complete with bucket-aware monitoring. func (ps *parallelSyncer) waitForCompletion(ctx context.Context) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.waitForCompletion") defer span.End() @@ -1059,10 +1082,11 @@ func (ps *parallelSyncer) waitForCompletion(ctx context.Context) error { // Debug: Log which buckets still have active tasks activeBuckets := make([]string, 0) for bucketName, taskCount := range bucketStats { - if taskCount > 0 && bucketName != "resource-type-" { + if taskCount > 0 { activeBuckets = append(activeBuckets, fmt.Sprintf("%s:%d", bucketName, taskCount)) } } + l.Debug("active buckets", zap.Strings("active_buckets", activeBuckets)) } // Check if we're making progress @@ -1085,11 +1109,7 @@ func (ps *parallelSyncer) waitForCompletion(ctx context.Context) error { // Double-check that we're truly done with resource processing // Look for any active resource processing in the bucket stats allResourceProcessingComplete := true - for bucketName, taskCount := range bucketStats { - // Skip the default bucket (used for final tasks) - if bucketName == "resource-type-" { - continue - } + for _, taskCount := range bucketStats { if taskCount > 0 { allResourceProcessingComplete = false break @@ -1098,7 +1118,11 @@ func (ps *parallelSyncer) waitForCompletion(ctx context.Context) error { if allResourceProcessingComplete { // Additional safety check: wait a bit more to ensure workers are truly idle - time.Sleep(2 * time.Second) + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(2 * time.Second): + } // Check one more time to ensure no new tasks appeared finalBucketStats := ps.taskQueue.GetBucketStats() @@ -1127,7 +1151,7 @@ func (ps *parallelSyncer) waitForCompletion(ctx context.Context) error { } } -// syncGrantExpansion handles grant expansion by delegating to the base syncer +// syncGrantExpansion handles grant expansion by delegating to the base syncer. func (ps *parallelSyncer) syncGrantExpansion(ctx context.Context) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantExpansion") defer span.End() @@ -1161,7 +1185,7 @@ func (ps *parallelSyncer) syncGrantExpansion(ctx context.Context) error { return nil } -// syncExternalResources handles external resources by delegating to the base syncer +// syncExternalResources handles external resources by delegating to the base syncer. func (ps *parallelSyncer) syncExternalResources(ctx context.Context) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncExternalResources") defer span.End() @@ -1182,7 +1206,7 @@ func (ps *parallelSyncer) syncExternalResources(ctx context.Context) error { return err } -// finalizeSync performs final sync cleanup +// finalizeSync performs final sync cleanup. func (ps *parallelSyncer) finalizeSync(ctx context.Context) error { // End sync if err := ps.syncer.store.EndSync(ctx); err != nil { @@ -1202,7 +1226,7 @@ func (ps *parallelSyncer) finalizeSync(ctx context.Context) error { return nil } -// syncResourceTypes syncs resource types (equivalent to SyncResourceTypes) +// syncResourceTypes syncs resource types (equivalent to SyncResourceTypes). func (ps *parallelSyncer) syncResourceTypes(ctx context.Context) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncResourceTypes") defer span.End() @@ -1223,152 +1247,7 @@ func (ps *parallelSyncer) syncResourceTypes(ctx context.Context) error { return nil } -// syncResources processes resources for a specific resource type (equivalent to SyncResources) -func (ps *parallelSyncer) syncResources(ctx context.Context, action Action) error { - ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncResources") - defer span.End() - - l := ctxzap.Extract(ctx) - - // Add panic recovery to catch any unexpected errors - defer func() { - if r := recover(); r != nil { - l.Error("panic in syncResources", - zap.String("resource_type", action.ResourceTypeID), - zap.Any("panic", r)) - } - }() - - // This replicates the exact logic from the original SyncResources - req := &v2.ResourcesServiceListResourcesRequest{ - ResourceTypeId: action.ResourceTypeID, - PageToken: action.PageToken, - } - - // If this is a child resource task, set the parent resource ID - if action.ParentResourceID != "" { - req.ParentResourceId = &v2.ResourceId{ - ResourceType: action.ParentResourceTypeID, - Resource: action.ParentResourceID, - } - } - - resp, err := ps.syncer.connector.ListResources(ctx, req) - if err != nil { - l.Error("failed to list resources", zap.Error(err)) - return err - } - - // Store resources - if len(resp.List) > 0 { - err = ps.syncer.store.PutResources(ctx, resp.List...) - if err != nil { - l.Error("failed to store resources", zap.Error(err)) - return err - } - } - - // Update progress counts - resourceTypeId := action.ResourceTypeID - ps.syncer.counts.AddResources(resourceTypeId, len(resp.List)) - - // Log progress - if len(resp.List) > 0 { - ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) - } else { - // Even with no resources, we should log progress - ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) - } - - // Process each resource (handle sub-resources) - for _, r := range resp.List { - // Use the base syncer's getSubResources method - if err := ps.syncer.getSubResources(ctx, r); err != nil { - l.Error("failed to process sub-resources", zap.Error(err)) - return err - } - } - - // Handle pagination - if there are more pages, create a task for the next page - if resp.NextPageToken != "" { - nextPageTask := &task{ - Action: Action{ - Op: SyncResourcesOp, - ResourceTypeID: action.ResourceTypeID, - PageToken: resp.NextPageToken, - }, - Priority: 1, - } - - if err := ps.addTaskWithRetry(ctx, nextPageTask, taskRetryLimit); err != nil { - return fmt.Errorf("failed to add next page task for resource type %s: %w", action.ResourceTypeID, err) - } - - return nil // Don't create entitlement/grant tasks yet, wait for all pages - } - - // Get all resources for this resource type to create individual tasks - allResourcesResp, err := ps.syncer.store.ListResources(ctx, &v2.ResourcesServiceListResourcesRequest{ - ResourceTypeId: action.ResourceTypeID, - PageToken: "", - }) - if err != nil { - l.Error("failed to list resources for task creation", zap.Error(err)) - return err - } - // Check if this resource type has child resource types that need to be processed - // We need to process child resources before entitlements and grants - if err := ps.processChildResourceTypes(ctx, action.ResourceTypeID); err != nil { - l.Error("failed to process child resource types", zap.Error(err)) - return err - } - - // Create individual tasks for each resource's entitlements and grants - for _, resource := range allResourcesResp.List { - // Check if we should skip entitlements and grants for this resource - shouldSkip, err := ps.shouldSkipEntitlementsAndGrants(ctx, resource) - if err != nil { - l.Error("failed to check if resource should be skipped", zap.Error(err)) - return err - } - if shouldSkip { - continue - } - - // Create task to sync entitlements for this specific resource - entitlementsTask := &task{ - Action: Action{ - Op: SyncEntitlementsOp, - ResourceTypeID: action.ResourceTypeID, - ResourceID: resource.Id.Resource, - }, - Priority: 2, - } - - if err := ps.addTaskWithRetry(ctx, entitlementsTask, taskRetryLimit); err != nil { - return fmt.Errorf("failed to add entitlements task for resource %s: %w", resource.Id.Resource, err) - } - - // Create task to sync grants for this specific resource - grantsTask := &task{ - Action: Action{ - Op: SyncGrantsOp, - ResourceTypeID: action.ResourceTypeID, - ResourceID: resource.Id.Resource, - }, - Priority: 3, - } - - if err := ps.addTaskWithRetry(ctx, grantsTask, taskRetryLimit); err != nil { - l.Error("failed to add grants task", zap.Error(err)) - return fmt.Errorf("failed to add grants task for resource %s: %w", resource.Id.Resource, err) - } - } - - return nil -} - -// syncResourcesCollectTasks does the same work as syncResources but collects tasks instead of adding them immediately +// syncResourcesCollectTasks does the same work as syncResources but collects tasks instead of adding them immediately. func (ps *parallelSyncer) syncResourcesCollectTasks(ctx context.Context, action Action) ([]*task, error) { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncResourcesCollectTasks") defer span.End() @@ -1419,11 +1298,7 @@ func (ps *parallelSyncer) syncResourcesCollectTasks(ctx context.Context, action ps.syncer.counts.AddResources(resourceTypeId, len(resp.List)) // Log progress - if len(resp.List) > 0 { - ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) - } else { - ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) - } + ps.syncer.counts.LogResourcesProgress(ctx, resourceTypeId) // Process each resource (handle sub-resources) for _, r := range resp.List { @@ -1441,7 +1316,6 @@ func (ps *parallelSyncer) syncResourcesCollectTasks(ctx context.Context, action ResourceTypeID: action.ResourceTypeID, PageToken: resp.NextPageToken, }, - Priority: 1, } collectedTasks = append(collectedTasks, nextPageTask) return collectedTasks, nil // Don't create entitlement/grant tasks yet, wait for all pages @@ -1469,7 +1343,7 @@ func (ps *parallelSyncer) syncResourcesCollectTasks(ctx context.Context, action return collectedTasks, nil } -// syncResourcesCollectTasks does the same work as syncResources but collects tasks instead of adding them immediately +// syncResourcesCollectTasks does the same work as syncResources but collects tasks instead of adding them immediately. func (ps *parallelSyncer) collectEntitlementsAndGrantsTasks(ctx context.Context, action Action) ([]*task, error) { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.collectEntitlementsAndGrantsTasks") defer span.End() @@ -1514,7 +1388,6 @@ func (ps *parallelSyncer) collectEntitlementsAndGrantsTasks(ctx context.Context, ResourceTypeID: action.ResourceTypeID, ResourceID: resource.Id.Resource, }, - Priority: 2, } collectedTasks = append(collectedTasks, entitlementsTask) @@ -1525,7 +1398,6 @@ func (ps *parallelSyncer) collectEntitlementsAndGrantsTasks(ctx context.Context, ResourceTypeID: action.ResourceTypeID, ResourceID: resource.Id.Resource, }, - Priority: 3, } collectedTasks = append(collectedTasks, grantsTask) } @@ -1536,14 +1408,13 @@ func (ps *parallelSyncer) collectEntitlementsAndGrantsTasks(ctx context.Context, ResourceTypeID: action.ResourceTypeID, PageToken: allResourcesResp.NextPageToken, }, - Priority: 3, }) } return collectedTasks, nil } -// processChildResourceTypes processes child resource types for a given parent resource type +// processChildResourceTypes processes child resource types for a given parent resource type. func (ps *parallelSyncer) processChildResourceTypes(ctx context.Context, parentResourceTypeID string) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.processChildResourceTypes") defer span.End() @@ -1574,7 +1445,7 @@ func (ps *parallelSyncer) processChildResourceTypes(ctx context.Context, parentR return nil } -// processChildResourcesForParent processes child resources for a specific parent resource +// processChildResourcesForParent processes child resources for a specific parent resource. func (ps *parallelSyncer) processChildResourcesForParent(ctx context.Context, parentResource *v2.Resource) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.processChildResourcesForParent") defer span.End() @@ -1597,7 +1468,6 @@ func (ps *parallelSyncer) processChildResourcesForParent(ctx context.Context, pa ParentResourceTypeID: parentResource.Id.ResourceType, ParentResourceID: parentResource.Id.Resource, }, - Priority: 1, // Lower priority than parent resources } if err := ps.addTaskWithRetry(ctx, childResourcesTask, taskRetryLimit); err != nil { @@ -1609,7 +1479,7 @@ func (ps *parallelSyncer) processChildResourcesForParent(ctx context.Context, pa return nil } -// syncEntitlementsForResourceType processes entitlements for all resources of a resource type +// syncEntitlementsForResourceType processes entitlements for all resources of a resource type. func (ps *parallelSyncer) syncEntitlementsForResourceType(ctx context.Context, action Action) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncEntitlementsForResourceType") defer span.End() @@ -1651,8 +1521,7 @@ func (ps *parallelSyncer) syncEntitlementsForResourceType(ctx context.Context, a } // Handle pagination if needed - for decision.ShouldContinue && decision.Action == "next_page" { - + for decision.ShouldContinue && decision.Action == nextPageAction { // Update the local state with the new page token before continuing if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { l.Error("failed to update local state with next page token", @@ -1677,7 +1546,7 @@ func (ps *parallelSyncer) syncEntitlementsForResourceType(ctx context.Context, a return nil } -// syncEntitlementsForResource processes entitlements for a specific resource +// syncEntitlementsForResource processes entitlements for a specific resource. func (ps *parallelSyncer) syncEntitlementsForResource(ctx context.Context, action Action) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncEntitlementsForResource") defer span.End() @@ -1703,7 +1572,7 @@ func (ps *parallelSyncer) syncEntitlementsForResource(ctx context.Context, actio } // Handle pagination if needed - for decision.ShouldContinue && decision.Action == "next_page" { + for decision.ShouldContinue && decision.Action == nextPageAction { // Update the local state with the new page token before continuing if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { l.Error("failed to update local state with next page token", @@ -1728,7 +1597,7 @@ func (ps *parallelSyncer) syncEntitlementsForResource(ctx context.Context, actio return nil } -// syncGrantsForResource processes grants for a specific resource +// syncGrantsForResource processes grants for a specific resource. func (ps *parallelSyncer) syncGrantsForResource(ctx context.Context, action Action) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantsForResource") defer span.End() @@ -1754,7 +1623,7 @@ func (ps *parallelSyncer) syncGrantsForResource(ctx context.Context, action Acti } // Handle pagination if needed - for decision.ShouldContinue && decision.Action == "next_page" { + for decision.ShouldContinue && decision.Action == nextPageAction { // Update the local state with the new page token before continuing if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { l.Error("failed to update local state with next page token", @@ -1779,7 +1648,7 @@ func (ps *parallelSyncer) syncGrantsForResource(ctx context.Context, action Acti return nil } -// syncGrantsForResourceType processes grants for all resources of a resource type +// syncGrantsForResourceType processes grants for all resources of a resource type. func (ps *parallelSyncer) syncGrantsForResourceType(ctx context.Context, action Action) error { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantsForResourceType") defer span.End() @@ -1821,7 +1690,7 @@ func (ps *parallelSyncer) syncGrantsForResourceType(ctx context.Context, action } // Handle pagination if needed - for decision.ShouldContinue && decision.Action == "next_page" { + for decision.ShouldContinue && decision.Action == nextPageAction { // Update the local state with the new page token before continuing if err := localState.NextPage(ctx, decision.NextPageToken); err != nil { l.Error("failed to update local state with next page token", @@ -1847,8 +1716,8 @@ func (ps *parallelSyncer) syncGrantsForResourceType(ctx context.Context, action return nil } -// syncGrantsForResourceLogic contains the core logic for syncing grants for a resource -// This method is state-agnostic and returns an ActionDecision for the caller to handle +// syncGrantsForResourceLogic contains the core logic for syncing grants for a resource. +// This method is state-agnostic and returns an ActionDecision for the caller to handle. func (ps *parallelSyncer) syncGrantsForResourceLogic(ctx context.Context, resourceID *v2.ResourceId, state StateInterface) (*ActionDecision, error) { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncGrantsForResourceLogic") defer span.End() @@ -1983,7 +1852,7 @@ func (ps *parallelSyncer) syncGrantsForResourceLogic(ctx context.Context, resour return &ActionDecision{ ShouldContinue: true, NextPageToken: resp.NextPageToken, - Action: "next_page", + Action: nextPageAction, NeedsExpansion: needsExpansion, HasExternalResources: hasExternalResources, ShouldFetchRelated: shouldFetchRelated, @@ -1993,15 +1862,15 @@ func (ps *parallelSyncer) syncGrantsForResourceLogic(ctx context.Context, resour // No more pages, action is complete return &ActionDecision{ ShouldContinue: false, - Action: "finish", + Action: finishAction, NeedsExpansion: needsExpansion, HasExternalResources: hasExternalResources, ShouldFetchRelated: shouldFetchRelated, }, nil } -// syncEntitlementsForResourceLogic contains the core logic for syncing entitlements for a resource -// This method is state-agnostic and returns an ActionDecision for the caller to handle +// syncEntitlementsForResourceLogic contains the core logic for syncing entitlements for a resource. +// This method is state-agnostic and returns an ActionDecision for the caller to handle. func (ps *parallelSyncer) syncEntitlementsForResourceLogic(ctx context.Context, resourceID *v2.ResourceId, state StateInterface) (*ActionDecision, error) { ctx, span := parallelTracer.Start(ctx, "parallelSyncer.syncEntitlementsForResourceLogic") defer span.End() @@ -2041,51 +1910,18 @@ func (ps *parallelSyncer) syncEntitlementsForResourceLogic(ctx context.Context, return &ActionDecision{ ShouldContinue: true, NextPageToken: resp.NextPageToken, - Action: "next_page", + Action: nextPageAction, }, nil } // No more pages, action is complete return &ActionDecision{ ShouldContinue: false, - Action: "finish", + Action: finishAction, }, nil } -// getSubResources fetches the sub resource types from a resources' annotations (replicating original logic) -func (ps *parallelSyncer) getSubResources(ctx context.Context, parent *v2.Resource) error { - ctx, span := parallelTracer.Start(ctx, "parallelSyncer.getSubResources") - defer span.End() - - for _, a := range parent.Annotations { - if a.MessageIs((*v2.ChildResourceType)(nil)) { - crt := &v2.ChildResourceType{} - err := a.UnmarshalTo(crt) - if err != nil { - return err - } - - // Create task for child resource type - childTask := &task{ - Action: Action{ - Op: SyncResourcesOp, - ResourceTypeID: crt.ResourceTypeId, - ParentResourceID: parent.Id.Resource, - ParentResourceTypeID: parent.Id.ResourceType, - }, - Priority: 1, - } - - if err := ps.addTaskWithRetry(ctx, childTask, taskRetryLimit); err != nil { - return fmt.Errorf("failed to add child resource task: %w", err) - } - } - } - - return nil -} - -// shouldSkipEntitlementsAndGrants checks if entitlements and grants should be skipped for a resource +// shouldSkipEntitlementsAndGrants checks if entitlements and grants should be skipped for a resource. func (ps *parallelSyncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r *v2.Resource) (bool, error) { // This replicates the logic from the original shouldSkipEntitlementsAndGrants method // Check if the resource has the SkipEntitlementsAndGrants annotation @@ -2099,7 +1935,7 @@ func (ps *parallelSyncer) shouldSkipEntitlementsAndGrants(ctx context.Context, r return false, nil } -// Close implements the Syncer interface +// Close implements the Syncer interface. func (ps *parallelSyncer) Close(ctx context.Context) error { // Stop all workers ps.stopWorkers() @@ -2113,7 +1949,7 @@ func (ps *parallelSyncer) Close(ctx context.Context) error { return ps.syncer.Close(ctx) } -// GetBucketStats returns statistics about all buckets +// GetBucketStats returns statistics about all buckets. func (ps *parallelSyncer) GetBucketStats() map[string]int { if ps.taskQueue == nil { return make(map[string]int) @@ -2121,7 +1957,7 @@ func (ps *parallelSyncer) GetBucketStats() map[string]int { return ps.taskQueue.GetBucketStats() } -// GetWorkerStatus returns the status of all workers +// GetWorkerStatus returns the status of all workers. func (ps *parallelSyncer) GetWorkerStatus() []map[string]interface{} { ps.mu.RLock() defer ps.mu.RUnlock() @@ -2136,7 +1972,7 @@ func (ps *parallelSyncer) GetWorkerStatus() []map[string]interface{} { return status } -// NewParallelSyncerFromSyncer creates a parallel syncer from an existing syncer +// NewParallelSyncerFromSyncer creates a parallel syncer from an existing syncer. func NewParallelSyncerFromSyncer(s Syncer, config *ParallelSyncConfig) (*parallelSyncer, error) { // Try to cast to the concrete syncer type if baseSyncer, ok := s.(*SequentialSyncer); ok { @@ -2145,45 +1981,3 @@ func NewParallelSyncerFromSyncer(s Syncer, config *ParallelSyncConfig) (*paralle return nil, fmt.Errorf("cannot create parallel syncer from syncer type: %T", s) } - -// syncGrantsForResourceSequential is the refactored version that returns ActionDecision -// This can be called by the sequential syncer to get the same behavior but with explicit control -func (ps *parallelSyncer) syncGrantsForResourceSequential(ctx context.Context, resourceID *v2.ResourceId) (*ActionDecision, error) { - // Create a state interface that delegates to the base syncer's state - stateWrapper := &sequentialStateWrapper{syncer: ps.syncer} - return ps.syncGrantsForResourceLogic(ctx, resourceID, stateWrapper) -} - -// syncEntitlementsForResourceSequential is the refactored version that returns ActionDecision -// This can be called by the sequential syncer to get the same behavior but with explicit control -func (ps *parallelSyncer) syncEntitlementsForResourceSequential(ctx context.Context, resourceID *v2.ResourceId) (*ActionDecision, error) { - // Create a state interface that delegates to the base syncer's state - stateWrapper := &sequentialStateWrapper{syncer: ps.syncer} - return ps.syncEntitlementsForResourceLogic(ctx, resourceID, stateWrapper) -} - -// sequentialStateWrapper implements StateInterface by delegating to the base syncer's state -// This allows the sequential syncer to use the refactored methods while maintaining its state machine -type sequentialStateWrapper struct { - syncer *SequentialSyncer -} - -func (sw *sequentialStateWrapper) PageToken(ctx context.Context) string { - return sw.syncer.state.PageToken(ctx) -} - -func (sw *sequentialStateWrapper) NextPage(ctx context.Context, pageToken string) error { - return sw.syncer.state.NextPage(ctx, pageToken) -} - -func (sw *sequentialStateWrapper) SetNeedsExpansion() { - sw.syncer.state.SetNeedsExpansion() -} - -func (sw *sequentialStateWrapper) SetHasExternalResourcesGrants() { - sw.syncer.state.SetHasExternalResourcesGrants() -} - -func (sw *sequentialStateWrapper) ShouldFetchRelatedResources() bool { - return sw.syncer.state.ShouldFetchRelatedResources() -} diff --git a/pkg/sync/syncer.go b/pkg/sync/syncer.go index 40f8f5a84..a7e3502b6 100644 --- a/pkg/sync/syncer.go +++ b/pkg/sync/syncer.go @@ -278,35 +278,35 @@ func (p *ProgressCounts) LogExpandProgress(ctx context.Context, actions []*expan // Thread-safe methods for parallel syncer -// AddResourceTypes safely adds to the resource types count +// AddResourceTypes safely adds to the resource types count. func (p *ProgressCounts) AddResourceTypes(count int) { p.mu.Lock() defer p.mu.Unlock() p.ResourceTypes += count } -// AddResources safely adds to the resources count for a specific resource type +// AddResources safely adds to the resources count for a specific resource type. func (p *ProgressCounts) AddResources(resourceType string, count int) { p.mu.Lock() defer p.mu.Unlock() p.Resources[resourceType] += count } -// AddEntitlementsProgress safely adds to the entitlements progress count for a specific resource type +// AddEntitlementsProgress safely adds to the entitlements progress count for a specific resource type. func (p *ProgressCounts) AddEntitlementsProgress(resourceType string, count int) { p.mu.Lock() defer p.mu.Unlock() p.EntitlementsProgress[resourceType] += count } -// AddGrantsProgress safely adds to the grants progress count for a specific resource type +// AddGrantsProgress safely adds to the grants progress count for a specific resource type. func (p *ProgressCounts) AddGrantsProgress(resourceType string, count int) { p.mu.Lock() defer p.mu.Unlock() p.GrantsProgress[resourceType] += count } -// SetSequentialMode enables/disables mutex protection for sequential sync +// SetSequentialMode enables/disables mutex protection for sequential sync. func (p *ProgressCounts) SetSequentialMode(sequential bool) { p.sequentialMode = sequential } diff --git a/pkg/tasks/local/syncer.go b/pkg/tasks/local/syncer.go index 39cc58bb9..5a1c5cbcf 100644 --- a/pkg/tasks/local/syncer.go +++ b/pkg/tasks/local/syncer.go @@ -122,8 +122,7 @@ func (m *localSyncer) Process(ctx context.Context, task *v1.Task, cc types.Conne } if m.parallelSync { - config := sdkSync.DefaultParallelSyncConfig() - config.WithWorkerCount(10) + config := sdkSync.DefaultParallelSyncConfig().WithWorkerCount(10) syncer = sdkSync.NewParallelSyncer(baseSyncer, config) } else { syncer = baseSyncer From 3399982a943664fc6275749652f1e1a48ede1f43 Mon Sep 17 00:00:00 2001 From: Justin Gallardo Date: Tue, 21 Oct 2025 17:26:09 -0700 Subject: [PATCH 3/3] Use context in QueryRow when checking for wal mode --- pkg/dotc1z/c1file.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/dotc1z/c1file.go b/pkg/dotc1z/c1file.go index 5484495a8..1f1963270 100644 --- a/pkg/dotc1z/c1file.go +++ b/pkg/dotc1z/c1file.go @@ -262,7 +262,7 @@ func (c *C1File) init(ctx context.Context) error { } // Start WAL checkpointing if enabled, journal mode is WAL, and checkpointing is enabled - if c.checkpointEnabled && c.isWALMode() { + if c.checkpointEnabled && c.isWALMode(ctx) { c.startWALCheckpointing() } @@ -457,15 +457,15 @@ func (c *C1File) GrantStats(ctx context.Context, syncType connectorstore.SyncTyp } // isWALMode checks if the database is using WAL mode. -func (c *C1File) isWALMode() bool { +func (c *C1File) isWALMode(ctx context.Context) bool { for _, pragma := range c.pragmas { - if pragma.name == "journal_mode" && strings.EqualFold(pragma.value, "wall") { + if pragma.name == "journal_mode" && strings.EqualFold(pragma.value, "wal") { return true } } var mode string - if err := c.rawDb.QueryRow("PRAGMA journal_mode").Scan(&mode); err == nil { + if err := c.rawDb.QueryRowContext(ctx, "PRAGMA journal_mode").Scan(&mode); err == nil { return strings.EqualFold(mode, "wal") }